Example #1
0
        public int DeleteCost(LocaleViseCostModel ViseCostModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new LocaleViseBLL().DeleteCost(ViseCostModel, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Example #2
0
        public int UpdateComeToMoney(int ViseCode, decimal ComeToMoney)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        LocaleViseBLL   ebll      = new LocaleViseBLL();
                        LocaleViseModel viseModel = ebll.GetModel(ViseCode, transaction);
                        viseModel.ViseComeToMoney = ComeToMoney;
                        num = ebll.Update(viseModel, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Example #3
0
        public static ViseBalanceStatusEnum GetBalanceStatus(int ViseCode)
        {
            LocaleViseBLL         ebll    = new LocaleViseBLL();
            ViseBalanceStatusEnum unknown = ViseBalanceStatusEnum.unknown;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    switch (ebll.GetModel(ViseCode, connection).ViseBalanceStatus)
                    {
                    case 1:
                        unknown = ViseBalanceStatusEnum.nobalance;
                        break;

                    case 2:
                        unknown = ViseBalanceStatusEnum.isbalance;
                        break;

                    default:
                        unknown = ViseBalanceStatusEnum.unknown;
                        break;
                    }
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(unknown);
        }
Example #4
0
        public int PassAudit(int ViseCode, List <LocaleViseCostModel> CostList)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        LocaleViseBLL ebll = new LocaleViseBLL();
                        foreach (LocaleViseCostModel model in CostList)
                        {
                            ebll.UpdateCost(model, transaction);
                        }
                        num = ebll.PassAudit(ViseCode, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Example #5
0
        public int UpdateMaterialOutDtlList(List <MaterialOutDtlModel> ObjModelDtls, int MaterialOutCode)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    num = new MaterialOutBLL().UpdateMaterialOutDtlList(transaction, ObjModelDtls, MaterialOutCode);
                    transaction.Commit();
                    return(num);
                }
                catch (SqlException exception)
                {
                    transaction.Rollback();
                    connection.Close();
                    throw exception;
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Example #6
0
        public int Update(MaterialOutModel ObjModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    num = new MaterialOutBLL().Update(ObjModel, transaction);
                    transaction.Commit();
                    return(num);
                }
                catch (SqlException exception)
                {
                    transaction.Rollback();
                    connection.Close();
                    throw exception;
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Example #7
0
        public List <MaterialOutModel> GetMaterialOutList(MaterialOutQueryModel QueryModel)
        {
            List <MaterialOutModel> models     = new List <MaterialOutModel>();
            SqlConnection           connection = new SqlConnection(FunctionRule.GetConnectionString());

            try
            {
                if (QueryModel == null)
                {
                    QueryModel = new MaterialOutQueryModel();
                }
                models = new MaterialOutBLL().GetModels(QueryModel, connection);
                connection.Close();
            }
            catch (SqlException exception)
            {
                throw exception;
            }
            finally
            {
                if (connection != null)
                {
                    connection.Dispose();
                }
            }
            return(models);
        }
Example #8
0
        public static int ViseAuditForCreateContractChange(int Code, string UserCode, List <LocaleViseCostModel> CostList)
        {
            int        num     = 0;
            DataTable  table   = new DataTable();
            DataColumn column  = new DataColumn("Code", Type.GetType("System.String"));
            DataColumn column2 = new DataColumn("Type", Type.GetType("System.String"));

            table.Columns.Add(column);
            table.Columns.Add(column2);
            DataRow row = table.NewRow();

            row["Code"] = Code;
            row["Type"] = "Vise";
            table.Rows.Add(row);
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        LocaleViseBLL ebll = new LocaleViseBLL();
                        foreach (LocaleViseCostModel model in CostList)
                        {
                            ebll.UpdateCost(model, transaction);
                        }
                        num = ebll.PassAudit(Code, transaction);
                        ebll.Balance(Code, transaction);
                        string viseContractCode = ebll.GetModel(Code, transaction).ViseContractCode;
                        if (viseContractCode != "")
                        {
                            ContractRule.BuildContractChangeByNexusCodeType(viseContractCode, table, transaction, UserCode);
                        }
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Example #9
0
        public List <MaterialInDtlModel> SelectMaterialInDtlList(string SortColumns, int StartRecord, int MaxRecords, string AccessRange, string MaterialInDtlCodeEqual, string MaterialInCodeEqual, string MaterialCodeEqual, string InQtyEqual, string InPriceEqual, string InMoneyEqual, string OutQtyEqual, string MaterialNameEqual, string SpecEqual, string UnitEqual, string GroupCodeEqual, string GroupNameEqual, string GroupFullIDEqual, string GroupSortIDEqual, string InvQtyEqual, string InvMoneyEqual, string MaterialInIDEqual, string InDateRange1, string InDateRange2, string ContractCodeEqual, string InGroupCodeEqual, string InGroupNameEqual, string ProjectCodeEqual)
        {
            List <MaterialInDtlModel> models;
            MaterialInDtlQueryModel   objQueryModel = new MaterialInDtlQueryModel();

            objQueryModel.StartRecord            = StartRecord;
            objQueryModel.MaxRecords             = MaxRecords;
            objQueryModel.SortColumns            = SortColumns;
            objQueryModel.AccessRange            = AccessRange;
            objQueryModel.MaterialInDtlCodeEqual = MaterialInDtlCodeEqual;
            objQueryModel.MaterialInCodeEqual    = MaterialInCodeEqual;
            objQueryModel.MaterialCodeEqual      = MaterialCodeEqual;
            objQueryModel.InQtyEqual             = InQtyEqual;
            objQueryModel.InPriceEqual           = InPriceEqual;
            objQueryModel.InMoneyEqual           = InMoneyEqual;
            objQueryModel.OutQtyEqual            = OutQtyEqual;
            objQueryModel.MaterialNameEqual      = MaterialNameEqual;
            objQueryModel.SpecEqual         = SpecEqual;
            objQueryModel.UnitEqual         = UnitEqual;
            objQueryModel.GroupCodeEqual    = GroupCodeEqual;
            objQueryModel.GroupNameEqual    = GroupNameEqual;
            objQueryModel.GroupFullIDEqual  = GroupFullIDEqual;
            objQueryModel.GroupSortIDEqual  = GroupSortIDEqual;
            objQueryModel.InvQtyEqual       = InvQtyEqual;
            objQueryModel.InvMoneyEqual     = InvMoneyEqual;
            objQueryModel.MaterialInIDEqual = MaterialInIDEqual;
            objQueryModel.InDateRange1      = InDateRange1;
            objQueryModel.InDateRange2      = InDateRange2;
            objQueryModel.ContractCodeEqual = ContractCodeEqual;
            objQueryModel.InGroupCodeEqual  = InGroupCodeEqual;
            objQueryModel.InGroupNameEqual  = InGroupNameEqual;
            objQueryModel.ProjectCodeEqual  = ProjectCodeEqual;
            SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString());

            try
            {
                models = new MaterialInDtlBLL().GetModels(objQueryModel, connection);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            finally
            {
                if (connection != null)
                {
                    connection.Dispose();
                }
            }
            return(models);
        }
Example #10
0
        public ProjectCostModel GetProjectCost(int Code)
        {
            ProjectCostModel model;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    model = new ProjectCostBLL().GetModel(Code, connection);
                }
                catch (Exception exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
Example #11
0
        public List <MaterialInModel> GetMaterialInList(string SortColumns, int StartRecord, int MaxRecords, string AccessRange, string MaterialInCodeEqual, string MaterialInIDEqual, string ProjectCodeEqual, string GroupCodeEqual, string InDateRange1, string InDateRange2, string InPersonEqual, string StatusEqual, string InputPersonEqual, string InputDateRange1, string InputDateRange2, string CheckPersonEqual, string CheckDateRange1, string CheckDateRange2, string ContractCodeEqual, string RemarkEqual)
        {
            List <MaterialInModel> models        = new List <MaterialInModel>();
            MaterialInQueryModel   objQueryModel = new MaterialInQueryModel();

            objQueryModel.StartRecord         = StartRecord;
            objQueryModel.MaxRecords          = MaxRecords;
            objQueryModel.SortColumns         = SortColumns;
            objQueryModel.AccessRange         = AccessRange;
            objQueryModel.MaterialInCodeEqual = MaterialInCodeEqual;
            objQueryModel.MaterialInIDEqual   = MaterialInIDEqual;
            objQueryModel.ProjectCodeEqual    = ProjectCodeEqual;
            objQueryModel.GroupCodeEqual      = GroupCodeEqual;
            objQueryModel.InDateRange1        = InDateRange1;
            objQueryModel.InDateRange2        = InDateRange2;
            objQueryModel.InPersonEqual       = InPersonEqual;
            objQueryModel.StatusEqual         = StatusEqual;
            objQueryModel.InputPersonEqual    = InputPersonEqual;
            objQueryModel.InputDateRange1     = InputDateRange1;
            objQueryModel.InputDateRange2     = InputDateRange2;
            objQueryModel.CheckPersonEqual    = CheckPersonEqual;
            objQueryModel.CheckDateRange1     = CheckDateRange1;
            objQueryModel.CheckDateRange2     = CheckDateRange2;
            objQueryModel.ContractCodeEqual   = ContractCodeEqual;
            objQueryModel.RemarkEqual         = RemarkEqual;
            SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString());

            try
            {
                models = new MaterialInBLL().GetModels(objQueryModel, connection);
                connection.Close();
            }
            catch (SqlException exception)
            {
                throw exception;
            }
            finally
            {
                if (connection != null)
                {
                    connection.Dispose();
                }
            }
            return(models);
        }
Example #12
0
        public static decimal GetViseSumMoney(int ViseCode)
        {
            decimal viseSumMoney = 0M;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    viseSumMoney = new LocaleViseBLL().GetViseSumMoney(ViseCode, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(viseSumMoney);
        }
Example #13
0
        public static decimal GetViseSumCheckMoneyByContract(string ContractCode)
        {
            decimal sumCheckMoneyByContract = 0M;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    sumCheckMoneyByContract = new LocaleViseBLL().GetSumCheckMoneyByContract(ContractCode, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(sumCheckMoneyByContract);
        }
Example #14
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);
        }
Example #15
0
        public static string GetViseName(int Code)
        {
            string viseName = "";

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    LocaleViseBLL ebll = new LocaleViseBLL();
                    viseName = ebll.GetModel(Code, connection).ViseName;
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(viseName);
        }
Example #16
0
        public List <ProjectCostModel> GetProjectCostListOne(int Code)
        {
            List <ProjectCostModel> list = new List <ProjectCostModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    ProjectCostBLL tbll = new ProjectCostBLL();
                    list.Add(tbll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (Exception exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Example #17
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);
        }
Example #18
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);
        }
Example #19
0
        public List <LocaleViseCostModel> GetLocalViseCosts(int Code)
        {
            List <LocaleViseCostModel> list = new List <LocaleViseCostModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    LocaleViseCostQueryModel viseCostQueryModel = new LocaleViseCostQueryModel();
                    viseCostQueryModel.ViseCode = Code;
                    list = new LocaleViseBLL().SelectCost(viseCostQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Example #20
0
        public List <MaterialInDtlModel> GetMaterialInDtlList(int MaterialInCode)
        {
            List <MaterialInDtlModel> materialInDtlListByMaterialInCode;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    materialInDtlListByMaterialInCode = new MaterialInDtlDAL(connection).GetMaterialInDtlListByMaterialInCode(MaterialInCode);
                }
                catch (Exception exception)
                {
                    throw exception;
                }
                finally
                {
                    connection.Close();
                }
            }
            return(materialInDtlListByMaterialInCode);
        }
Example #21
0
        public static List <MaterialInDtlModel> GetMaterialInDtlListByContract(string ContractCode, int MaterialCode)
        {
            List <MaterialInDtlModel> materialInDtlListByContract;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    materialInDtlListByContract = new MaterialInDtlDAL(connection).GetMaterialInDtlListByContract(ContractCode, MaterialCode);
                }
                catch (Exception exception)
                {
                    throw exception;
                }
                finally
                {
                    connection.Close();
                }
            }
            return(materialInDtlListByContract);
        }
Example #22
0
        public List <ProjectCostModel> GetProjectCostList(ProjectCostQueryModel QueryModel)
        {
            List <ProjectCostModel> models;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    if (QueryModel == null)
                    {
                        QueryModel = new ProjectCostQueryModel();
                    }
                    models = new ProjectCostBLL().GetModels(QueryModel, connection);
                }
                catch (Exception exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Example #23
0
        public List <MaterialModel> GetMaterialList(string SortColumns, int StartRecord, int MaxRecords, string AccessRange, int MaterialCodeEqual, string MaterialNameEqual, string GroupCodeEqual, string SpecEqual, string UnitEqual, string StandardPriceRange1, string StandardPriceRange2, string InputPerson, DateTime InputDateRange1, DateTime InputDateRange2, string RemarkEqual)
        {
            List <MaterialModel> models        = new List <MaterialModel>();
            MaterialQueryModel   objQueryModel = new MaterialQueryModel();

            objQueryModel.StartRecord         = StartRecord;
            objQueryModel.MaxRecords          = MaxRecords;
            objQueryModel.SortColumns         = SortColumns;
            objQueryModel.AccessRange         = AccessRange;
            objQueryModel.MaterialCodeEqual   = MaterialCodeEqual;
            objQueryModel.MaterialNameEqual   = MaterialNameEqual;
            objQueryModel.GroupCodeEqual      = GroupCodeEqual;
            objQueryModel.SpecEqual           = SpecEqual;
            objQueryModel.UnitEqual           = UnitEqual;
            objQueryModel.StandardPriceRange1 = StandardPriceRange1;
            objQueryModel.StandardPriceRange2 = StandardPriceRange2;
            objQueryModel.InputPerson         = InputPerson;
            objQueryModel.InputDateRange1     = InputDateRange1;
            objQueryModel.InputDateRange2     = InputDateRange2;
            objQueryModel.RemarkEqual         = RemarkEqual;
            SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString());

            try
            {
                models = new MaterialBLL().GetModels(objQueryModel, connection);
                connection.Close();
            }
            catch (SqlException exception)
            {
                throw exception;
            }
            finally
            {
                if (connection != null)
                {
                    connection.Dispose();
                }
            }
            return(models);
        }
Example #24
0
        public static MaterialInDtlModel GetMaterialInDtl(int Code)
        {
            MaterialInDtlModel model;
            SqlConnection      connection = new SqlConnection(FunctionRule.GetConnectionString());

            try
            {
                model = new MaterialInDtlBLL().GetModel(Code, connection);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            finally
            {
                if (connection != null)
                {
                    connection.Dispose();
                }
            }
            return(model);
        }
Example #25
0
        public List <LocaleViseModel> GetLocalVises(LocaleViseQueryModel QueryModel)
        {
            List <LocaleViseModel> list = new List <LocaleViseModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    if (QueryModel == null)
                    {
                        QueryModel = new LocaleViseQueryModel();
                    }
                    list = new LocaleViseBLL().Select(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Example #26
0
 public static void DeleteAllMaterial()
 {
     using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
     {
         connection.Open();
         SqlTransaction tran = connection.BeginTransaction();
         try
         {
             new MaterialBLL().DeleteAll(tran);
             tran.Commit();
         }
         catch (SqlException exception)
         {
             tran.Rollback();
             throw exception;
         }
         finally
         {
             connection.Close();
         }
     }
 }
Example #27
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);
        }
Example #28
0
        public List <ProjectCostModel> GetProjectCostList(string SortColumns, int StartRecord, int MaxRecords, string AccessRange, string ProjectCostCodeEqual, string ProjectNameEqual, string GroupCodeEqual, string AreaRange1, string AreaRange2, string PriceRange1, string PriceRange2, string MoneyRange1, string MoneyRange2, string QtyRange1, string QtyRange2, string UnitEqual, string InputPersonEqual, string InputDateRange1, string InputDateRange2, string RemarkEqual)
        {
            List <ProjectCostModel> models;
            ProjectCostQueryModel   objQueryModel = new ProjectCostQueryModel();

            objQueryModel.StartRecord          = StartRecord;
            objQueryModel.MaxRecords           = MaxRecords;
            objQueryModel.SortColumns          = SortColumns;
            objQueryModel.AccessRange          = AccessRange;
            objQueryModel.ProjectCostCodeEqual = ProjectCostCodeEqual;
            objQueryModel.ProjectNameEqual     = ProjectNameEqual;
            objQueryModel.GroupCodeEqual       = GroupCodeEqual;
            objQueryModel.AreaRange1           = AreaRange1;
            objQueryModel.AreaRange2           = AreaRange2;
            objQueryModel.PriceRange1          = PriceRange1;
            objQueryModel.PriceRange2          = PriceRange2;
            objQueryModel.MoneyRange1          = MoneyRange1;
            objQueryModel.MoneyRange2          = MoneyRange2;
            objQueryModel.QtyRange1            = QtyRange1;
            objQueryModel.QtyRange2            = QtyRange2;
            objQueryModel.UnitEqual            = UnitEqual;
            objQueryModel.InputPersonEqual     = InputPersonEqual;
            objQueryModel.InputDateRange1      = InputDateRange1;
            objQueryModel.InputDateRange2      = InputDateRange2;
            objQueryModel.RemarkEqual          = RemarkEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    models = new ProjectCostBLL().GetModels(objQueryModel, connection);
                }
                catch (Exception exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Example #29
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);
        }
Example #30
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);
        }