public void Customer_UpdateFromService(FactoryArgs args, t_BigID CustomerID, t_String CustomerName, t_String Contact, t_String Phone, t_String Address, t_Bool CarIsLimit, t_ID AmountType, t_String LicenceNum, t_String Description, t_Bool IsForbid, t_ID ReceiveType, t_Decimal CreditAmount, t_Bool IsDisplayPrice, t_Bool IsDisplayAmount, t_Bool IsPrintAmount, t_Bool IsAllowOverFul, t_Bool IsAllowEmptyIn, t_Decimal AmountNotEnough, t_Decimal TotalReceivedAmount, t_Decimal SalesReceivedAmount, t_String K3CustomerCode, t_BigID CustomerTypeID) { DBHelper.ExecInTransDelegate exec = delegate(FactoryArgs argsInTrans) { this.Customer_Update(argsInTrans, CustomerID, CustomerName, Contact, Phone, Address, CarIsLimit, AmountType, LicenceNum, Description, ReceiveType, CreditAmount, IsDisplayPrice, IsDisplayAmount, IsPrintAmount, IsAllowOverFul, IsAllowEmptyIn, AmountNotEnough, K3CustomerCode, CustomerTypeID); _DALDbCustomer.UpdateAmount(argsInTrans, CustomerID, TotalReceivedAmount, SalesReceivedAmount); IsForbid.IsNullToZero(); if (IsForbid.Value == 1) { _DALDbCustomer.Forbid(args, CustomerID); } else { _DALDbCustomer.UnForbid(args, CustomerID); } }; DBHelper.ExecInTrans(args, exec); }
public void Customer_Insert(FactoryArgs args, out t_BigID CustomerID, t_String CustomerCode, t_String CustomerName, t_String Contact, t_String Phone, t_String Address, t_Bool CarIsLimit, t_ID AmountType, t_String LicenceNum, t_String Description, t_ID ReceiveType, t_Decimal CreditAmount, t_Bool IsDisplayPrice, t_Bool IsDisplayAmount, t_Bool IsPrintAmount, t_Bool IsAllowOverFul, t_Bool IsAllowEmptyIn, t_Decimal AmountNotEnough, t_String K3CustomerCode, t_BigID CustomerTypeID) { CustomerTypeID.NullIfZero(); CarIsLimit.IsNullToZero(); IsDisplayPrice.IsNullToZero(); IsDisplayAmount.IsNullToZero(); IsPrintAmount.IsNullToZero(); IsAllowOverFul.IsNullToZero(); CreditAmount.IsNullToZero(); CreditAmount.IsNullToZero(); CustomerID = new t_BigID(); LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("CustomerID", CustomerID, true)); parms.Add(new LBDbParameter("CustomerCode", CustomerCode)); parms.Add(new LBDbParameter("CustomerName", CustomerName)); parms.Add(new LBDbParameter("CustomerTypeID", CustomerTypeID)); parms.Add(new LBDbParameter("Contact", Contact)); parms.Add(new LBDbParameter("Phone", Phone)); parms.Add(new LBDbParameter("Address", Address)); parms.Add(new LBDbParameter("CarIsLimit", CarIsLimit)); parms.Add(new LBDbParameter("AmountType", AmountType)); parms.Add(new LBDbParameter("LicenceNum", LicenceNum)); parms.Add(new LBDbParameter("Description", Description)); parms.Add(new LBDbParameter("ReceiveType", ReceiveType)); parms.Add(new LBDbParameter("CreditAmount", CreditAmount)); parms.Add(new LBDbParameter("IsDisplayPrice", IsDisplayPrice)); parms.Add(new LBDbParameter("IsDisplayAmount", IsDisplayAmount)); parms.Add(new LBDbParameter("IsPrintAmount", IsPrintAmount)); parms.Add(new LBDbParameter("IsAllowOverFul", IsAllowOverFul)); parms.Add(new LBDbParameter("IsAllowEmptyIn", IsAllowEmptyIn)); 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))); parms.Add(new LBDbParameter("AmountNotEnough", AmountNotEnough)); parms.Add(new LBDbParameter("K3CustomerCode", K3CustomerCode)); string strSQL = @" insert into dbo.DbCustomer(CustomerCode,CustomerName, Contact, Phone, Address, CarIsLimit, AmountType, LicenceNum, Description, ReceiveType, CreditAmount, IsDisplayPrice, IsDisplayAmount, IsPrintAmount, IsAllowOverFul, CreateBy, CreateTime, ChangeBy, ChangeTime,IsAllowEmptyIn,AmountNotEnough,K3CustomerCode, CustomerTypeID) values(@CustomerCode, @CustomerName, @Contact, @Phone, @Address, @CarIsLimit, @AmountType, @LicenceNum, @Description, @ReceiveType, @CreditAmount, @IsDisplayPrice, @IsDisplayAmount, @IsPrintAmount, @IsAllowOverFul, @CreateBy, @CreateTime, @ChangeBy, @ChangeTime,@IsAllowEmptyIn,@AmountNotEnough,@K3CustomerCode, @CustomerTypeID) set @CustomerID = @@identity "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); CustomerID.Value = Convert.ToInt64(parms["CustomerID"].Value); }
public void Customer_Update(FactoryArgs args, t_BigID CustomerID, t_String CustomerName, t_String Contact, t_String Phone, t_String Address, t_Bool CarIsLimit, t_ID AmountType, t_String LicenceNum, t_String Description, t_Bool IsForbid, t_ID ReceiveType, t_Decimal CreditAmount, t_Bool IsDisplayPrice, t_Bool IsDisplayAmount, t_Bool IsPrintAmount, t_Bool IsAllowOverFul, t_Bool IsAllowEmptyIn) { IsAllowEmptyIn.IsNullToZero(); using (DataTable dtCustomer = _DALDbCustomer.GetCustomerByName(args, CustomerID, CustomerName)) { if (dtCustomer.Rows.Count > 0) { throw new Exception("该客户名称已存在!"); } } _DALDbCustomer.Customer_Update(args, CustomerID, CustomerName, Contact, Phone, Address, CarIsLimit, AmountType, LicenceNum, Description, IsForbid, ReceiveType, CreditAmount, IsDisplayPrice, IsDisplayAmount, IsPrintAmount, IsAllowOverFul, IsAllowEmptyIn); }
public void Customer_Insert(FactoryArgs args, out t_BigID CustomerID, out t_String CustomerCode, t_String CustomerName, t_String Contact, t_String Phone, t_String Address, t_Bool CarIsLimit, t_ID AmountType, t_String LicenceNum, t_String Description, t_ID ReceiveType, t_Decimal CreditAmount, t_Bool IsDisplayPrice, t_Bool IsDisplayAmount, t_Bool IsPrintAmount, t_Bool IsAllowOverFul, t_Bool IsAllowEmptyIn, t_Decimal AmountNotEnough, t_String K3CustomerCode, t_BigID CustomerTypeID) { CustomerTypeID.NullIfZero(); CustomerCode = new t_String(); CustomerID = new t_BigID(); IsAllowEmptyIn.IsNullToZero(); using (DataTable dtCustomer = _DALDbCustomer.GetCustomerByName(args, CustomerID, CustomerName)) { if (dtCustomer.Rows.Count > 0) { throw new Exception("该客户名称已存在!"); } } t_String MaxCode; _DALDbCustomer.GetMaxCode(args, out MaxCode); int CodeIndex = MaxCode.Value == null ? 0 : LBConverter.ToInt32(MaxCode.Value.Replace("K", "")); CodeIndex++; if (CodeIndex < 10) { CustomerCode.SetValueWithObject("K000" + CodeIndex.ToString()); } else if (CodeIndex < 100) { CustomerCode.SetValueWithObject("K00" + CodeIndex.ToString()); } else if (CodeIndex < 1000) { CustomerCode.SetValueWithObject("K0" + CodeIndex.ToString()); } else { CustomerCode.SetValueWithObject("K" + CodeIndex.ToString()); } _DALDbCustomer.Customer_Insert(args, out CustomerID, CustomerCode, CustomerName, Contact, Phone, Address, CarIsLimit, AmountType, LicenceNum, Description, ReceiveType, CreditAmount, IsDisplayPrice, IsDisplayAmount, IsPrintAmount, IsAllowOverFul, IsAllowEmptyIn, AmountNotEnough, K3CustomerCode, CustomerTypeID); }
public void InsertUpdateInfraredConfig(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) { IsHeaderEffect.IsNullToZero(); IsTailEffect.IsNullToZero(); using (DataTable dtUserCofnig = _DbInfraredDeviceConfig.GetInfraredConfig(args, MachineName)) { if (dtUserCofnig.Rows.Count > 0) { DataRow drConfig = dtUserCofnig.Rows[0]; _DbInfraredDeviceConfig.UpdateInfraredDeviceConfig(args, MachineName, SerialName, HeaderXType, TailXType, HeaderYType, TailYType, IsHeaderEffect, IsTailEffect); } else { _DbInfraredDeviceConfig.InsertInfraredDeviceConfig(args, MachineName, SerialName, HeaderXType, TailXType, HeaderYType, TailYType, IsHeaderEffect, IsTailEffect); } } }
public void SynchronousK3OutBillStatus(FactoryArgs args, t_BigID SaleCarInBillID, t_Bool IsSynchronousToK3OutBill, t_String SynchronousK3OutBillResult) { IsSynchronousToK3OutBill.IsNullToZero(); LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("SaleCarInBillID", SaleCarInBillID)); parms.Add(new LBDbParameter("IsSynchronousToK3OutBill", IsSynchronousToK3OutBill)); parms.Add(new LBDbParameter("SynchronousK3OutBillResult", SynchronousK3OutBillResult)); parms.Add(new LBDbParameter("SynchronousK3ByOutBill", new t_String(args.LoginName))); string strSQL = @" update dbo.SaleCarInBill set IsSynchronousToK3OutBill = @IsSynchronousToK3OutBill, SynchronousToTimeOutBill = getdate(), SynchronousK3ByOutBill= @SynchronousK3ByOutBill, SynchronousK3OutBillResult = @SynchronousK3OutBillResult where SaleCarInBillID = @SaleCarInBillID "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); }
public void Customer_Update(FactoryArgs args, t_BigID CustomerID, t_String CustomerName, t_String Contact, t_String Phone, t_String Address, t_Bool CarIsLimit, t_ID AmountType, t_String LicenceNum, t_String Description, t_ID ReceiveType, t_Decimal CreditAmount, t_Bool IsDisplayPrice, t_Bool IsDisplayAmount, t_Bool IsPrintAmount, t_Bool IsAllowOverFul, t_Bool IsAllowEmptyIn, t_Decimal AmountNotEnough, t_String K3CustomerCode, t_BigID CustomerTypeID) { CustomerTypeID.NullIfZero(); CarIsLimit.IsNullToZero(); IsDisplayPrice.IsNullToZero(); IsDisplayAmount.IsNullToZero(); IsPrintAmount.IsNullToZero(); IsAllowOverFul.IsNullToZero(); CreditAmount.IsNullToZero(); CreditAmount.IsNullToZero(); LBDbParameterCollection parms = new LBDbParameterCollection(); parms.Add(new LBDbParameter("CustomerID", CustomerID)); parms.Add(new LBDbParameter("CustomerName", CustomerName)); parms.Add(new LBDbParameter("CustomerTypeID", CustomerTypeID)); parms.Add(new LBDbParameter("Contact", Contact)); parms.Add(new LBDbParameter("Phone", Phone)); parms.Add(new LBDbParameter("Address", Address)); parms.Add(new LBDbParameter("CarIsLimit", CarIsLimit)); parms.Add(new LBDbParameter("AmountType", AmountType)); parms.Add(new LBDbParameter("LicenceNum", LicenceNum)); parms.Add(new LBDbParameter("Description", Description)); parms.Add(new LBDbParameter("ReceiveType", ReceiveType)); parms.Add(new LBDbParameter("CreditAmount", CreditAmount)); parms.Add(new LBDbParameter("IsDisplayPrice", IsDisplayPrice)); parms.Add(new LBDbParameter("IsDisplayAmount", IsDisplayAmount)); parms.Add(new LBDbParameter("IsPrintAmount", IsPrintAmount)); parms.Add(new LBDbParameter("IsAllowOverFul", IsAllowOverFul)); parms.Add(new LBDbParameter("IsAllowEmptyIn", IsAllowEmptyIn)); parms.Add(new LBDbParameter("ChangeBy", new t_String(args.LoginName))); parms.Add(new LBDbParameter("ChangeTime", new t_DTSmall(DateTime.Now))); parms.Add(new LBDbParameter("AmountNotEnough", AmountNotEnough)); parms.Add(new LBDbParameter("K3CustomerCode", K3CustomerCode)); string strSQL = @" update dbo.DbCustomer set CustomerName = @CustomerName, Contact=@Contact, Phone=@Phone, Address=@Address, CarIsLimit=@CarIsLimit, AmountType=@AmountType, LicenceNum=@LicenceNum, Description=@Description, ReceiveType=@ReceiveType, CreditAmount=@CreditAmount, IsDisplayPrice=@IsDisplayPrice, IsDisplayAmount=@IsDisplayAmount, IsPrintAmount=@IsPrintAmount, IsAllowOverFul=@IsAllowOverFul, ChangeBy=@ChangeBy, ChangeTime=@ChangeTime, IsAllowEmptyIn = @IsAllowEmptyIn, AmountNotEnough = @AmountNotEnough, K3CustomerCode = @K3CustomerCode, CustomerTypeID = @CustomerTypeID where CustomerID = @CustomerID "; DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false); }