示例#1
0
        public int UpdateAuditMoney(int Code, string ChangeMoneyDescription, decimal TotalMoney)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        DesignChangeBLL   ebll     = new DesignChangeBLL();
                        DesignChangeModel objModel = ebll.GetModel(Code, transaction);
                        if (!string.IsNullOrEmpty(ChangeMoneyDescription))
                        {
                            objModel.ChangeMoney = ChangeMoneyDescription;
                            objModel.TotalMoney  = TotalMoney;
                        }
                        num = ebll.Update(objModel, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
示例#2
0
        public List <LocaleViseModel> GetLocalVises(string SortColumns, int StartRecord, int MaxRecords, string ViseId, string ViseName, string VisePerson, string ViseSupplier, string ViseContractCode, string ViseUnit, DateTime ViseDateStart, DateTime ViseDateEnd, DateTime ViseEndDateStart, DateTime ViseEndDateEnd, string ViseProject, string ViseType, string ViseBalanceStatusInStr, string ViseStatusInStr, int ViseReferCode)
        {
            List <LocaleViseModel> list           = new List <LocaleViseModel>();
            LocaleViseQueryModel   viseQueryModel = new LocaleViseQueryModel();

            viseQueryModel.StartRecord            = StartRecord;
            viseQueryModel.MaxRecords             = MaxRecords;
            viseQueryModel.SortColumns            = SortColumns;
            viseQueryModel.ViseId                 = ViseId;
            viseQueryModel.ViseName               = ViseName;
            viseQueryModel.VisePerson             = VisePerson;
            viseQueryModel.ViseProject            = ViseProject;
            viseQueryModel.ViseStatusInStr        = ViseStatusInStr;
            viseQueryModel.ViseSupplier           = ViseSupplier;
            viseQueryModel.ViseType               = ViseType;
            viseQueryModel.ViseUnit               = ViseUnit;
            viseQueryModel.ViseBalanceStatusInStr = ViseBalanceStatusInStr;
            viseQueryModel.ViseContractCode       = ViseContractCode;
            viseQueryModel.ViseDateEnd            = ViseDateEnd;
            viseQueryModel.ViseDateStart          = ViseDateStart;
            viseQueryModel.ViseEndDateStart       = ViseEndDateStart;
            viseQueryModel.ViseEndDateEnd         = ViseEndDateEnd;
            viseQueryModel.ViseReferCode          = ViseReferCode;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    list = new LocaleViseBLL().Select(viseQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
示例#3
0
        public List <MaterialInModel> GetMaterialInListOne(int Code)
        {
            List <MaterialInModel> list       = new List <MaterialInModel>();
            SqlConnection          connection = new SqlConnection(FunctionRule.GetConnectionString());

            try
            {
                MaterialInBLL nbll = new MaterialInBLL();
                list.Add(nbll.GetModel(Code, connection));
                connection.Close();
            }
            catch (SqlException exception)
            {
                throw exception;
            }
            finally
            {
                if (connection != null)
                {
                    connection.Dispose();
                }
            }
            return(list);
        }
示例#4
0
        public static string ImportMaterial(Stream stream, string InputPerson)
        {
            string text;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                try
                {
                    MaterialImport import = new MaterialImport();
                    import.conn = connection;
                    text        = import.Import(stream, InputPerson);
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
                finally
                {
                    connection.Close();
                }
            }
            return(text);
        }
示例#5
0
        public int YFNoPass(int Code, string number)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        DesignChangeBLL   ebll     = new DesignChangeBLL();
                        DesignChangeModel objModel = ebll.GetModel(Code, transaction);
                        objModel.State       = "3";
                        objModel.ChangeMoney = "";
                        objModel.TotalMoney  = 0M;
                        objModel.Number      = number;
                        num = ebll.Update(objModel, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }