/// <summary> /// 产品列表查询方法 /// </summary> /// cais 16.03.28 /// <param name="pagination">分页</param> /// <param name="filter">参数</param> /// <returns></returns> public DataTable Find(Models.Pagination pagination, NameValueCollection filter) { SqlCommand comm = DHelper.GetSqlCommand(@" SELECT Produce.ProduceId,Code,Name,(InterestRate * 12) as InterestRate,(Rate * 12) as Rate,MinFinancingRatio,MaxFinancingRatio,FinalRatio,FinancingPeriods,RepaymentInterval,CustomerBailRatio,CustomerPoundage,AddDate,Remarks,AdditionalGPSCost,AdditionalOtherCost, dbo.Dic(3,RepaymentMethod) AS paymothed FROM PROD_ProduceInfo AS Produce LEFT JOIN (SELECT TOP (@End) ROW_NUMBER() OVER (ORDER BY ProduceId DESC) AS rownum,ProduceId FROM PROD_ProduceInfo WHERE @Code_Name IS NULL OR (Code like '%'+@Code_Name+'%' OR Name like '%'+@Code_Name+'%')) AS TMP ON Produce.ProduceId=TMP.ProduceId WHERE TMP.rownum>@Begin "); DHelper.AddParameter(comm, "@Begin", SqlDbType.Int, pagination.Begin); DHelper.AddParameter(comm, "@End", SqlDbType.Int, pagination.End); DHelper.AddParameter(comm, "@Code_Name", SqlDbType.VarChar, filter["ProductCodeOrName"]); SqlCommand commPage = DHelper.GetSqlCommand(@"SELECT Count(*) FROM PROD_ProduceInfo WHERE @Code_Name IS NULL OR (Code like '%'+@Code_Name+'%' OR Name like '%'+@Code_Name+'%')"); DHelper.AddParameter(commPage, "@Code_Name", SqlDbType.NVarChar, filter["ProductCodeOrName"]); pagination.Total = Convert.ToInt32(DHelper.ExecuteScalar(commPage)); DataTable dt = DHelper.ExecuteDataTable(comm); return(dt); }
/// <summary> /// 获取授信信息列表 /// </summary> /// yaoy 16.03.30 /// <param name="data"></param> /// <param name="page"></param> /// <returns></returns> public DataTable List(Pagination page, NameValueCollection data) { SqlCommand comm = DHelper.GetSqlCommand(@" SELECT temp.rownum,ui.*,cci.Name,cci.CreditId,dbo.Dic(2, ui.Status) AS StatusDesc,rol.Name AS RoleName FROM USER_UserInfo AS ui RIGHT JOIN ( SELECT TOP(@End) ROW_NUMBER() OVER(ORDER BY UserId DESC) AS rownum, UserId, CreditId FROM CRET_Account AS ca WHERE (@CreditId IS NULL OR ca.CreditId = @CreditId) ) AS temp ON temp.UserId = ui.UI_ID LEFT JOIN CRET_CreditInfo AS cci ON cci.CreditId = temp.CreditId LEFT JOIN USER_Relation AS ur ON ur.UserId = ui.UI_ID LEFT JOIN USER_Role AS rol ON rol.UR_ID = ur.RoleId WHERE temp.rownum> @Begin ORDER BY cci.CreditId DESC "); DHelper.AddInParameter(comm, "@CreditId", SqlDbType.Int, data["CreditId"]); DHelper.AddInParameter(comm, "@Begin", SqlDbType.Int, page.Begin); DHelper.AddInParameter(comm, "@End", SqlDbType.Int, page.End); SqlCommand commPage = DHelper.GetSqlCommand(@" SELECT COUNT(UserId) FROM CRET_Account WHERE (@CreditId IS NULL OR CreditId = @CreditId) "); DHelper.AddInParameter(commPage, "@CreditId", SqlDbType.Int, data["CreditId"]); page.Total = Convert.ToInt32(DHelper.ExecuteScalar(commPage)); return(DHelper.ExecuteDataTable(comm)); }
/// <summary> /// 分页查询 /// </summary> /// qiy 16.03.29 /// <param name="page">分页信息</param> /// <param name="filter">筛选条件</param> /// <returns></returns> public DataTable List(Models.Pagination page, NameValueCollection filter) { SqlCommand comm = DHelper.GetSqlCommand(@" SELECT tmp.rownum, ci.CreditId, ci.Name, ci.Type, dbo.Dic(4, ci.Type) AS TypeDesc, ci.LineOfCredit, ci.AddDate, ci.Remarks, cpi.Bail, cpi.ControllerName, cpi.ControllerTelephone FROM CRET_CreditInfo AS ci RIGHT JOIN ( SELECT TOP (@End) ROW_NUMBER() OVER (ORDER BY CreditId DESC) AS rownum, CreditId FROM CRET_CreditInfo ) AS tmp ON ci.CreditId = tmp.CreditId LEFT JOIN CRET_PartnerInfo AS cpi ON ci.CreditId = cpi.CreditId WHERE tmp.rownum > @Begin " ); DHelper.AddParameter(comm, "@Begin", SqlDbType.Int, page.Begin); DHelper.AddParameter(comm, "@End", SqlDbType.Int, page.End); SqlCommand commPage = DHelper.GetSqlCommand(@" SELECT COUNT(*) FROM CRET_CreditInfo " ); page.Total = Convert.ToInt32(DHelper.ExecuteScalar(commPage)); return(DHelper.ExecuteDataTable(comm)); }
/// <summary> /// 列表 /// </summary> /// yangj 16.07.01 /// <param name="dictionaryTypeId">字典类型ID</param> /// <returns></returns> public DataTable List(Models.Pagination page, NameValueCollection filter) { SqlCommand comm = DHelper.GetSqlCommand(@" SELECT tmp.rownum, bdt.BDT_ID,bdt.Name, temp.Name AS ParentName FROM BANK_DictionaryType AS bdt RIGHT JOIN (SELECT TOP (@End) ROW_NUMBER() OVER (ORDER BY BDT_ID DESC) AS rownum,BDT_ID FROM BANK_DictionaryType )AS tmp ON bdt.BDT_ID = tmp.BDT_ID LEFT JOIN BANK_DictionaryType AS temp ON bdt.ParentType = temp.BDT_ID WHERE tmp.rownum > @Begin " ); DHelper.AddParameter(comm, "@Begin", SqlDbType.Int, page.Begin); DHelper.AddParameter(comm, "@End", SqlDbType.Int, page.End); SqlCommand commPage = DHelper.GetSqlCommand( @"SELECT COUNT(*) FROM BANK_DictionaryType " ); page.Total = Convert.ToInt32(DHelper.ExecuteScalar(commPage)); DataTable dt = DHelper.ExecuteDataTable(comm); return(dt); }
/// <summary> /// 插入指定的借贷信息 /// </summary> /// zouql 16.08.30 /// <param name="borrowInfo">借贷信息</param> /// <returns>操作结果</returns> public int Insert(BorrowInfo borrowInfo) { SqlCommand comm = new SqlCommand(@" INSERT INTO FANC_Borrow ( FinanceId, ApprovalPrincipal, InterestRate, FinancingPeriods, RepaymentInterval, RepaymentMethod, RepaymentDate, FinanceAddDate, [State], OncePayMonths, FinalRatio, CustomerBailRatio, FinalCost, ExtralCost ) VALUES ( @FinanceId, @ApprovalPrincipal, @InterestRate, @FinancingPeriods, @RepaymentInterval, @RepaymentMethod, @RepaymentDate, @FinanceAddDate, @State, @OncePayMonths, @FinalRatio, @CustomerBailRatio, @FinalCost, @ExtralCost ) SELECT SCOPE_IDENTITY() "); DHelper.AddParameter(comm, "@financeId", SqlDbType.Int, borrowInfo.FinanceId); DHelper.AddParameter(comm, "@ApprovalPrincipal", SqlDbType.Decimal, borrowInfo.ApprovalPrincipal); DHelper.AddParameter(comm, "@InterestRate", SqlDbType.Float, borrowInfo.InterestRate); DHelper.AddParameter(comm, "@FinancingPeriods", SqlDbType.Int, borrowInfo.FinancingPeriods); DHelper.AddParameter(comm, "@RepaymentInterval", SqlDbType.Int, borrowInfo.RepaymentInterval); DHelper.AddParameter(comm, "@RepaymentMethod", SqlDbType.NVarChar, borrowInfo.RepaymentMethod); DHelper.AddParameter(comm, "@RepaymentDate", SqlDbType.Int, borrowInfo.RepaymentDate); DHelper.AddParameter(comm, "@FinanceAddDate", SqlDbType.DateTime, borrowInfo.FinanceAddDate); DHelper.AddParameter(comm, "@State", SqlDbType.NVarChar, borrowInfo.State); DHelper.AddParameter(comm, "@OncePayMonths", SqlDbType.Int, borrowInfo.OncePayMonths); DHelper.AddParameter(comm, "@FinalRatio", SqlDbType.Float, borrowInfo.FinalRatio); DHelper.AddParameter(comm, "@CustomerBailRatio", SqlDbType.Float, borrowInfo.CustomerBailRatio); DHelper.AddParameter(comm, "@FinalCost", SqlDbType.Decimal, borrowInfo.FinalCost); DHelper.AddParameter(comm, "@ExtralCost", SqlDbType.Decimal, borrowInfo.ExtralCost); return(Convert.ToInt32(DHelper.ExecuteScalar(comm))); }
/// <summary> /// 查找用户名 /// </summary> /// qiy 15.11.25 /// <param name="username">用户名</param> /// <returns></returns> public int FindByUsername(string username) { SqlCommand comm = DHelper.GetSqlCommand( "SELECT COUNT(*) FROM USER_UserInfo WHERE Username = @Username" ); DHelper.AddParameter(comm, "@Username", SqlDbType.NVarChar, username); return(Convert.ToInt32(DHelper.ExecuteScalar(comm))); }
/// <summary> /// 查找子菜单的数量 /// </summary> /// qiy 16.03.09 /// <param name="menuId">菜单标识</param> /// <returns></returns> public int CountChildren(int menuId) { SqlCommand comm = DHelper.GetSqlCommand( "SELECT COUNT(*) FROM SYS_Menu WHERE ParentId = @ParentId" ); DHelper.AddParameter(comm, "@ParentId", SqlDbType.Int, menuId); return(Convert.ToInt32(DHelper.ExecuteScalar(comm))); }
/// <summary> /// 查询XML关系数据 /// </summary> /// <param name="instanceId"></param> /// <returns></returns> public string FindXMLData(int instanceId) { SqlCommand comm = DHelper.GetSqlCommand( "SELECT KeyXML FROM FLOW_Instance WHERE InstanceId = @InstanceId" ); DHelper.AddParameter(comm, "@InstanceId", SqlDbType.Int, instanceId); return(Convert.ToString(DHelper.ExecuteScalar(comm))); }
/// <summary> /// 获取同种类型文件数量 /// </summary> /// yaoy 16.07.12 /// <param name="partnerName"></param> /// <returns></returns> public int FindFileCount(string partnerName) { SqlCommand comm = DHelper.GetSqlCommand(@" SELECT COUNT(*) FROM BANK_ReportFiles WHERE ReportTextName LIKE @PartnerName +'%' "); DHelper.AddInParameter(comm, "@PartnerName", SqlDbType.NVarChar, partnerName); return(Convert.ToInt32(DHelper.ExecuteScalar(comm))); }
/// <summary> /// 获取报文ID /// </summary> /// yaoy 16.06.31 /// <param name="reportFileId"></param> /// <param name="messageTypeId"></param> /// <returns></returns> public int FindReportId(int reportFileId, int messageTypeId) { SqlCommand comm = DHelper.GetSqlCommand(@" SELECT ReportID FROM BANK_Reports WHERE MessageTypeID = @MessageTypeID AND ReportFileID = @ReportFileID "); DHelper.AddInParameter(comm, "@ReportFileID", SqlDbType.Int, reportFileId); DHelper.AddInParameter(comm, "@MessageTypeID", SqlDbType.Int, messageTypeId); return(Convert.ToInt32(DHelper.ExecuteScalar(comm))); }
/// <summary> /// 插入[未使用] /// </summary> /// qiy 16.03.08 /// <param name="value"></param> /// <returns></returns> public void Insert(FlowInfo value) { SqlCommand comm = DHelper.GetSqlCommand( "INSERT INTO FLOW_WorkFlow (Name, Description) " + "VALUES (@Name, @Description) SELECT SCOPE_IDENTITY() " ); DHelper.AddParameter(comm, "@Name", SqlDbType.NVarChar, value.Name); DHelper.AddParameter(comm, "@Description", SqlDbType.NVarChar, value.Description); value.FlowId = Convert.ToInt32(DHelper.ExecuteScalar(comm)); }
/// <summary> /// 插入 /// </summary> /// qiy 16.03.31 /// qiy 16.05.31 /// yangj 16.07.26 新增融资预估金额字段 /// zouql 16.07.29 新增保证金、先付月供金额、一次性付息金额、实际用款金额字段 /// zouql 16.08.02 增加建议融资金额 /// zouql 16.08.04 新增融资实际金额字段 /// <param name="value">值</param> public void Insert(FinanceInfo value) { SqlCommand comm = DHelper.GetSqlCommand(@" INSERT INTO FANC_FinanceInfo ( ProduceId, Type, IntentionPrincipal, ApprovalValue, CreateBy, CreateOf, AddDate, Remarks, OncePayMonths, MarginMoney, PaymonthlyMoney, OnepayInterestMoney, ActualcashMoney ) VALUES ( @ProduceId, @Type, @IntentionPrincipal, @ApprovalValue, @CreateBy, @CreateOf, DEFAULT, @Remarks, @OncePayMonths, @MarginMoney, @PaymonthlyMoney, @OnepayInterestMoney, @ActualcashMoney ) SELECT SCOPE_IDENTITY() " ); DHelper.AddParameter(comm, "@ProduceId", SqlDbType.Int, value.ProduceId); DHelper.AddParameter(comm, "@Type", SqlDbType.TinyInt, value.Type); DHelper.AddParameter(comm, "@IntentionPrincipal", SqlDbType.Decimal, value.IntentionPrincipal); DHelper.AddParameter(comm, "@ApprovalValue", SqlDbType.Decimal, value.ApprovalValue); DHelper.AddParameter(comm, "@CreateBy", SqlDbType.Int, value.CreateBy); DHelper.AddParameter(comm, "@CreateOf", SqlDbType.Int, value.CreateOf); DHelper.AddParameter(comm, "@Remarks", SqlDbType.NVarChar, value.Remarks); DHelper.AddParameter(comm, "@OncePayMonths", SqlDbType.Int, value.OncePayMonths); // 保证金、先付月供金额、一次性付息金额、实际用款金额 DHelper.AddParameter(comm, "@MarginMoney", SqlDbType.Decimal, value.MarginMoney); DHelper.AddParameter(comm, "@PaymonthlyMoney", SqlDbType.Decimal, value.PaymonthlyMoney); DHelper.AddParameter(comm, "@OnepayInterestMoney", SqlDbType.Decimal, value.OnepayInterestMoney); DHelper.AddParameter(comm, "@ActualcashMoney", SqlDbType.Decimal, value.ActualcashMoney); value.FinanceId = Convert.ToInt32(DHelper.ExecuteScalar(comm)); }
/// <summary> /// 增加一条报文数据 /// </summary> /// cais 16.05.25 /// <param name="values"></param> /// <returns></returns> public void Insert(ReportInfo values) { SqlCommand comm = DHelper.GetSqlCommand(@" INSERT INTO BANK_Reports (MessageTypeID,ReportFileID) VALUES (@MessageTypeID,@ReportFileID) SELECT SCOPE_IDENTITY()" ); DHelper.AddParameter(comm, "@MessageTypeID", SqlDbType.Int, values.MessageTypeID); DHelper.AddParameter(comm, "@ReportFileID", SqlDbType.Int, values.ReportFileID); values.ReportID = Convert.ToInt32(DHelper.ExecuteScalar(comm)); }
/// <summary> /// 分页 /// </summary> /// yaoy 16.05.25 /// yangj 16.09.21 新增时间、文件名筛选 /// <returns></returns> public DataTable FindReportFilesData(Pagination page, NameValueCollection data) { SqlCommand comm = DHelper.GetSqlCommand(@" SELECT rownum,brf.FileID, brf.CreateTime,brf.SendTime,brf.ReportTextName, CASE brf.ReportState WHEN 1 THEN '已发送' WHEN 2 THEN '已编辑' WHEN 3 THEN '已创建' WHEN 4 THEN '接受' END AS ReportState, CASE brf.ServiceObj WHEN 1 THEN '企业' WHEN 2 THEN '个人' END AS ServiceObj, brf.Remarks,brf.Operator,brf.FilesName, bmf.FileName FROM BANK_ReportFiles AS brf RIGHT JOIN( SELECT TOP(@End) ROW_NUMBER() OVER(ORDER BY FileID DESC) AS rownum,FileID FROM BANK_ReportFiles WHERE (@ServiceObj IS NULL OR ServiceObj = @ServiceObj) AND (@MessageFileID IS NULL OR MessageFileID = @MessageFileID) AND (@FilesName IS NULL OR FilesName LIKE @FilesName +'%') AND (@BeginTime IS NULL OR DATEDIFF(day, CreateTime, @BeginTime) <= 0) AND (@EndTime IS NULL OR DATEDIFF(day, CreateTime, @EndTime) >= 0) ) AS temp ON temp.FileID = brf.FileID LEFT JOIN BANK_MessageFile AS bmf ON bmf.BMF_ID = brf.MessageFileID WHERE rownum > @Begin AND (@ServiceObj IS NULL OR ServiceObj = @ServiceObj) AND (@MessageFileID IS NULL OR brf.MessageFileID = @MessageFileID) AND (@FilesName IS NULL OR FilesName LIKE @FilesName +'%') AND (@BeginTime IS NULL OR DATEDIFF(day, CreateTime, @BeginTime) <= 0) AND (@EndTime IS NULL OR DATEDIFF(day, CreateTime, @EndTime) >= 0) "); DHelper.AddParameter(comm, "@Begin", SqlDbType.Int, page.Begin); DHelper.AddParameter(comm, "@End", SqlDbType.Int, page.End); DHelper.AddParameter(comm, "@MessageFileID", SqlDbType.Int, data["MessageFileID"]); DHelper.AddParameter(comm, "@ServiceObj", SqlDbType.Int, data["ServiceObj"]); DHelper.AddParameter(comm, "@FilesName", SqlDbType.NVarChar, data["FilesName"]); DHelper.AddInParameter(comm, "@BeginTime", SqlDbType.DateTime, data["BeginTime"]); DHelper.AddInParameter(comm, "@EndTime", SqlDbType.DateTime, data["EndTime"]); SqlCommand commPage = DHelper.GetSqlCommand(@" SELECT COUNT(*) FROM BANK_ReportFiles WHERE (@ServiceObj IS NULL OR ServiceObj = @ServiceObj) AND (@MessageFileID IS NULL OR MessageFileID = @MessageFileID) AND (@FilesName IS NULL OR FilesName LIKE @FilesName +'%') AND (@BeginTime IS NULL OR DATEDIFF(day, CreateTime, @BeginTime) <= 0) AND (@EndTime IS NULL OR DATEDIFF(day, CreateTime, @EndTime) >= 0) "); DHelper.AddParameter(commPage, "@MessageFileID", SqlDbType.Int, data["MessageFileID"]); DHelper.AddParameter(commPage, "@ServiceObj", SqlDbType.Int, data["ServiceObj"]); DHelper.AddParameter(commPage, "@FilesName", SqlDbType.NVarChar, data["FilesName"]); DHelper.AddInParameter(commPage, "@BeginTime", SqlDbType.DateTime, data["BeginTime"]); DHelper.AddInParameter(commPage, "@EndTime", SqlDbType.DateTime, data["EndTime"]); page.Total = Convert.ToInt32(DHelper.ExecuteScalar(commPage)); return(DHelper.ExecuteDataTable(comm)); }
/// <summary> /// 插入 /// </summary> /// qiy 16.03.30 /// <param name="value">值</param> public void Insert(ReferenceInfo value) { SqlCommand comm = DHelper.GetSqlCommand(@" INSERT INTO SYS_Reference (ReferencedId, ReferencedModule, ReferencedSid) VALUES (@ReferencedId, @ReferencedModule, @ReferencedSid) SELECT SCOPE_IDENTITY() " ); DHelper.AddParameter(comm, "@ReferencedId", SqlDbType.Int, value.ReferencedId); DHelper.AddParameter(comm, "@ReferencedModule", SqlDbType.Int, value.ReferencedModule); DHelper.AddParameter(comm, "@ReferencedSid", SqlDbType.Int, value.ReferencedSid); value.ReferenceId = Convert.ToInt32(DHelper.ExecuteScalar(comm)); }
/// <summary> /// 查找AddDate /// </summary> /// zouql 16.08.31 /// <param name="id">标识</param> /// <returns>AddDate</returns> public DateTime FindAddDate(int id) { SqlCommand comm = DHelper.GetSqlCommand(@" SELECT AddDate FROM FANC_FinanceInfo WHERE FinanceId = @ID" ); DHelper.AddParameter(comm, "@ID", SqlDbType.Int, id); return(Convert.ToDateTime(DHelper.ExecuteScalar(comm))); }
/// <summary> /// 插入 /// </summary> /// qiy 15.12.04 /// <param name="value"></param> /// <returns></returns> public void Insert(DictionaryTypeInfo value) { SqlCommand comm = DHelper.GetSqlCommand( "INSERT INTO SYS_DicType (Field, Name, IsCommon, Seed)" + "VALUES (@Field, @Name, @IsCommon, @Seed) SELECT SCOPE_IDENTITY()" ); DHelper.AddInParameter(comm, "@Field", SqlDbType.NVarChar, value.Field); DHelper.AddInParameter(comm, "@Name", SqlDbType.NVarChar, value.Name); DHelper.AddInParameter(comm, "@IsCommon", SqlDbType.Bit, value.IsCommon); DHelper.AddInParameter(comm, "@Seed", SqlDbType.Int, value.Seed); value.TypeId = Convert.ToInt32(DHelper.ExecuteScalar(comm)); }
/// <summary> /// 插入 /// </summary> /// yand 15.11.16 /// qiy 16.03.08 /// <param name="value"></param> /// <returns></returns> public void Insert(MenuInfo value) { SqlCommand comm = DHelper.GetSqlCommand( "INSERT INTO SYS_Menu (ParentId, Name, Link, Sort) " + "VALUES (@ParentId, @Name, @Link, @Sort) SELECT SCOPE_IDENTITY() " ); DHelper.AddParameter(comm, "@ParentId", SqlDbType.Int, value.ParentId); DHelper.AddParameter(comm, "@Name", SqlDbType.NVarChar, value.Name); DHelper.AddParameter(comm, "@Link", SqlDbType.NVarChar, value.Link); DHelper.AddParameter(comm, "@Sort", SqlDbType.TinyInt, value.Sort); value.MenuId = Convert.ToInt32(DHelper.ExecuteScalar(comm)); }
/// <summary> /// 插入 /// </summary> /// qiy 16.03.29 /// <param name="value">值</param> public void Insert(CreditInfo value) { SqlCommand comm = DHelper.GetSqlCommand(@" INSERT INTO CRET_CreditInfo (Name, Type, LineOfCredit, AddDate, Remarks) VALUES (@Name, @Type, @LineOfCredit, DEFAULT, @Remarks) SELECT SCOPE_IDENTITY() " ); DHelper.AddParameter(comm, "@Name", SqlDbType.NVarChar, value.Name); DHelper.AddParameter(comm, "@Type", SqlDbType.TinyInt, value.Type); DHelper.AddParameter(comm, "@LineOfCredit", SqlDbType.Decimal, value.LineOfCredit); DHelper.AddParameter(comm, "@Remarks", SqlDbType.NVarChar, value.Remarks); value.CreditId = Convert.ToInt32(DHelper.ExecuteScalar(comm)); }
/// <summary> /// 增加一条信息记录 /// </summary> /// yangj 16.07.01 /// <param name="value">字典类型实体</param> /// <returns></returns> public void Insert(DictionaryTypeInfo value) { SqlCommand comm = DHelper.GetSqlCommand(@" INSERT INTO BANK_DictionaryType (Name,ParentType) VALUES (@Name,@ParentType) SELECT SCOPE_IDENTITY()" ); DHelper.AddParameter(comm, "@DictionaryTypeId", SqlDbType.Int, value.DictionaryTypeId); DHelper.AddParameter(comm, "@Name", SqlDbType.NVarChar, value.Name); DHelper.AddParameter(comm, "@ParentType", SqlDbType.Int, value.ParentType); value.DictionaryTypeId = Convert.ToInt32(DHelper.ExecuteScalar(comm)); }
/// <summary> /// 插入[未使用] /// </summary> /// qiy 16.03.08 /// <param name="value"></param> /// <returns></returns> public void Insert(NodeInfo value) { SqlCommand comm = DHelper.GetSqlCommand(@" INSERT INTO FLOW_Node (FlowId, RoleId, Name, Description) VALUES (@FlowId, @RoleId, @Name, @Description) SELECT SCOPE_IDENTITY() "); DHelper.AddParameter(comm, "@FlowId", SqlDbType.Int, value.FlowId); DHelper.AddParameter(comm, "@RoleId", SqlDbType.Int, value.RoleId); DHelper.AddParameter(comm, "@Name", SqlDbType.NVarChar, value.Name); DHelper.AddParameter(comm, "@Description", SqlDbType.NVarChar, value.Description); value.NodeId = Convert.ToInt32(DHelper.ExecuteScalar(comm)); }
/// <summary> /// 增加一条信息记录 /// </summary> /// cais 16.05.25 /// <param name="values">信息记录实体</param> /// <returns></returns> public void Insert(InformationRecordInfo values) { SqlCommand comm = DHelper.GetSqlCommand(@" INSERT INTO BANK_InformationRecord (Context,addtime,InfoTypeID,ReportID) VALUES (@Context,getdate(),@InfoTypeID,@ReportID) SELECT SCOPE_IDENTITY()" ); DHelper.AddParameter(comm, "@Context", SqlDbType.Text, values.Context); DHelper.AddParameter(comm, "@InfoTypeID", SqlDbType.NVarChar, values.InfoTypeID); DHelper.AddParameter(comm, "@ReportID", SqlDbType.Int, values.ReportID); values.RecordID = Convert.ToInt32(DHelper.ExecuteScalar(comm)); }
/// <summary> /// 插入 /// zouql 16.09.20 /// </summary> /// <param name="value">值</param> /// <returns>结果</returns> public int Insert(RuleTypeInfo value) { SqlCommand comm = DHelper.GetSqlCommand(@" INSERT INTO BANK_RuleType ( RuleTypeId,MoneyType,TimeType,IntegerType ) VALUES (@RuleTypeId,@MoneyType,@TimeType,@IntegerType ) SELECT SCOPE_IDENTITY() "); DHelper.AddInParameter(comm, "@RuleTypeId", SqlDbType.Int, value.RuleTypeId); DHelper.AddInParameter(comm, "@MoneyType", SqlDbType.Bit, value.MoneyType); DHelper.AddInParameter(comm, "@TimeType", SqlDbType.Bit, value.TimeType); DHelper.AddInParameter(comm, "@IntegerType", SqlDbType.Bit, value.IntegerType); return(Convert.ToInt32(DHelper.ExecuteScalar(comm))); }
/// <summary> /// 增加一条临时数据记录 /// </summary> /// yangj 16.09.21 /// <param name="values">临时数据记录实体</param> public void Insert(TempRecordInfo values) { SqlCommand comm = DHelper.GetSqlCommand(@" INSERT INTO Bank_TempRecord (Context,BIT_ID,ReportID,UI_ID) VALUES (@Context,@BIT_ID,@ReportID,@UI_ID) SELECT SCOPE_IDENTITY()" ); DHelper.AddParameter(comm, "@Context", SqlDbType.Text, values.Context); DHelper.AddParameter(comm, "@BIT_ID", SqlDbType.NVarChar, values.InfoTypeId); DHelper.AddParameter(comm, "@ReportID", SqlDbType.Int, values.ReportId); DHelper.AddParameter(comm, "@UI_ID", SqlDbType.Int, values.UserId); values.TempInfoId = Convert.ToInt32(DHelper.ExecuteScalar(comm)); }
/// <summary> /// 插入 /// </summary> /// qiy 16.03.08 /// <param name="value"></param> public void Insert(InstanceInfo value) { SqlCommand comm = DHelper.GetSqlCommand( "INSERT INTO FLOW_Instance " + "(FlowId, StartUser, StartTime, EndTime, InstanceData, Status) VALUES " + "(@FlowId, @StartUser, @StartTime, NULL, NULL, @Status) SELECT SCOPE_IDENTITY()" ); DHelper.AddParameter(comm, "@FlowId", SqlDbType.Int, value.FlowId); DHelper.AddParameter(comm, "@StartUser", SqlDbType.Int, value.StartUser); DHelper.AddParameter(comm, "@StartTime", SqlDbType.DateTime, value.StartTime); DHelper.AddParameter(comm, "@Status", SqlDbType.TinyInt, value.Status); value.InstanceId = Convert.ToInt32(DHelper.ExecuteScalar(comm)); }
/// <summary> /// 增加一条记录 /// </summary> /// yangj 16.07.05 /// <param name="value">数据元实体</param> /// <returns></returns> public void Insert(MetaInfo value) { SqlCommand comm = DHelper.GetSqlCommand(@" INSERT INTO BANK_Meta (MetaCode,Name,DataType,DatasLength,Type) VALUES (@MetaCode,@Name,@DataType,@DatasLength,@Type) SELECT SCOPE_IDENTITY()" ); DHelper.AddParameter(comm, "@MetaCode", SqlDbType.Int, value.MetaCode); DHelper.AddParameter(comm, "@Name", SqlDbType.NVarChar, value.Name); DHelper.AddParameter(comm, "@DataType", SqlDbType.NVarChar, value.DataType); DHelper.AddParameter(comm, "@DatasLength", SqlDbType.Int, value.DatasLength); DHelper.AddParameter(comm, "@Type", SqlDbType.Int, value.Type); DHelper.ExecuteScalar(comm); }
/// <summary> /// 插入日志 /// </summary> /// yand 15.11.13 /// <param name="value"></param> /// <returns></returns> public int Insert(OperationLog value) { SqlCommand comm = DHelper.GetSqlCommand( "INSERT INTO SYST_OperationLog (Type,RE_ID, RE_SID, RE_Module,Content,UI_ID,AddTime) " + "VALUES (@Type,@RE_ID, @RE_SID, @RE_Module,@Content,@UI_ID,default) SELECT SCOPE_IDENTITY() " ); AddParameter(comm, "@Type", SqlDbType.TinyInt, value.Type); AddParameter(comm, "@RE_ID", SqlDbType.Int, value.RE_ID); AddParameter(comm, "@RE_SID", SqlDbType.Int, value.RE_SID); AddParameter(comm, "@RE_Module", SqlDbType.TinyInt, value.RE_Module); AddParameter(comm, "@Content", SqlDbType.NVarChar, value.Content); AddParameter(comm, "@UI_ID", SqlDbType.Int, value.UI_ID); return((int)DHelper.ExecuteScalar(comm)); }
/// <summary> /// 插入[未使用] /// </summary> /// qiy 16.03.08 /// <param name="value"></param> /// <returns></returns> public void Insert(ActionInfo value) { SqlCommand comm = DHelper.GetSqlCommand(@" INSERT INTO FLOW_Action (NodeId, Transfer, Name, Type, AllocationType, Description, Method) VALUES (@NodeId, @Transfer, @Name, @Type, @AllocationType, @Description, @Method) SELECT SCOPE_IDENTITY() "); DHelper.AddParameter(comm, "@NodeId", SqlDbType.Int, value.NodeId); DHelper.AddParameter(comm, "@Transfer", SqlDbType.Int, value.Transfer); DHelper.AddParameter(comm, "@Name", SqlDbType.NVarChar, value.Name); DHelper.AddParameter(comm, "@Type", SqlDbType.TinyInt, value.AllocationType); DHelper.AddParameter(comm, "@Description", SqlDbType.NVarChar, value.Description); DHelper.AddParameter(comm, "@Method", SqlDbType.VarChar, value.Method); value.ActionId = Convert.ToInt32(DHelper.ExecuteScalar(comm)); }
/// <summary> /// 添加 /// </summary> /// zouql 16.07.27 /// <param name="bankInfo">账户</param> /// <returns>执行结果</returns> public void Insert(BankInfo bankInfo) { SqlCommand comm = DHelper.GetSqlCommand(@" INSERT INTO FANC_BankInfo(FinanceId,BankCard,CreditId,ApplicantId,BankName) VALUES (@FinanceId,@BankCard,@CreditId,@ApplicantId,@BankName) SELECT SCOPE_IDENTITY() "); DHelper.AddParameter(comm, "@FinanceId", SqlDbType.Int, bankInfo.FinanceId); DHelper.AddParameter(comm, "@CreditId", SqlDbType.Int, bankInfo.CreditId); DHelper.AddParameter(comm, "@ApplicantId", SqlDbType.Int, bankInfo.ApplicantId); DHelper.AddParameter(comm, "@BankCard", SqlDbType.NVarChar, bankInfo.BankCard); DHelper.AddParameter(comm, "@BankName", SqlDbType.NVarChar, bankInfo.BankName); bankInfo.BankId = Convert.ToInt32(DHelper.ExecuteScalar(comm)); }
/// <summary> /// 插入 /// </summary> /// qiy 16.04.05 /// <param name="value">值</param> public void Insert(FileInfo value) { SqlCommand comm = DHelper.GetSqlCommand(@" INSERT INTO SYS_FileList (ReferenceId, OldName, NewName, ExtName, FilePath, AddDate) VALUES (@ReferenceId, @OldName, @NewName, @ExtName, @FilePath, @AddDate) SELECT SCOPE_IDENTITY() " ); DHelper.AddParameter(comm, "@ReferenceId", SqlDbType.Int, value.ReferenceId); DHelper.AddParameter(comm, "@OldName", SqlDbType.NVarChar, value.OldName); DHelper.AddParameter(comm, "@NewName", SqlDbType.NVarChar, value.NewName); DHelper.AddParameter(comm, "@ExtName", SqlDbType.NVarChar, value.ExtName); DHelper.AddParameter(comm, "@FilePath", SqlDbType.NVarChar, value.FilePath); DHelper.AddParameter(comm, "@AddDate", SqlDbType.DateTime, value.AddDate); value.FileId = Convert.ToInt32(DHelper.ExecuteScalar(comm)); }