Beispiel #1
0
        public int Delete(InquirePriceModel ObjModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new InquirePriceBLL().Delete(ObjModel.InquirePriceCode, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Beispiel #2
0
        public List <InquirePriceModel> GetInquirePriceList(string SortColumns, int StartRecord, int MaxRecords, int InquirePriceCodeEqual, string ProjectNameEqual, string InquireObjectEqual, string RequirementEqual, int AduitingEqual, string Field1Equal)
        {
            List <InquirePriceModel> models        = new List <InquirePriceModel>();
            InquirePriceQueryModel   objQueryModel = new InquirePriceQueryModel();

            objQueryModel.StartRecord           = StartRecord;
            objQueryModel.MaxRecords            = MaxRecords;
            objQueryModel.SortColumns           = SortColumns;
            objQueryModel.InquirePriceCodeEqual = InquirePriceCodeEqual;
            objQueryModel.ProjectNameEqual      = ProjectNameEqual;
            objQueryModel.InquireObjectEqual    = InquireObjectEqual;
            objQueryModel.RequirementEqual      = RequirementEqual;
            objQueryModel.AduitingEqual         = AduitingEqual;
            objQueryModel.Field1Equal           = Field1Equal;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    models = new InquirePriceBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Beispiel #3
0
        public int ModifyPassAuditing(int Code)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new InquirePriceBLL().ModifyPassAuditing(Code, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Beispiel #4
0
        public InquirePriceModel GetInquirePrice(int Code)
        {
            InquirePriceModel model = new InquirePriceModel();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    model = new InquirePriceBLL().GetModel(Code, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
Beispiel #5
0
        public List <InquirePriceModel> GetInquirePriceListOne(int Code)
        {
            List <InquirePriceModel> list = new List <InquirePriceModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    InquirePriceBLL ebll = new InquirePriceBLL();
                    list.Add(ebll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Beispiel #6
0
        public List <InquirePriceModel> GetInquirePriceList(InquirePriceQueryModel QueryModel)
        {
            List <InquirePriceModel> models = new List <InquirePriceModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    if (QueryModel == null)
                    {
                        QueryModel = new InquirePriceQueryModel();
                    }
                    models = new InquirePriceBLL().GetModels(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }