Beispiel #1
0
        public void Bank_Update(FactoryArgs args, t_BigID ReceiveBankID, t_String BankName)
        {
            using (DataTable dtCar = _DALDbBank.GetBankByName(args, ReceiveBankID, BankName))
            {
                if (dtCar.Rows.Count > 0)
                {
                    throw new Exception("该收款银行名称已存在!");
                }
            }

            _DALDbBank.Bank_Update(args, ReceiveBankID, BankName);
        }
Beispiel #2
0
        public void DeletePermission(FactoryArgs args, t_BigID PermissionID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("PermissionID", PermissionID));
            string strSQL = @"
delete dbo.DbPermission
where PermissionID = @PermissionID
";

            DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false);
        }
        public void DeleteField(FactoryArgs args, t_BigID ReportViewFieldID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("ReportViewFieldID", ReportViewFieldID));
            string strSQL = @"
delete dbo.DbReportViewField
where ReportViewFieldID = @ReportViewFieldID
";

            DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false);
        }
Beispiel #4
0
        public void Car_Insert(FactoryArgs args, out t_BigID CarID, out t_String CarCode, t_String CarNum,
                               t_BigID CustomerID, t_String Description, t_Decimal DefaultCarWeight)
        {
            CarCode = new t_String();
            CarID   = new t_BigID();
            DefaultCarWeight.IsNullToZero();
            using (DataTable dtCar = _DALDbCar.GetCarByName(args, CarID, CarNum))
            {
                if (dtCar.Rows.Count > 0)
                {
                    throw new Exception("该车牌号码已存在!");
                }
            }

            t_BigID  CarID_temp   = new t_BigID();
            t_String CarCode_temp = new t_String();

            DBHelper.ExecInTransDelegate exec = delegate(FactoryArgs argsInTrans)
            {
                t_String MaxCode;
                _DALDbCar.GetMaxCarCode(argsInTrans, out MaxCode);

                int CodeIndex = MaxCode.Value == null?0:LBConverter.ToInt32(MaxCode.Value.Replace("C", ""));
                CodeIndex++;
                if (CodeIndex < 10)
                {
                    CarCode_temp.SetValueWithObject("C000" + CodeIndex.ToString());
                }
                else if (CodeIndex < 100)
                {
                    CarCode_temp.SetValueWithObject("C00" + CodeIndex.ToString());
                }
                else if (CodeIndex < 1000)
                {
                    CarCode_temp.SetValueWithObject("C0" + CodeIndex.ToString());
                }
                else
                {
                    CarCode_temp.SetValueWithObject("C" + CodeIndex.ToString());
                }

                _DALDbCar.Car_Insert(argsInTrans, out CarID_temp, CarCode_temp, CarNum, Description, DefaultCarWeight);

                if (CustomerID.Value > 0)
                {
                    _DALDbCar.InsertCustomerCar(argsInTrans, CarID_temp, CustomerID);
                }
            };
            DBHelper.ExecInTrans(args, exec);
            CarID.Value   = CarID_temp.Value;
            CarCode.Value = CarCode_temp.Value;
        }
Beispiel #5
0
        public void Supplier_Update(FactoryArgs args, t_BigID SupplierID, t_String SupplierName, t_ID IsForbidden)
        {
            IsForbidden.IsNullToZero();
            using (DataTable dtCar = _DALDbSupplier.GetSupplierByName(args, SupplierID, SupplierName))
            {
                if (dtCar.Rows.Count > 0)
                {
                    throw new Exception("该供应商名称已存在!");
                }
            }

            _DALDbSupplier.Supplier_Update(args, SupplierID, SupplierName, IsForbidden);
        }
Beispiel #6
0
        public void UpdateLastCheckTime(FactoryArgs args, t_BigID SessionID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("SessionID", SessionID));
            parms.Add(new LBDbParameter("LastCheckTime", new t_DTSmall(DateTime.Now)));
            string strSQL = @"
                update dbo.SysSession
                set LastCheckTime = @LastCheckTime
                where SessionID = @SessionID";

            DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false);
        }
Beispiel #7
0
        public void Customer_Delete(FactoryArgs args, t_BigID CustomerID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("CustomerID", CustomerID));

            string strSQL = @"
delete dbo.DbCustomer
where CustomerID = @CustomerID
";

            DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false);
        }
Beispiel #8
0
        public DataTable GetReturnBill(FactoryArgs args, t_BigID SaleCarReturnBillID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("SaleCarReturnBillID", SaleCarReturnBillID));
            string strSQL = @"
                select *
                from dbo.SaleCarReturnBill
                where SaleCarReturnBillID=@SaleCarReturnBillID
";

            return(DBHelper.ExecuteQuery(args, strSQL, parms));
        }
        public void Delete(FactoryArgs args, t_BigID ModifyBillDetailID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("ModifyBillDetailID", ModifyBillDetailID));

            string strSQL = @"
delete dbo.ModifyBillDetail
where ModifyBillDetailID = @ModifyBillDetailID
";

            DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false);
        }
Beispiel #10
0
        public void DBUser_Update(FactoryArgs args, t_BigID UserID, t_String LoginName, t_String UserPassword, t_String UserName,
                                  t_ID UserType, t_ID UserSex)
        {
            using (DataTable dtUser = _DALDBUser.GetUserByLoginName(args, UserID, LoginName))
            {
                if (dtUser.Rows.Count > 0)
                {
                    throw new Exception("该账户名称已存在!");
                }
            }

            _DALDBUser.Update(args, UserID, LoginName, UserPassword, UserName, UserType, UserSex);
        }
        public void DeleteSMItemPrice(FactoryArgs args, t_BigID ItemPriceID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("ItemPriceID", ItemPriceID));

            string strSQL = @"
delete dbo.SMItemPrice
where ItemPriceID = @ItemPriceID
";

            DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false);
        }
        public void UpdateOutPrintCount(FactoryArgs args, t_BigID SaleCarOutBillID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("SaleCarOutBillID", SaleCarOutBillID));
            string strSQL = @"
update dbo.SaleCarOutBill
set OutPrintCount = isnull(OutPrintCount,0)+1
where SaleCarOutBillID = @SaleCarOutBillID
";

            DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false);
        }
        public void UnApprove(FactoryArgs args, t_BigID SaleCarInBillID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("SaleCarInBillID", SaleCarInBillID));
            string strSQL = @"
                update dbo.SaleCarInBill
                set BillStatus=1
                where SaleCarInBillID = @SaleCarInBillID
";

            DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false);
        }
Beispiel #14
0
        public DataTable GetReportViewField(FactoryArgs args, t_BigID ReportViewID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("ReportViewID", ReportViewID));
            string strSQL = @"
select *
from dbo.DbReportViewField
where ReportViewID = @ReportViewID
";

            return(DBHelper.ExecuteQuery(args, strSQL, parms));
        }
Beispiel #15
0
        public DataTable GetCarByCustomer(FactoryArgs args, t_BigID CustomerID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("CustomerID", CustomerID));
            string strSQL = @"
select *
from dbo.DbCustomerCar
where CustomerID = @CustomerID
";

            return(DBHelper.ExecuteQuery(args, strSQL, parms));
        }
        public DataTable GetRPReceiveBillHeader(FactoryArgs args, t_BigID ReceiveBillHeaderID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("ReceiveBillHeaderID", ReceiveBillHeaderID));
            string strSQL = @"
select *
from dbo.RPReceiveBillHeader
where ReceiveBillHeaderID = @ReceiveBillHeaderID
";

            return(DBHelper.ExecuteQuery(args, strSQL, parms));
        }
Beispiel #17
0
        public void Insert(FactoryArgs args,
                           out t_BigID CameraConfigID, t_String MachineName,
                           t_String IPAddress1, t_ID Port1, t_String Account1, t_String Password1, t_Bool UseCamera1,
                           t_String IPAddress2, t_ID Port2, t_String Account2, t_String Password2, t_Bool UseCamera2,
                           t_String IPAddress3, t_ID Port3, t_String Account3, t_String Password3, t_Bool UseCamera3,
                           t_String IPAddress4, t_ID Port4, t_String Account4, t_String Password4, t_Bool UseCamera4)
        {
            CameraConfigID = new t_BigID();
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("CameraConfigID", CameraConfigID, true));
            parms.Add(new LBDbParameter("MachineName", MachineName));
            parms.Add(new LBDbParameter("IPAddress1", IPAddress1));
            parms.Add(new LBDbParameter("Port1", Port1));
            parms.Add(new LBDbParameter("Account1", Account1));
            parms.Add(new LBDbParameter("Password1", Password1));
            parms.Add(new LBDbParameter("IPAddress2", IPAddress2));
            parms.Add(new LBDbParameter("Port2", Port2));
            parms.Add(new LBDbParameter("Account2", Account2));
            parms.Add(new LBDbParameter("Password2", Password2));
            parms.Add(new LBDbParameter("IPAddress3", IPAddress3));
            parms.Add(new LBDbParameter("Port3", Port3));
            parms.Add(new LBDbParameter("Account3", Account3));
            parms.Add(new LBDbParameter("Password3", Password3));
            parms.Add(new LBDbParameter("IPAddress4", IPAddress4));
            parms.Add(new LBDbParameter("Port4", Port4));
            parms.Add(new LBDbParameter("Account4", Account4));
            parms.Add(new LBDbParameter("Password4", Password4));
            parms.Add(new LBDbParameter("ChangedBy", new t_String(args.LoginName)));
            parms.Add(new LBDbParameter("UseCamera1", UseCamera1));
            parms.Add(new LBDbParameter("UseCamera2", UseCamera2));
            parms.Add(new LBDbParameter("UseCamera3", UseCamera3));
            parms.Add(new LBDbParameter("UseCamera4", UseCamera4));

            string strSQL = @"
insert into dbo.DbCameraConfig( MachineName, IPAddress1, Port1, Account1, Password1, 
IPAddress2, Port2, Account2, Password2, IPAddress3, Port3, Account3, Password3, 
IPAddress4, Port4, Account4, Password4, ChangedBy, ChangeTime,
UseCamera1,UseCamera2,UseCamera3,UseCamera4)
values( @MachineName, @IPAddress1, @Port1, @Account1, @Password1, 
@IPAddress2, @Port2, @Account2, @Password2, @IPAddress3, @Port3, @Account3, @Password3, 
@IPAddress4, @Port4, @Account4, @Password4, @ChangedBy, getdate(),
@UseCamera1,@UseCamera2,@UseCamera3,@UseCamera4)

set @CameraConfigID = @@identity

";

            DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false);
            CameraConfigID.SetValueWithObject(parms["CameraConfigID"].Value);
        }
Beispiel #18
0
        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=datetime('now','localtime'),
    BackUpPath=@BackUpPath,
    BackUpName=@BackUpName
where BackUpConfigID = @BackUpConfigID
";

            if (args.DBType == 1)
            {
                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);
        }
Beispiel #19
0
        public void Car_RefCustomer(FactoryArgs args, t_BigID CarID, t_BigID CustomerID)
        {
            bool bolExists = _DALDbCar.VerifyIsRefCustomer(args, CarID, CustomerID);

            if (!bolExists)
            {
                DataTable dtRefCustomer = _DALDbCar.GetRefCustomer(args, CarID);
                if (dtRefCustomer.Rows.Count > 0)
                {
                    throw new Exception("该车辆已关联了客户【" + dtRefCustomer.Rows[0]["CustomerName"].ToString().TrimEnd() + "】,无法再关联其他客户!");
                }
                _DALDbCar.InsertCustomerCar(args, CarID, CustomerID);
            }
        }
        public DataTable ReadItem(FactoryArgs args, t_BigID ItemID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("ItemID", ItemID));

            string strSQL = @"
select *
from dbo.DbItemBase
where ItemID=@ItemID
";

            return(DBHelper.ExecuteQuery(args, strSQL, parms));
        }
Beispiel #21
0
        public DataTable GetUserConfig(FactoryArgs args, t_BigID WeightDeviceUserTypeID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("WeightDeviceUserTypeID", WeightDeviceUserTypeID));

            string strSQL = @"
select *
from dbo.DbWeightDeviceUserConfig
where WeightDeviceUserTypeID = @WeightDeviceUserTypeID
";

            return(DBHelper.ExecuteQuery(args, strSQL, parms));
        }
Beispiel #22
0
        public void SaveReportTemplate(FactoryArgs args, t_BigID ReportViewID, t_BigID ReportTemplateID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("ReportViewID", ReportViewID));
            parms.Add(new LBDbParameter("ReportTemplateID", ReportTemplateID));
            string strSQL = @"
update dbo.DbReportView
set ReportTemplateID=@ReportTemplateID
where ReportViewID = @ReportViewID
";

            DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false);
        }
        public void Delete(FactoryArgs args, t_BigID ReceiveBillHeaderID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("ReceiveBillHeaderID", ReceiveBillHeaderID));

            string strSQL = @"
delete dbo.RPReceiveBillHeader
where ReceiveBillHeaderID = @ReceiveBillHeaderID

";

            DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false);
        }
        public DataTable GetSalesCarWeightLog(FactoryArgs args, t_BigID WeightLogID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("WeightLogID", WeightLogID));

            string strSQL = @"
select *
from dbo.SalesCarWeightLog
where WeightLogID = @WeightLogID
";

            return(DBHelper.ExecuteQuery(args, strSQL, parms));
        }
Beispiel #25
0
        public void Car_Update(FactoryArgs args, t_BigID CarID, t_String CarNum,
                               t_BigID CustomerID, t_String Description, t_Decimal DefaultCarWeight)
        {
            DefaultCarWeight.IsNullToZero();
            using (DataTable dtCar = _DALDbCar.GetCarByName(args, CarID, CarNum))
            {
                if (dtCar.Rows.Count > 0)
                {
                    throw new Exception("该车牌号码已存在!");
                }
            }

            _DALDbCar.Car_Update(args, CarID, CarNum, Description, DefaultCarWeight);
        }
        public void UpdateCustomerSalesAmount(FactoryArgs args, t_BigID CustomerID, t_Decimal SalesReceivedAmount)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("CustomerID", CustomerID));
            parms.Add(new LBDbParameter("SalesReceivedAmount", SalesReceivedAmount));
            string strSQL = @"
update dbo.DbCustomer
set SalesReceivedAmount = isnull(SalesReceivedAmount,0)+isnull(@SalesReceivedAmount,0)
where CustomerID = @CustomerID
";

            DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false);
        }
Beispiel #27
0
        public void Delete(FactoryArgs args,
                           t_BigID BackUpConfigID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("BackUpConfigID", BackUpConfigID));

            string strSQL = @"
delete dbo.DbBackUpConfig
where BackUpConfigID = @BackUpConfigID
";

            DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false);
        }
Beispiel #28
0
        public DataTable GetPermission(FactoryArgs args, t_BigID PermissionID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("PermissionID", PermissionID));
            string    strSQL   = @"
select *
from dbo.DbPermission
where PermissionID=@PermissionID
";
            DataTable dtReturn = DBHelper.ExecuteQuery(args, strSQL, parms);

            return(dtReturn);
        }
Beispiel #29
0
        public void InsertUserPermission(FactoryArgs args, t_BigID UserID, t_BigID PermissionID)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("UserID", UserID));
            parms.Add(new LBDbParameter("PermissionID", PermissionID));
            parms.Add(new LBDbParameter("ChangedBy", new t_String(args.LoginName)));
            string strSQL = @"
insert dbo.DbUserPermission(UserID, PermissionID, ChangedBy, ChangeTime, HasPermission)
values(@UserID, @PermissionID, @ChangedBy, getdate(), 1)
";

            DBHelper.ExecuteNonQuery(args, System.Data.CommandType.Text, strSQL, parms, false);
        }
        public void UpdateOutBillAmount(FactoryArgs args, t_BigID SaleCarInBillID,
                                        t_Decimal Price, t_Decimal Amount)
        {
            LBDbParameterCollection parms = new LBDbParameterCollection();

            parms.Add(new LBDbParameter("SaleCarInBillID", SaleCarInBillID));
            parms.Add(new LBDbParameter("Price", Price));
            parms.Add(new LBDbParameter("Amount", Amount));
            string strSQL = @"
update  dbo.SaleCarOutBill
set Price = @Price,
    Amount = @Amount
where SaleCarInBillID = @SaleCarInBillID";
        }