• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Dapper.DynamicParameters类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中FeatureDemandPlanning.Model.Dapper.DynamicParameters的典型用法代码示例。如果您正苦于以下问题:C# DynamicParameters类的具体用法?C# DynamicParameters怎么用?C# DynamicParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DynamicParameters类属于FeatureDemandPlanning.Model.Dapper命名空间,在下文中一共展示了DynamicParameters类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: FdpUserGetRoles

        public IEnumerable<UserRole> FdpUserGetRoles(User forUser)
        {
            IList<UserRole> retVal = new List<UserRole>{UserRole.None};
            using (var conn = DbHelper.GetDBConnection())
            {
                try
                {
                    var para = new DynamicParameters();
                    para.Add("@CDSId", forUser.CDSId, DbType.String);
                   
                    var results = conn.Query<FdpUserRoleDataItem>("dbo.Fdp_UserRole_GetMany", para, commandType: CommandType.StoredProcedure);
                    var fdpUserRoleDataItems = results as IList<FdpUserRoleDataItem> ?? results.ToList();
                    if (fdpUserRoleDataItems.Any())
                    {
                        retVal = fdpUserRoleDataItems.Select(role => (UserRole) role.FdpUserRoleId).ToList();
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                    throw;
                }
            }

            return retVal;
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:26,代码来源:UserDataStore.cs


示例2: FromCDSId

        public static DynamicParameters FromCDSId(string cdsId, string parameterName = "CDSId")
        {
            var parameters = new DynamicParameters();
            parameters.Add("@" + parameterName, cdsId, dbType: DbType.String);

            return parameters;
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:7,代码来源:DynamicParameters.cs


示例3: TakeRateModelSummaryItemGet

        public TakeRateDataItem TakeRateModelSummaryItemGet(TakeRateFilter filter)
        {
            TakeRateDataItem retVal;

            using (var conn = DbHelper.GetDBConnection())
            {
                try
                {
                    var para = new DynamicParameters();
                    
                    para.Add("@FdpVolumeHeaderId", filter.TakeRateId, DbType.Int32);
                    para.Add("@MarketId", filter.MarketId, DbType.Int32);
                    para.Add("@ModelId", filter.ModelId, DbType.Int32);
                    para.Add("@FdpModelId", filter.FdpModelId, DbType.Int32);

                    var results = conn.QueryMultiple(fdpTakeRateModelSummaryItemGetStoredProcedureName, para, commandType: CommandType.StoredProcedure);
                    retVal = results.Read<TakeRateDataItem>().First();

                    retVal.Notes = results.Read<TakeRateDataItemNote>();
                    retVal.History = results.Read<TakeRateDataItemAudit>();
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                    throw;
                }
            }
            return retVal;
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:29,代码来源:TakeRateDataStore.cs


示例4: EngineCodeMappingGetMany

        public IEnumerable<EngineCodeMapping> EngineCodeMappingGetMany()
        {
            IList<EngineCodeMapping> retVal;
            using (var conn = DbHelper.GetDBConnection())
            {
                try
                {
                    var para = new DynamicParameters();
                    para.Add("@TotalRecords", null, DbType.Int32, ParameterDirection.Output);

                    var results = conn.Query<EngineCodeMapping>("dbo.Fdp_EngineCode_GetMany", para, commandType: CommandType.StoredProcedure);
                    var totalRecords = para.Get<int?>("@TotalRecords");

                    retVal = new List<EngineCodeMapping>();

                    foreach (var result in results)
                    {
                        result.TotalRecords = totalRecords.Value;
                        retVal.Add(result);
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                    throw;
                }
            }

            return retVal;
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:30,代码来源:ProgrammeDataStore.cs


示例5: FdpDerivativeMappingDelete

        public FdpDerivativeMapping FdpDerivativeMappingDelete(FdpDerivativeMapping derivativeMapping)
        {
            FdpDerivativeMapping retVal = new EmptyFdpDerivativeMapping();
            using (IDbConnection conn = DbHelper.GetDBConnection())
            {
                try
                {
                    var para = new DynamicParameters();
                    para.Add("@FdpDerivativeMappingId", derivativeMapping.FdpDerivativeMappingId, DbType.Int32);
                    para.Add("@CDSId", CurrentCDSID, DbType.String);

                    var results = conn.Query<FdpDerivativeMapping>("Fdp_DerivativeMapping_Delete", para, commandType: CommandType.StoredProcedure);
                    if (results.Any())
                    {
                        retVal = results.First();
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                    throw;
                }
            }
            return retVal;
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:25,代码来源:DerivativeDataStore.cs


示例6: EngineCodeMappingSave

        public EngineCodeMapping EngineCodeMappingSave(EngineCodeMapping mapping)
        {
            var retVal = mapping;

            using (var conn = DbHelper.GetDBConnection())
            {
                try
                {
                    var para = new DynamicParameters();

                    para.Add("@ProgrammeId", mapping.ProgrammeId, DbType.Int32);
                    para.Add("@EngineId", mapping.EngineId, DbType.Int32);
                    para.Add("@ExternalEngineCode", 
                        string.IsNullOrEmpty(mapping.ExternalEngineCode) ? null : mapping.ExternalEngineCode, DbType.String);
                    para.Add("@MappingId", null, DbType.Int32, ParameterDirection.Output);

                    conn.Execute("dbo.Fdp_EngineCode_Save", para, commandType: CommandType.StoredProcedure);

                    if (!mapping.MappingId.HasValue)
                    {
                        mapping.MappingId = para.Get<int>("@MappingId");
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                    throw;
                }
            }

            return mapping;
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:32,代码来源:ProgrammeDataStore.cs


示例7: GetParametersFromFilter

        /// <summary>
        /// Gets basic search parameters to pass to the data store based on the filter
        /// </summary>
        /// <param name="filter">The filter.</param>
        /// <returns></returns>
        public static DynamicParameters GetParametersFromFilter(FilterBase filter)
        {
            var para = new DynamicParameters();

            if (filter.PageIndex.HasValue)
            {
                para.Add("@PageIndex", filter.PageIndex.Value, dbType: DbType.Int32);
            }

            if (filter.PageSize.HasValue)
            {
                para.Add("@PageSize", filter.PageSize.Value, dbType: DbType.Int32);
            }

            if (filter.SortIndex.HasValue)
            {
                para.Add("@SortIndex", filter.SortIndex.Value, dbType: DbType.Int32);
            }

            if (filter.SortDirection != SortDirection.NotSet)
            {
                para.Add("@SortDirection", (int)filter.SortDirection, dbType: DbType.Int32);
            }

            return para;
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:31,代码来源:FilterBase.cs


示例8: ConfigurationSave

        public bool ConfigurationSave(ConfigurationItem obj)
        {
            var retVal = true;
            const string procName = "dbo.Fdp_Configuration_Edit";

			using (var conn = DbHelper.GetDBConnection())
            {
				try
				{
					var para = new DynamicParameters();

					 para.Add("@p_ConfigurationKey", obj.ConfigurationKey, DbType.String, size: 50);
					 para.Add("@p_Value", obj.Value, DbType.String, size: -1);
					 para.Add("@p_Description", obj.Description, DbType.String, size: -1);
                     para.Add("@p_DataType", obj.DataType, DbType.String, size: 50);

					conn.Execute(procName, para, commandType: CommandType.StoredProcedure);
				}
				catch (Exception ex)
				{
                    Log.Error(ex);
                    throw;
				}
			}

            return retVal;
            
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:28,代码来源:ConfigurationDal.cs


示例9: VehicleGetMany

        public IEnumerable<Vehicle> VehicleGetMany(string make, bool deepGet = false)             
        {
            IEnumerable<Vehicle> retVal = null;
            using (IDbConnection conn = DbHelper.GetDBConnection())
            {
                try
                {
                    List<Vehicle> vehicles;

                    var para = new DynamicParameters();
                    para.Add("@p_make", make, dbType: DbType.String, size: 500);
                    using (var multi = conn.QueryMultiple("dbo.OXO_Vehicle_GetMany", para, commandType: CommandType.StoredProcedure))
                    {
                        vehicles = multi.Read<Vehicle>().ToList();
                        if (deepGet)
                        {
                            var programmes = multi.Read<Programme>().ToList();
                            foreach (var vehicle in vehicles)
                            {
                                vehicle.Programmes = programmes.Where(c => c.ParentId == vehicle.Id).ToList();
                            }
                        }
                    }

                    retVal = vehicles;
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                    throw;
                }
            }

            return retVal;
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:35,代码来源:OXOVehicleDS.cs


示例10: VehicleGet

        public Vehicle VehicleGet(int id, bool deepGet = false)
        {
            Vehicle retVal = null;

            using (IDbConnection conn = DbHelper.GetDBConnection())
            {
                try
                {
                    var para = new DynamicParameters();
                    para.Add("@p_Id", id, dbType: DbType.Int32);
                   // para.Add("@p_deep_get", deepGet, dbType: DbType.Boolean);
                    using (var multi = conn.QueryMultiple("dbo.OXO_Vehicle_Get", para, commandType: CommandType.StoredProcedure))
                    {
                        retVal = multi.Read<Vehicle>().FirstOrDefault(); ;
                        var programmes = multi.Read<Programme>().ToList();
                        if (retVal != null)
                            retVal.Programmes = programmes.ToList();
                    }


                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                    throw;
                }
            }

            return retVal;
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:30,代码来源:OXOVehicleDS.cs


示例11: RuleResultGetMany

        public IEnumerable<OXORuleResult> RuleResultGetMany(int docid, int progid, string level, int objid, bool? showWhat)
        {
            IEnumerable<OXORuleResult> retVal = null;   
			using (IDbConnection conn = DbHelper.GetDBConnection())
            {
				try
				{
					var para = new DynamicParameters();

                    para.Add("@p_oxo_doc_id", docid, dbType: DbType.Int32);
                    para.Add("@p_prog_id", progid, dbType: DbType.Int32);
                    para.Add("@p_Level", level, dbType: DbType.String, size: 3);
                    para.Add("@p_ObjectId", objid, dbType: DbType.Int32);
                    para.Add("@p_show_what", showWhat, dbType: DbType.Boolean);
					    
					retVal = conn.Query<OXORuleResult>("dbo.OXO_Programme_Rule_Result_GetMany", para, commandType: CommandType.StoredProcedure);
				}
				catch (Exception ex)
				{
                    Log.Error(ex);
                    throw;
				}
			}

            return retVal;   
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:26,代码来源:OXORuleResultDS.cs


示例12: FdpUserSave

        public User FdpUserSave(User userToAdd)
        {
            User retVal = new EmptyUser();

            using (var conn = DbHelper.GetDBConnection())
            {
                try
                {
                    var para = new DynamicParameters();
                    para.Add("@CDSId", userToAdd.CDSId, DbType.String);
                    para.Add("@FullName", userToAdd.FullName, DbType.String);
                    para.Add("@Mail", userToAdd.Mail, DbType.String);
                    para.Add("@IsAdmin", userToAdd.IsAdmin, DbType.Boolean);
                    para.Add("@CreatorCDSId", CurrentCDSID, DbType.String);
                    
                    var results = conn.Query<UserDataItem>("dbo.Fdp_User_Save", para, commandType: CommandType.StoredProcedure);
                    var enumerable = results as IList<UserDataItem> ?? results.ToList();
                    if (enumerable.Any()) {
                        retVal = enumerable.First().ToUser();
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                    throw;
                }
            }

            return retVal;
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:30,代码来源:UserDataStore.cs


示例13: OXORuleFeatureSave

        public bool OXORuleFeatureSave(RuleFeature obj, IDbConnection conn)
        {
            bool retVal = true;
            string procName = "dbo.OXO_Rule_Feature_New";

            try
            {

                obj.Save(this.CurrentCDSID);

                var para = new DynamicParameters();

                para.Add("@p_RuleId", obj.RuleId, dbType: DbType.Int32);
                para.Add("@p_ProgrammeId", obj.ProgrammeId, dbType: DbType.Int32);
                para.Add("@p_FeatureId", obj.FeatureId, dbType: DbType.Int32);
                para.Add("@p_CreatedBy", obj.CreatedBy, dbType: DbType.String, size: 8);
                para.Add("@p_CreatedOn", obj.CreatedOn, dbType: DbType.DateTime);
                para.Add("@p_UpdatedBy", obj.UpdatedBy, dbType: DbType.String, size: 8);
                para.Add("@p_LastUpdated", obj.LastUpdated, dbType: DbType.DateTime);

                conn.Execute(procName, para, commandType: CommandType.StoredProcedure);

            }
            catch (Exception ex)
            {
                Log.Error(ex);
                throw;
            }

            return retVal;

        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:32,代码来源:OXORuleFeatureDS.cs


示例14: ChangeDiarySave

        public bool ChangeDiarySave(ChangeDiary obj)
        {
            bool retVal = true;
            string procName = (obj.Id == 0 ? "dbo.OXO_ChangeDiary_New" : "dbo.OXO_ChangeDiary_Edit");

			using (IDbConnection conn = DbHelper.GetDBConnection())
            {
				try
				{
					var para = new DynamicParameters();

					 para.Add("@p_OXO_Doc_Id", obj.OXODocId, dbType: DbType.Int32);
					 para.Add("@p_Programme_Id", obj.ProgrammeId, dbType: DbType.Int32);
                     para.Add("@p_Version_Info", obj.VersionInfo, dbType: DbType.String, size: 500);					
					 para.Add("@p_Entry_Header", obj.EntryHeader, dbType: DbType.String, size: -1);
					 para.Add("@p_Entry_Date", obj.EntryDate, dbType: DbType.DateTime);
					 para.Add("@p_Markets", obj.Markets, dbType: DbType.String, size: -1);
					 para.Add("@p_Models", obj.Models, dbType: DbType.String, size: -1);
					 para.Add("@p_Features", obj.Features, dbType: DbType.String, size: -1);
					 para.Add("@p_Current_Fitment", obj.CurrentFitment, dbType: DbType.String, size: 50);
					 para.Add("@p_Proposed_Fitment", obj.ProposedFitment, dbType: DbType.String, size: 50);
					 para.Add("@p_Comment", obj.Comment, dbType: DbType.String, size: -1);
                     para.Add("@p_Pricing_Status", obj.PricingStatus, dbType: DbType.String, size: 500);
                     para.Add("@p_Digital_Status", obj.DigitalStatus, dbType: DbType.String, size: 500);
                     para.Add("@p_Requester", obj.Requester, dbType: DbType.String, size: 100);
					 para.Add("@p_PACN", obj.PACN, dbType: DbType.String, size: 100);
					 para.Add("@p_ETracker", obj.ETracker, dbType: DbType.String, size: 100);
					 para.Add("@p_Order_Call", obj.OrderCall, dbType: DbType.String, size: 100);
					 para.Add("@p_Build_Effective_Date", obj.BuildEffectiveDate, dbType: DbType.DateTime);
					    

					if (obj.Id == 0)
					{
						para.Add("@p_Id", dbType: DbType.Int32, direction: ParameterDirection.Output);
					}
					else
					{
						para.Add("@p_Id", obj.Id, dbType: DbType.Int32);
					}

					conn.Execute(procName, para, commandType: CommandType.StoredProcedure);

					if (obj.Id == 0)
					{
						obj.Id = para.Get<int>("@p_Id");
					}

				}
				catch (Exception ex)
				{
                    Log.Error(ex);
                    throw;
				}
			}

            return retVal;
            
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:58,代码来源:OXOChangeDiaryDS.cs


示例15: OXOProgrammeFileSave

        public bool OXOProgrammeFileSave(OXOProgrammeFile obj)
        {
            bool retVal = true;
            string procName = (obj.Id == 0 ? "dbo.OXO_Programme_File_New" : "dbo.OXO_Programme_File_Edit");

			using (IDbConnection conn = DbHelper.GetDBConnection())
            {
				try
				{

                    obj.Save(this.CurrentCDSID);
                    
                    var para = new DynamicParameters();

                     para.Add("@p_Programme_Id", obj.ProgrammeId, dbType: DbType.Int32);
                     para.Add("@p_File_Category", obj.FileCategory, dbType: DbType.String, size: 100);
                     para.Add("@p_File_Comment", obj.FileComment, dbType: DbType.String, size: 2000);                    
                     para.Add("@p_File_Name", obj.FileName, dbType: DbType.String, size: 100);
                     para.Add("@p_File_Ext", obj.FileExt, dbType: DbType.String, size: 4);
					 para.Add("@p_File_Type", obj.FileType, dbType: DbType.String, size: 20);
					 para.Add("@p_File_Size", obj.FileSize, dbType: DbType.Int32);
                     para.Add("@p_gateway", obj.Gateway, dbType: DbType.String, size: 100);
                     para.Add("@p_PACN", obj.PACN, dbType: DbType.String, size: 10);					
					 para.Add("@p_File_Content", obj.FileContent, dbType: DbType.Binary);
					 para.Add("@p_Created_By", obj.CreatedBy, dbType: DbType.String, size: 8);
					 para.Add("@p_Created_On", obj.CreatedOn, dbType: DbType.DateTime);
					 para.Add("@p_Updated_By", obj.UpdatedBy, dbType: DbType.String, size: 8);
					 para.Add("@p_Last_Updated", obj.LastUpdated, dbType: DbType.DateTime);
					    

					if (obj.Id == 0)
					{
						para.Add("@p_Id", dbType: DbType.Int32, direction: ParameterDirection.Output);
					}
					else
					{
						para.Add("@p_Id", obj.Id, dbType: DbType.Int32);
					}

					conn.Execute(procName, para, commandType: CommandType.StoredProcedure);

					if (obj.Id == 0)
					{
						obj.Id = para.Get<int>("@p_Id");
					}

				}
				catch (Exception ex)
				{
                    Log.Error(ex);
                    throw;
				}
			}

            return retVal;
            
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:57,代码来源:OXOProgrammeFileDS.cs


示例16: FeatureGetMany

        public IEnumerable<Feature> FeatureGetMany(string mode = "generic", int paramId = 0, int docid = 0, string lookup = null, string group = null, int excludeObjId = 0, int excludeDocId = 0, bool useOACode = false)
        {
            IEnumerable<Feature> retVal = new List<Feature>();
            using (IDbConnection conn = DbHelper.GetDBConnection())
            {
                try
                {
                    var para = new DynamicParameters();
                    string sp_name = "";
                    switch (mode)
                    {
                        case "generic":
                            sp_name = "dbo.OXO_GenericFeature_GetMany";
                            break;
                        case "vehicle":
                            sp_name = "dbo.OXO_VehicleFeature_GetMany";
                            para.Add("@p_vehicle_id", paramId, DbType.Int32);
                            para.Add("@p_group", group, DbType.String, size: 500);
                            para.Add("@p_exclude_progid", excludeObjId, DbType.Int32);
                            para.Add("@p_exclude_docid", excludeDocId, DbType.Int32);
                            para.Add("@p_use_OA_code", useOACode, DbType.Boolean);
                            break;
                        case "programme":
                            sp_name = "dbo.OXO_ProgrammeFeature_GetMany";
                            para.Add("@p_prog_id", paramId, DbType.Int32);
                            para.Add("@p_doc_id", docid, DbType.Int32);
                            para.Add("@p_group", group, DbType.String, size: 500);
                            para.Add("@p_exclude_packid", excludeObjId, DbType.Int32);
                            break;
                        case "gsf":
                            sp_name = "dbo.OXO_Vehicle_GSF_GetMany";
                            para.Add("@p_vehicle_id", paramId, DbType.Int32);
                            para.Add("@p_group", group, DbType.String, size: 500);
                            para.Add("@p_exclude_progid", excludeObjId, DbType.Int32);
                            para.Add("@p_exclude_docid", excludeDocId, DbType.Int32);
                            para.Add("@p_use_OA_code", useOACode, DbType.Boolean);
                            break;
                        case "fdp":
                            sp_name = "dbo.OXO_Feature_GetMany";
                            para.Add("@p_vehicle_id", paramId, DbType.Int32);
                            lookup = "@@@";
                            break;
                    }

                    para.Add("@p_lookup", lookup, DbType.String, size: 50);
                    retVal = conn.Query<Feature>(sp_name, para, commandType: CommandType.StoredProcedure);
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                    throw;
                }
            }

            return retVal;
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:56,代码来源:FeatureDataStore.cs


示例17: ForecastComparisonViewSave

        public bool ForecastComparisonViewSave(ForecastComparisonView obj)
        {
            bool retVal = true;
            string procName = (obj.Id == 0 ? "dbo.ForecastComparisonView_New" : "dbo.ForecastComparisonView_Edit");

			using (IDbConnection conn = DbHelper.GetDBConnection())
            {
				try
				{
					var para = new DynamicParameters();

					 para.Add("@p_ForecastId", obj.ForecastId, dbType: DbType.Int32);
					 para.Add("@p_CreatedOn", obj.CreatedOn, dbType: DbType.DateTime);
					 para.Add("@p_CreatedBy", obj.CreatedBy, dbType: DbType.String, size: 16);
					 para.Add("@p_VehicleId", obj.VehicleId, dbType: DbType.Int32);
					 para.Add("@p_ProgrammeId", obj.ProgrammeId, dbType: DbType.Int32);
					 para.Add("@p_GatewayId", obj.GatewayId, dbType: DbType.Int32);
					 para.Add("@p_Make", obj.Make, dbType: DbType.String, size: 500);
					 para.Add("@p_Code", obj.Code, dbType: DbType.String, size: 500);
					 para.Add("@p_Description", obj.Description, dbType: DbType.String, size: 1003);
					 para.Add("@p_ModelYear", obj.ModelYear, dbType: DbType.String, size: 50);
					 para.Add("@p_Gateway", obj.Gateway, dbType: DbType.String, size: 50);
					 para.Add("@p_SortOrder", obj.SortOrder, dbType: DbType.Int32);
					    

					if (obj.Id == 0)
					{
						para.Add("@p_Id", dbType: DbType.Int32, direction: ParameterDirection.Output);
					}
					else
					{
						para.Add("@p_Id", obj.Id, dbType: DbType.Int32);
					}

					conn.Execute(procName, para, commandType: CommandType.StoredProcedure);

					if (obj.Id == 0)
					{
						obj.Id = para.Get<int>("@p_Id");
					}

				}
				catch (Exception ex)
				{
                    Log.Error(ex);
                    throw;
				}
			}

            return retVal;
            
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:52,代码来源:ForecastComparisonViewDataStore.cs


示例18: RuleResultSave

        public bool RuleResultSave(OXORuleResult obj)
        {
            bool retVal = true;
            string procName = (obj.Id == 0 ? "dbo.OXO_Programme_Rule_Result_New" : "dbo.OXO_Programme_Rule_Result_Edit");

			using (IDbConnection conn = DbHelper.GetDBConnection())
            {
				try
				{
                    obj.Save(this.CurrentCDSID);

					var para = new DynamicParameters();

					 para.Add("@p_OXODocId", obj.OXODocId, dbType: DbType.Int32);
					 para.Add("@p_ProgrammeId", obj.ProgrammeId, dbType: DbType.Int32);
                     para.Add("@p_Level", obj.ObjectLevel, dbType: DbType.String, size: 3);
                     para.Add("@p_ObjectId", obj.ObjectId, dbType: DbType.Int32);
					 para.Add("@p_RuleId", obj.RuleId, dbType: DbType.Int32);
					 para.Add("@p_ModelId", obj.ModelId, dbType: DbType.Int32);
					 para.Add("@p_RuleResult", obj.RuleResult, dbType: DbType.Boolean);
					 para.Add("@p_CreatedBy", obj.CreatedBy, dbType: DbType.String, size: 8);
					 para.Add("@p_CreatedOn", obj.CreatedOn, dbType: DbType.DateTime);
					    

					if (obj.Id == 0)
					{
						para.Add("@p_Id", dbType: DbType.Int32, direction: ParameterDirection.Output);
					}
					else
					{
						para.Add("@p_Id", obj.Id, dbType: DbType.Int32);
					}

					conn.Execute(procName, para, commandType: CommandType.StoredProcedure);

					if (obj.Id == 0)
					{
						obj.Id = para.Get<int>("@p_Id");
					}

				}
				catch (Exception ex)
				{
                    Log.Error(ex);
                    throw;
				}
			}

            return retVal;
            
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:51,代码来源:OXORuleResultDS.cs


示例19: FeatureRequestSave

        public bool FeatureRequestSave(FeatureRequest obj)
        {
            bool retVal = true;
            string procName = (obj.Id == 0 ? "dbo.OXO_FeatureRequest_New" : "dbo.OXO_FeatureRequest_Edit");

			using (IDbConnection conn = DbHelper.GetDBConnection())
            {
				try
				{
					var para = new DynamicParameters();

					 para.Add("@p_Programme_Id", obj.Programme_Id, dbType: DbType.Int32);
					 para.Add("@p_Description", obj.Description, dbType: DbType.String, size: 500);
					 para.Add("@p_Marketing_Description", obj.Marketing_Description, dbType: DbType.String, size: 500);
					 para.Add("@p_Notes", obj.Notes, dbType: DbType.String, size: 2000);
					 para.Add("@p_Feature_Group", obj.Feature_Group, dbType: DbType.String, size: 500);
					 para.Add("@p_Decision", obj.Decision, dbType: DbType.String, size: 500);
					 para.Add("@p_Created_By", obj.Created_By, dbType: DbType.String, size: 8);
					 para.Add("@p_Created_On", obj.Created_On, dbType: DbType.DateTime);
					 para.Add("@p_Updated_By", obj.Updated_By, dbType: DbType.String, size: 8);
					 para.Add("@p_Last_Updated", obj.Last_Updated, dbType: DbType.DateTime);
					    

					if (obj.Id == 0)
					{
						para.Add("@p_Id", dbType: DbType.Int32, direction: ParameterDirection.Output);
					}
					else
					{
						para.Add("@p_Id", obj.Id, dbType: DbType.Int32);
					}

					conn.Execute(procName, para, commandType: CommandType.StoredProcedure);

					if (obj.Id == 0)
					{
						obj.Id = para.Get<int>("@p_Id");
					}

				}
				catch (Exception ex)
				{
                    Log.Error(ex);
                    throw;
				}
			}

            return retVal;
            
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:50,代码来源:OXOFeatureRequestDS.cs


示例20: PermissionSave

        public bool PermissionSave(Permission obj)
        {
            bool retVal = true;
            string procName = (obj.Id == 0 ? "dbo.OXO_Permission_New" : "dbo.OXO_Permission_Edit");

			using (IDbConnection conn = DbHelper.GetDBConnection())
            {
				try
				{
					var para = new DynamicParameters();

					 para.Add("@p_CDSID", obj.CDSID, dbType: DbType.String, size: 50);
					 para.Add("@p_Object_Type", obj.ObjectType, dbType: DbType.String, size: 500);
					 para.Add("@p_Object_Id", obj.ObjectId, dbType: DbType.Int32);
					 para.Add("@p_Object_Val", obj.ObjectVal, dbType: DbType.String, size: 500);
					 para.Add("@p_Operation", obj.Operation, dbType: DbType.String, size: 500);
					 para.Add("@p_Created_By", obj.CreatedBy, dbType: DbType.String, size: 50);
					 para.Add("@p_Created_On", obj.CreatedOn, dbType: DbType.DateTime);
					 para.Add("@p_Updated_By", obj.UpdatedBy, dbType: DbType.String, size: 50);
					 para.Add("@p_Last_Updated", obj.LastUpdated, dbType: DbType.DateTime);
					    

					if (obj.Id == 0)
					{
						para.Add("@p_Id", dbType: DbType.Int32, direction: ParameterDirection.Output);
					}
					else
					{
						para.Add("@p_Id", obj.Id, dbType: DbType.Int32);
					}

					conn.Execute(procName, para, commandType: CommandType.StoredProcedure);

					if (obj.Id == 0)
					{
						obj.Id = para.Get<int>("@p_Id");
					}

				}
				catch (Exception ex)
				{
                    Log.Error(ex);
                    throw;
				}
			}

            return retVal;
            
        }
开发者ID:digimonsta,项目名称:FeatureDemandPlanning,代码行数:49,代码来源:OXOPermissionDS.cs



注:本文中的FeatureDemandPlanning.Model.Dapper.DynamicParameters类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DX11.DX11RenderContext类代码示例发布时间:2022-05-24
下一篇:
C# Feature.FdoConnection类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap