예제 #1
0
        public List <DesignChangeModel> GetDesignChangeList(string SortColumns, int StartRecord, int MaxRecords, string SolutionNameLike, string ProjectCodeEqual, string NumberEqual, string PersonEqual, string UnitEqual, string SupplierEqual, DateTime DateStart, DateTime DateEnd, string TypeEqual, string StateInStr, string ChangeType, int ReferCode)
        {
            List <DesignChangeModel> models        = new List <DesignChangeModel>();
            DesignChangeQueryModel   objQueryModel = new DesignChangeQueryModel();

            objQueryModel.StartRecord      = StartRecord;
            objQueryModel.MaxRecords       = MaxRecords;
            objQueryModel.SortColumns      = SortColumns;
            objQueryModel.SolutionNameLike = SolutionNameLike;
            objQueryModel.ProjectNameEqual = ProjectCodeEqual;
            objQueryModel.NumberEqual      = NumberEqual;
            objQueryModel.PersonEqual      = PersonEqual;
            objQueryModel.UnitEqual        = UnitEqual;
            objQueryModel.SupplierEqual    = SupplierEqual;
            objQueryModel.DateStartCheck   = DateStart;
            objQueryModel.DateEndCheck     = DateEnd;
            objQueryModel.TypeEqual        = TypeEqual;
            objQueryModel.StateIn          = StateInStr;
            objQueryModel.ChangeType       = ChangeType;
            objQueryModel.ReferCode        = ReferCode;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    models = new DesignChangeBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
예제 #2
0
        public int YFPassAudit(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  = "2";
                        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);
        }
예제 #3
0
        public int Update(DesignChangeModel ObjModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new DesignChangeBLL().Update(ObjModel, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
예제 #4
0
        public DesignChangeModel GetDesignChange(int Code)
        {
            DesignChangeModel model = new DesignChangeModel();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    model = new DesignChangeBLL().GetModel(Code, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
예제 #5
0
        public static string GetDesignChangeName(int Code)
        {
            string solutionName = "";

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    DesignChangeBLL ebll = new DesignChangeBLL();
                    solutionName = ebll.GetModel(Code, connection).SolutionName;
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(solutionName);
        }
예제 #6
0
        public List <DesignChangeModel> GetDesignChangeListOne(int Code)
        {
            List <DesignChangeModel> list = new List <DesignChangeModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    DesignChangeBLL ebll = new DesignChangeBLL();
                    list.Add(ebll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
예제 #7
0
        public List <DesignChangeModel> GetDesignChangeList(DesignChangeQueryModel QueryModel)
        {
            List <DesignChangeModel> models = new List <DesignChangeModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    if (QueryModel == null)
                    {
                        QueryModel = new DesignChangeQueryModel();
                    }
                    models = new DesignChangeBLL().GetModels(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
예제 #8
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);
        }