public void InsertUserType(FactoryArgs args, out t_BigID WeightDeviceUserTypeID, t_ID WeightDeviceType, t_String MachineName, t_String SerialName) { WeightDeviceUserTypeID = new t_BigID(); LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("WeightDeviceUserTypeID", WeightDeviceUserTypeID, true)); parms.Add(new LBDbParameter("WeightDeviceType", WeightDeviceType)); parms.Add(new LBDbParameter("MachineName", MachineName)); parms.Add(new LBDbParameter("SerialName", SerialName)); string strSQL = @" insert into dbo.DbWeightDeviceUserType( WeightDeviceType,MachineName,SerialName ) values( @WeightDeviceType, @MachineName,@SerialName); select last_insert_rowid() as WeightDeviceUserTypeID; "; if (args.DBType == 1) { strSQL = @" insert into dbo.DbWeightDeviceUserType( WeightDeviceType,MachineName,SerialName ) values( @WeightDeviceType, @MachineName,@SerialName) select @@identity as WeightDeviceUserTypeID "; } DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); WeightDeviceUserTypeID.SetValueWithObject(parms["WeightDeviceUserTypeID"].Value); }
public void Update(FactoryArgs args, t_BigID DescriptionID, t_String Description) { LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("DescriptionID", DescriptionID)); parms.Add(new LBDbParameter("Description", Description)); parms.Add(new LBDbParameter("ChangedBy", new t_String(args.LoginName))); string strSQL = @" update dbo.DbDescription set Description=@Description, ChangedBy=@ChangedBy, ChangeTime=datetime('now','localtime') where DescriptionID = @DescriptionID "; if (args.DBType == 1) { strSQL = @" update dbo.DbDescription set Description=@Description, ChangedBy=@ChangedBy, ChangeTime=getdate() where DescriptionID = @DescriptionID "; } DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); }
public void Insert(FactoryArgs args, out t_BigID WeightLogID, t_DTSmall InWeightTime, t_Image CameraBuffer, t_Image ScreenBuffer) { WeightLogID = new t_BigID(); _DALSalesCarWeightLog.Insert(args, out WeightLogID); SaveCameraImage(args, WeightLogID, new t_ID(0), CameraBuffer, ScreenBuffer); }
public void InsertInfraredDeviceConfig(FactoryArgs args, t_String MachineName, t_String SerialName, t_ID HeaderXType, t_ID TailXType, t_ID HeaderYType, t_ID TailYType, t_Bool IsHeaderEffect, t_Bool IsTailEffect) { LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("MachineName", MachineName)); parms.Add(new LBDbParameter("SerialName", SerialName)); parms.Add(new LBDbParameter("HeaderXType", HeaderXType)); parms.Add(new LBDbParameter("TailXType", TailXType)); parms.Add(new LBDbParameter("HeaderYType", HeaderYType)); parms.Add(new LBDbParameter("TailYType", TailYType)); parms.Add(new LBDbParameter("IsHeaderEffect", IsHeaderEffect)); parms.Add(new LBDbParameter("IsTailEffect", IsTailEffect)); string strSQL = @" insert into dbo.DbInfraredDeviceConfig( MachineName,SerialName, HeaderXType,TailXType,HeaderYType,TailYType,IsHeaderEffect,IsTailEffect ) values( @MachineName,@SerialName, @HeaderXType,@TailXType,@HeaderXType,@TailXType,@IsHeaderEffect,@IsTailEffect) "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); }
public void Insert(FactoryArgs args, out t_BigID WeightLogID) { WeightLogID = new t_BigID(); LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("WeightLogID", WeightLogID, true)); string strSQL = @" insert into SalesCarWeightLog( InWeightTime,CarWeightStatus) values( datetime('now','localtime'),0); select last_insert_rowid() as WeightLogID; "; if (args.DBType == 1) { strSQL = @" insert into SalesCarWeightLog( InWeightTime,CarWeightStatus) values(getdate(),0) select @@identity as WeightLogID "; } DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); WeightLogID.Value = Convert.ToInt64(parms["WeightLogID"].Value); }
public void Update(FactoryArgs args, t_BigID ReportTemplateID, t_String ReportTemplateName, t_DTSmall TemplateFileTime, t_ID TemplateSeq, t_String Description, t_Image TemplateData, t_BigID ReportTypeID, t_String PrinterName, t_String MachineName, t_Bool IsManualPaperType, t_String PaperType, t_Bool IsManualPaperSize, t_ID PaperSizeHeight, t_ID PaperSizeWidth, t_Bool IsPaperTransverse, t_ID PrintCount) { using (DataTable dtExistsName = _DALDbReportTemplate.ExistsTemplateName(args, ReportTemplateName, ReportTypeID)) { if (dtExistsName.Rows.Count > 0)//校验上级权限组是否存在 { dtExistsName.DefaultView.RowFilter = "ReportTemplateID<>" + ReportTemplateID.Value; if (dtExistsName.DefaultView.Count == 0) { _DALDbReportTemplate.Update(args, ReportTemplateID, ReportTemplateName, TemplateFileTime, TemplateSeq, Description, TemplateData, ReportTypeID, PrinterName, MachineName, IsManualPaperType, PaperType, IsManualPaperSize, PaperSizeHeight, PaperSizeWidth, IsPaperTransverse, PrintCount); } else { throw new Exception("该报表名称已存在!"); } } else { _DALDbReportTemplate.Update(args, ReportTemplateID, ReportTemplateName, TemplateFileTime, TemplateSeq, Description, TemplateData, ReportTypeID, PrinterName, MachineName, IsManualPaperType, PaperType, IsManualPaperSize, PaperSizeHeight, PaperSizeWidth, IsPaperTransverse, PrintCount); } } }
public void DBItemBase_Update(FactoryArgs args, t_BigID ItemID, t_BigID ItemTypeID, t_String K3ItemCode, t_String ItemName, t_String ItemMode, t_Float ItemRate, t_BigID UOMID, t_String Description, t_Bool IsForbid, t_Decimal ItemPrice) { _DALDBItemBase.Update(args, ItemID, ItemTypeID, K3ItemCode, ItemName, ItemMode, ItemRate, UOMID, Description, IsForbid, ItemPrice); }
public void Insert(FactoryArgs args, out t_BigID SysViewTypeID, t_String SysViewType, t_String SysViewName) { SysViewTypeID = new t_BigID(); LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("SysViewTypeID", SysViewTypeID, true)); parms.Add(new LBDbParameter("SysViewType", SysViewType)); parms.Add(new LBDbParameter("SysViewName", SysViewName)); string strSQL = @" insert into dbo.SysViewType( SysViewType, SysViewName) values( @SysViewType, @SysViewName) select last_insert_rowid() as SysViewTypeID; "; if (args.DBType == 1) { strSQL = @" insert into dbo.SysViewType( SysViewType, SysViewName) values( @SysViewType, @SysViewName) select @@identity as SysViewTypeID "; } DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); SysViewTypeID.SetValueWithObject(Convert.ToInt64(parms["SysViewTypeID"].Value)); }
public void Update(FactoryArgs args, t_BigID SaleCarReturnBillID, t_Decimal CarTare, t_Decimal SuttleWeight, t_ID ReturnType, t_String Description, t_ID ReturnReason, t_BigID NewSaleCarInBillID) { LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("SaleCarReturnBillID", SaleCarReturnBillID)); parms.Add(new LBDbParameter("CarTare", CarTare)); parms.Add(new LBDbParameter("SuttleWeight", SuttleWeight)); parms.Add(new LBDbParameter("ReturnType", ReturnType)); parms.Add(new LBDbParameter("Description", Description)); parms.Add(new LBDbParameter("ReturnReason", ReturnReason)); parms.Add(new LBDbParameter("NewSaleCarInBillID", NewSaleCarInBillID)); string strSQL = @" update SaleCarReturnBill set ReturnStatus=1, CarTare = @CarTare, SuttleWeight = @SuttleWeight, ReturnType = @ReturnType, Description = @Description, CarOutTime = getdate(), ReturnReason = @ReturnReason, NewSaleCarInBillID = @NewSaleCarInBillID where SaleCarReturnBillID = @SaleCarReturnBillID "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); }
public void Insert(FactoryArgs args, out t_BigID UserID, t_String LoginName, t_String UserPassword, t_String UserName, t_ID UserType, t_ID UserSex) { UserID = new t_BigID(); LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("UserID", UserID, true)); parms.Add(new LBDbParameter("LoginName", LoginName)); parms.Add(new LBDbParameter("UserPassword", UserPassword)); parms.Add(new LBDbParameter("UserName", UserName)); parms.Add(new LBDbParameter("UserType", UserType)); parms.Add(new LBDbParameter("UserSex", UserSex)); parms.Add(new LBDbParameter("ChangeBy", new t_String(args.LoginName))); parms.Add(new LBDbParameter("ChangeTime", new t_DTSmall(DateTime.Now))); string strSQL = @" insert into dbo.DBUser( LoginName, UserPassword, ForbidLogin, IsManager, ChangeBy, ChangeTime, UserType, UserName, UserSex) values( @LoginName, @UserPassword, 0, 0, @ChangeBy, @ChangeTime, @UserType, @UserName, @UserSex) set @UserID = @@identity "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); UserID.Value = Convert.ToInt64(parms["UserID"].Value); }
public void Update(FactoryArgs args, t_BigID UserID, t_String LoginName, t_String UserPassword, t_String UserName, t_ID UserType, t_ID UserSex) { LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("UserID", UserID)); parms.Add(new LBDbParameter("LoginName", LoginName)); parms.Add(new LBDbParameter("UserPassword", UserPassword)); parms.Add(new LBDbParameter("UserName", UserName)); parms.Add(new LBDbParameter("UserType", UserType)); parms.Add(new LBDbParameter("UserSex", UserSex)); parms.Add(new LBDbParameter("ChangeBy", new t_String(args.LoginName))); parms.Add(new LBDbParameter("ChangeTime", new t_DTSmall(DateTime.Now))); string strSQL = @" update dbo.DBUser set LoginName=@LoginName, --UserPassword=@UserPassword, ForbidLogin=0, ChangeBy=@ChangeBy, ChangeTime=@ChangeTime, UserType=@UserType, UserName=@UserName, UserSex=@UserSex where UserID = @UserID "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); }
public void InsertUserCnofig(FactoryArgs args, t_BigID WeightDeviceUserTypeID, t_ID DeviceBoTeLv, t_ID DeviceShuJuWei, t_ID DeviceTingZhiWei, t_ID DeviceZhenChangDu, t_ID DeviceZhenQiShiBiaoShi, t_ID DeviceZhenChuLiFangShi, t_ID DeviceChongFuWeiZhi, t_ID DeviceChongFuChangDu, t_ID DeviceXiaoShuWei, t_ID DeviceFuHaoKaiShi) { LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("WeightDeviceUserTypeID", WeightDeviceUserTypeID)); parms.Add(new LBDbParameter("DeviceBoTeLv", DeviceBoTeLv)); parms.Add(new LBDbParameter("DeviceShuJuWei", DeviceShuJuWei)); parms.Add(new LBDbParameter("DeviceTingZhiWei", DeviceTingZhiWei)); parms.Add(new LBDbParameter("DeviceZhenChangDu", DeviceZhenChangDu)); parms.Add(new LBDbParameter("DeviceZhenQiShiBiaoShi", DeviceZhenQiShiBiaoShi)); parms.Add(new LBDbParameter("DeviceZhenChuLiFangShi", DeviceZhenChuLiFangShi)); parms.Add(new LBDbParameter("DeviceChongFuWeiZhi", DeviceChongFuWeiZhi)); parms.Add(new LBDbParameter("DeviceChongFuChangDu", DeviceChongFuChangDu)); parms.Add(new LBDbParameter("DeviceXiaoShuWei", DeviceXiaoShuWei)); parms.Add(new LBDbParameter("DeviceFuHaoKaiShi", DeviceFuHaoKaiShi)); string strSQL = @" insert into dbo.DbWeightDeviceUserConfig( WeightDeviceUserTypeID, DeviceBoTeLv, DeviceShuJuWei, DeviceTingZhiWei, DeviceZhenChangDu, DeviceZhenQiShiBiaoShi, DeviceZhenChuLiFangShi, DeviceChongFuWeiZhi, DeviceChongFuChangDu, DeviceXiaoShuWei, DeviceFuHaoKaiShi ) values( @WeightDeviceUserTypeID, @DeviceBoTeLv, @DeviceShuJuWei, @DeviceTingZhiWei, @DeviceZhenChangDu, @DeviceZhenQiShiBiaoShi, @DeviceZhenChuLiFangShi, @DeviceChongFuWeiZhi, @DeviceChongFuChangDu, @DeviceXiaoShuWei, @DeviceFuHaoKaiShi) "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); }
public void Update(FactoryArgs args, t_BigID BackUpConfigID, t_ID BackUpType, t_ID BackUpWeek, t_ID BackUpHour, t_ID BackUpMinu, t_Bool IsEffect, t_ID BackUpFileMaxNum, t_String BackUpPath, t_String BackUpName) { LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("BackUpConfigID", BackUpConfigID)); parms.Add(new LBDbParameter("BackUpType", BackUpType)); parms.Add(new LBDbParameter("BackUpWeek", BackUpWeek)); parms.Add(new LBDbParameter("BackUpHour", BackUpHour)); parms.Add(new LBDbParameter("BackUpMinu", BackUpMinu)); parms.Add(new LBDbParameter("IsEffect", IsEffect)); parms.Add(new LBDbParameter("BackUpFileMaxNum", BackUpFileMaxNum)); parms.Add(new LBDbParameter("BackUpPath", BackUpPath)); parms.Add(new LBDbParameter("BackUpName", BackUpName)); parms.Add(new LBDbParameter("ChangedBy", new t_String(args.LoginName))); string strSQL = @" update dbo.DbBackUpConfig set BackUpType=@BackUpType, BackUpWeek=@BackUpWeek, BackUpHour=@BackUpHour, BackUpMinu=@BackUpMinu, IsEffect=@IsEffect, BackUpFileMaxNum=@BackUpFileMaxNum, ChangedBy=@ChangedBy, ChangedTime=getdate(), BackUpPath=@BackUpPath, BackUpName=@BackUpName where BackUpConfigID = @BackUpConfigID "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); }
public void Insert(FactoryArgs args, out t_BigID BackUpConfigID, t_ID BackUpType, t_ID BackUpWeek, t_ID BackUpHour, t_ID BackUpMinu, t_Bool IsEffect, t_ID BackUpFileMaxNum, t_String BackUpPath, t_String BackUpName) { BackUpConfigID = new t_BigID(); LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("BackUpConfigID", BackUpConfigID, true)); parms.Add(new LBDbParameter("BackUpType", BackUpType)); parms.Add(new LBDbParameter("BackUpWeek", BackUpWeek)); parms.Add(new LBDbParameter("BackUpHour", BackUpHour)); parms.Add(new LBDbParameter("BackUpMinu", BackUpMinu)); parms.Add(new LBDbParameter("IsEffect", IsEffect)); parms.Add(new LBDbParameter("BackUpFileMaxNum", BackUpFileMaxNum)); parms.Add(new LBDbParameter("BackUpPath", BackUpPath)); parms.Add(new LBDbParameter("BackUpName", BackUpName)); parms.Add(new LBDbParameter("ChangedBy", new t_String(args.LoginName))); string strSQL = @" insert into dbo.DbBackUpConfig( BackUpType, BackUpWeek, BackUpHour, BackUpMinu, IsEffect, BackUpFileMaxNum, ChangedBy, ChangedTime, BackUpPath, BackUpName) values( @BackUpType, @BackUpWeek, @BackUpHour, @BackUpMinu, @IsEffect, @BackUpFileMaxNum, @ChangedBy, getdate(), @BackUpPath, @BackUpName) set @BackUpConfigID = @@identity "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); BackUpConfigID.SetValueWithObject(parms["BackUpConfigID"].Value); }
public void Insert(FactoryArgs args, out t_BigID ModifyBillHeaderID, t_BigID BillTypeID, t_BigID CustomerID, t_String ModifyBillCode, t_DTSmall BillDate, t_DTSmall EffectDate, t_String Description) { ModifyBillHeaderID = new t_BigID(); LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("ModifyBillHeaderID", ModifyBillHeaderID, true)); parms.Add(new LBDbParameter("BillTypeID", BillTypeID)); parms.Add(new LBDbParameter("CustomerID", CustomerID)); parms.Add(new LBDbParameter("ModifyBillCode", ModifyBillCode)); parms.Add(new LBDbParameter("BillDate", BillDate)); parms.Add(new LBDbParameter("EffectDate", EffectDate)); parms.Add(new LBDbParameter("Description", Description)); parms.Add(new LBDbParameter("CreateBy", new t_String(args.LoginName))); parms.Add(new LBDbParameter("CreateTime", new t_DTSmall(DateTime.Now))); parms.Add(new LBDbParameter("ChangeBy", new t_String(args.LoginName))); parms.Add(new LBDbParameter("ChangeTime", new t_DTSmall(DateTime.Now))); string strSQL = @" insert into dbo.ModifyBillHeader(CustomerID,BillTypeID, ModifyBillCode, BillDate, EffectDate, Description, IsApprove,IsCancel,CreateBy, CreateTime, ChangeBy, ChangeTime) values( @CustomerID,@BillTypeID, @ModifyBillCode, @BillDate, @EffectDate, @Description, 0, 0, @CreateBy, @CreateTime, @ChangeBy, @ChangeTime) set @ModifyBillHeaderID = @@identity "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); ModifyBillHeaderID.Value = Convert.ToInt64(parms["ModifyBillHeaderID"].Value); }
public void InsertPermissionData(FactoryArgs args, out t_BigID PermissionDataID, t_BigID PermissionID, t_String PermissionCode, t_String PermissionDataName, t_SmallID PermissionType, t_ID PermissionSPType, t_ID PermissionViewType, t_String LogFieldName, t_ID DetailIndex, t_Bool Forbid) { PermissionDataID = new t_BigID(); LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("PermissionDataID", PermissionDataID, true)); parms.Add(new LBDbParameter("PermissionID", PermissionID)); parms.Add(new LBDbParameter("PermissionCode", PermissionCode)); parms.Add(new LBDbParameter("PermissionDataName", PermissionDataName)); parms.Add(new LBDbParameter("PermissionType", PermissionType)); parms.Add(new LBDbParameter("PermissionSPType", PermissionSPType)); parms.Add(new LBDbParameter("PermissionViewType", PermissionViewType)); parms.Add(new LBDbParameter("LogFieldName", LogFieldName)); parms.Add(new LBDbParameter("DetailIndex", DetailIndex)); parms.Add(new LBDbParameter("Forbid", Forbid)); string strSQL = @" insert into dbo.DbPermissionData(PermissionID, PermissionCode, PermissionDataName, PermissionType, PermissionSPType, PermissionViewType, LogFieldName,DetailIndex, Forbid) values(@PermissionID, @PermissionCode, @PermissionDataName, @PermissionType, @PermissionSPType, @PermissionViewType,@LogFieldName,@DetailIndex, @Forbid) set @PermissionDataID = @@identity "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); PermissionDataID.SetValueWithObject(parms["PermissionDataID"].Value); }
public void Update(FactoryArgs args, t_BigID ModifyBillHeaderID, t_BigID CustomerID, t_DTSmall BillDate, t_DTSmall EffectDate, t_String Description) { LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("ModifyBillHeaderID", ModifyBillHeaderID)); parms.Add(new LBDbParameter("CustomerID", CustomerID)); parms.Add(new LBDbParameter("BillDate", BillDate)); parms.Add(new LBDbParameter("EffectDate", EffectDate)); parms.Add(new LBDbParameter("Description", Description)); parms.Add(new LBDbParameter("ChangeBy", new t_String(args.LoginName))); parms.Add(new LBDbParameter("ChangeTime", new t_DTSmall(DateTime.Now))); string strSQL = @" update dbo.ModifyBillHeader set CustomerID = @CustomerID, BillDate = @BillDate, EffectDate = @EffectDate, Description = @Description, ChangeBy = @ChangeBy, ChangeTime = @ChangeTime where ModifyBillHeaderID = @ModifyBillHeaderID "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); }
public void UpdatePermissionData(FactoryArgs args, t_BigID PermissionDataID, t_String PermissionCode, t_String PermissionDataName, t_SmallID PermissionType, t_ID PermissionSPType, t_ID PermissionViewType, t_String LogFieldName, t_ID DetailIndex, t_Bool Forbid) { LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("PermissionDataID", PermissionDataID)); parms.Add(new LBDbParameter("PermissionCode", PermissionCode)); parms.Add(new LBDbParameter("PermissionDataName", PermissionDataName)); parms.Add(new LBDbParameter("PermissionType", PermissionType)); parms.Add(new LBDbParameter("PermissionSPType", PermissionSPType)); parms.Add(new LBDbParameter("PermissionViewType", PermissionViewType)); parms.Add(new LBDbParameter("LogFieldName", LogFieldName)); parms.Add(new LBDbParameter("DetailIndex", DetailIndex)); parms.Add(new LBDbParameter("Forbid", Forbid)); string strSQL = @" update dbo.DbPermissionData set PermissionCode = @PermissionCode, PermissionDataName = @PermissionDataName, PermissionType = @PermissionType, PermissionSPType = @PermissionSPType, LogFieldName = @LogFieldName, PermissionViewType = @PermissionViewType, DetailIndex = @DetailIndex, Forbid = @Forbid where PermissionDataID = @PermissionDataID "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); }
public void DBItemBase_Insert(FactoryArgs args, out t_BigID ItemID, t_BigID ItemTypeID, out t_String ItemCode, t_String K3ItemCode, t_String ItemName, t_String ItemMode, t_Float ItemRate, t_BigID UOMID, t_String Description, t_Bool IsForbid, t_Decimal ItemPrice) { ItemCode = new t_String(); t_String MaxCode; _DALDBItemBase.GetMaxCode(args, out MaxCode); int CodeIndex = MaxCode.Value == null ? 0 : LBConverter.ToInt32(MaxCode.Value.Replace("S", "")); CodeIndex++; if (CodeIndex < 10) { ItemCode.SetValueWithObject("S00" + CodeIndex.ToString()); } else if (CodeIndex < 100) { ItemCode.SetValueWithObject("S0" + CodeIndex.ToString()); } else { ItemCode.SetValueWithObject("S" + CodeIndex.ToString()); } _DALDBItemBase.Insert(args, out ItemID, ItemTypeID, ItemCode, K3ItemCode, ItemName, ItemMode, ItemRate, UOMID, Description, IsForbid, ItemPrice); }
public void Insert(FactoryArgs args, out t_BigID CardID, t_String CardCode, t_String CardName) { CardID = new t_BigID(); LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("CardID", CardID, true)); parms.Add(new LBDbParameter("CardCode", CardCode)); parms.Add(new LBDbParameter("CardName", CardName)); parms.Add(new LBDbParameter("ChangeBy", new t_String(args.LoginName))); string strSQL = @" insert into DbCard( CardCode, CardName, ChangeBy, ChangeTime) values( @CardCode, @CardName,@ChangeBy,datetime('now','localtime')); select last_insert_rowid() as CardID; "; if (args.DBType == 1) { strSQL = @" insert into DbCard( CardCode, CardName, ChangeBy, ChangeTime) values( @CardCode, @CardName,@ChangeBy,getdate() select @@identity as CardID "; } DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); CardID.Value = Convert.ToInt64(parms["CardID"].Value); }
//按审核日期计算读取最近审核的明细行记录 public DataTable GetLastModifyBillDetail(FactoryArgs args, t_BigID ModifyBillDetailID, t_BigID CustomerID, t_BigID CarID, t_BigID ItemID, t_ID CalculateType) { LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("ModifyBillDetailID", ModifyBillDetailID)); parms.Add(new LBDbParameter("CustomerID", CustomerID)); parms.Add(new LBDbParameter("CarID", CarID)); parms.Add(new LBDbParameter("ItemID", ItemID)); parms.Add(new LBDbParameter("CalculateType", CalculateType)); string strSQL = @" select top 1 d.* from dbo.ModifyBillDetail d inner join dbo.ModifyBillHeader h on d.ModifyBillHeaderID = h.ModifyBillHeaderID where ModifyBillDetailID<>@ModifyBillDetailID and CustomerID = @CustomerID and CarID = @CarID and ItemID = @ItemID and CalculateType = @CalculateType and h.IsApprove=1 order by ApproveTime desc "; return(DBHelper.ExecuteQuery(args, strSQL, parms)); }
public void Update(FactoryArgs args, t_BigID CardID, t_String CardCode, t_String CardName) { LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("CardID", CardID)); parms.Add(new LBDbParameter("CardCode", CardCode)); parms.Add(new LBDbParameter("CardName", CardName)); parms.Add(new LBDbParameter("ChangeBy", new t_String(args.LoginName))); string strSQL = @" update DbCard set CardCode = @CardCode, CardName = @CardName, ChangeBy= @ChangeBy, ChangeTime = datetime('now','localtime') where CardID = @CardID "; if (args.DBType == 1) { strSQL = @" update DbCard set CardCode = @CardCode, CardName = @CardName, ChangeBy= @ChangeBy, ChangeTime = getdate() where CardID = @CardID "; } DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); }
public void UpdateInfraredDeviceConfig(FactoryArgs args, t_String MachineName, t_String SerialName, t_ID HeaderXType, t_ID TailXType, t_ID HeaderYType, t_ID TailYType, t_Bool IsHeaderEffect, t_Bool IsTailEffect) { LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("MachineName", MachineName)); parms.Add(new LBDbParameter("SerialName", SerialName)); parms.Add(new LBDbParameter("HeaderXType", HeaderXType)); parms.Add(new LBDbParameter("TailXType", TailXType)); parms.Add(new LBDbParameter("HeaderYType", HeaderYType)); parms.Add(new LBDbParameter("TailYType", TailYType)); parms.Add(new LBDbParameter("IsHeaderEffect", IsHeaderEffect)); parms.Add(new LBDbParameter("IsTailEffect", IsTailEffect)); string strSQL = @" update dbo.DbInfraredDeviceConfig set SerialName = @SerialName, HeaderXType = @HeaderXType, TailXType = @TailXType, HeaderYType = @HeaderYType, TailYType = @TailYType, IsHeaderEffect = @IsHeaderEffect, IsTailEffect = @IsTailEffect where MachineName = @MachineName "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); }
public void Update(FactoryArgs args, t_BigID ModifyBillHeaderID, t_BigID CustomerID, t_DTSmall BillDate, t_DTSmall EffectDate, t_String Description) { using (DataTable dtCustomer = _DALModifyBillHeader.GetCustomerByID(args, CustomerID)) { if (dtCustomer.Rows.Count == 0) { throw new Exception("所选客户不存在,保存不成功!"); } } using (DataTable dtHeader = _DALModifyBillHeader.GetModifyBillHeader(args, ModifyBillHeaderID)) { DataRow drHeader = dtHeader.Rows[0]; bool bolIsApprove = LBConverter.ToBoolean(drHeader["IsApprove"]); bool bolIsCancel = LBConverter.ToBoolean(drHeader["IsCancel"]); if (bolIsApprove) { throw new Exception("该调价单已审核,无法保存修改!"); } if (bolIsCancel) { throw new Exception("该调价单已作废,无法保存修改!"); } } _DALModifyBillHeader.Update(args, ModifyBillHeaderID, CustomerID, BillDate, EffectDate, Description); }
public void Insert(FactoryArgs args, out t_BigID DescriptionID, t_String Description) { DescriptionID = new t_BigID(); LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("DescriptionID", DescriptionID, true)); parms.Add(new LBDbParameter("Description", Description)); parms.Add(new LBDbParameter("ChangedBy", new t_String(args.LoginName))); string strSQL = @" insert into dbo.DbDescription( Description,ChangedBy, ChangeTime) values( @Description, @ChangedBy, datetime('now','localtime')); select last_insert_rowid() as DescriptionID; "; if (args.DBType == 1) { strSQL = @" insert into dbo.DbDescription( Description,ChangedBy, ChangeTime) values( @Description, @ChangedBy, getdate()) select @@identity as DescriptionID "; } DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); DescriptionID.SetValueWithObject(parms["DescriptionID"].Value); }
public void Delete(FactoryArgs args, t_BigID ModifyBillHeaderID) { using (DataTable dtHeader = _DALModifyBillHeader.GetModifyBillHeader(args, ModifyBillHeaderID)) { DataRow drHeader = dtHeader.Rows[0]; bool bolIsApprove = LBConverter.ToBoolean(drHeader["IsApprove"]); bool bolIsCancel = LBConverter.ToBoolean(drHeader["IsCancel"]); if (bolIsApprove) { throw new Exception("该调价单已审核,无法删除!"); } if (bolIsCancel) { throw new Exception("该调价单已作废,无法删除!"); } } DBHelper.ExecInTransDelegate exec = delegate(FactoryArgs argsInTrans) { using (DataTable dtDetail = _DALModifyBillDetail.GetModifyBillDetailByHeaderID(argsInTrans, ModifyBillHeaderID)) { foreach (DataRow dr in dtDetail.Rows) { } } _DALModifyBillHeader.Delete(argsInTrans, ModifyBillHeaderID); }; DBHelper.ExecInTrans(args, exec); }
public void Update(FactoryArgs args, t_BigID BackUpConfigID, t_ID BackUpType, t_ID BackUpWeek, t_ID BackUpHour, t_ID BackUpMinu, t_Bool IsEffect, t_ID BackUpFileMaxNum, t_String BackUpPath, t_String BackUpName) { _DALDbBackUpConfig.Update(args, BackUpConfigID, BackUpType, BackUpWeek, BackUpHour, BackUpMinu, IsEffect, BackUpFileMaxNum, BackUpPath, BackUpName); }
public DataTable GetCarItemPrice(FactoryArgs args, t_BigID ItemID, t_BigID CarID, t_BigID CustomerID, t_ID CalculateType) { LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("CarID", CarID)); parms.Add(new LBDbParameter("ItemID", ItemID)); parms.Add(new LBDbParameter("CustomerID", CustomerID)); parms.Add(new LBDbParameter("CalculateType", CalculateType)); string strSQL = @" SELECT h.CustomerID, c.CustomerName,h.EffectDate,h.ApproveTime, d.ModifyBillDetailID, d.ItemID,i.ItemCode,i.ItemRate,i.ItemMode ,i.ItemName, d.MaterialPrice,d.FarePrice,d.TaxPrice,d.BrokerPrice, d.CarID, d.Price, d.CalculateType, (SELECT ConstText FROM dbo.DbSystemConst WHERE (FieldName = 'CalculateType') AND (ConstValue = d.CalculateType)) AS CalculateTypeName, d.UOMID, u.UOMName FROM dbo.ModifyBillHeader AS h INNER JOIN dbo.ModifyBillDetail AS d ON h.ModifyBillHeaderID = d.ModifyBillHeaderID INNER JOIN dbo.DbCustomer AS c ON c.CustomerID = h.CustomerID INNER JOIN dbo.DbItemBase AS i ON i.ItemID = d.ItemID INNER JOIN dbo.DbUOM AS u ON u.UOMID = d.UOMID --LEFT OUTER JOIN dbo.DbCar AS ca ON ca.CarID = d.CarID and where --d.CarID = @CarID and d.ItemID = @ItemID and isnull(h.CustomerID,0) = isnull(@CustomerID,0) and d.CalculateType = @CalculateType and h.IsApprove=1 and isnull(h.IsCancel,0)=0 and h.EffectDate<=CONVERT(varchar(12) , getdate(), 111 ) order by h.ApproveTime desc "; return(DBHelper.ExecuteQuery(args, strSQL, parms)); }
public void Update(FactoryArgs args, t_BigID SysViewTypeID, t_String SysViewType, t_String SysViewName) { using (DataTable dtView = _DALSysViewType.VerifyExists(args, SysViewType, SysViewName)) { if (dtView.Rows.Count > 0) { foreach (DataRow drView in dtView.Rows) { long lSysViewTypeID = Convert.ToInt64(drView["SysViewTypeID"]); string strSysViewType = drView["SysViewType"].ToString().TrimEnd(); string strSysViewName = drView["SysViewName"].ToString().TrimEnd(); if (SysViewTypeID.Value != lSysViewTypeID) { if (SysViewType.Value == strSysViewType) { throw new Exception("该视图号已存在!"); } if (SysViewName.Value == strSysViewName) { throw new Exception("该视图名称已存在!"); } } } } } _DALSysViewType.Update(args, SysViewTypeID, SysViewType, SysViewName); }
public void GetConfigValue(FactoryArgs args, t_String SysConfigFieldName, out t_String SysConfigValue) { SysConfigValue = new t_String(""); t_String SysConfigDefaultValue = new t_String(""); using (DataTable dtConfig = _DALDbSysConfig.GetDbSysConfigField(args, SysConfigFieldName)) { if (dtConfig.Rows.Count == 0) { throw new Exception("该系统设置无效!"); } else { DataRow drConfig = dtConfig.Rows[0]; SysConfigDefaultValue.SetValueWithObject(drConfig["SysConfigDefaultValue"]); } } using (DataTable dtConfigValue = _DALDbSysConfig.GetDbSysConfigValue(args, SysConfigFieldName)) { if (dtConfigValue.Rows.Count == 0) { SysConfigValue.Value = SysConfigDefaultValue.Value; } else { DataRow drConfig = dtConfigValue.Rows[0]; SysConfigValue.SetValueWithObject(drConfig["SysConfigValue"]); } } }