Example #1
0
        public int Delete(TC_OA_PurchasePriceModel ObjModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new TC_OA_PurchasePriceBLL().Delete(ObjModel.Code, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Example #2
0
        public List <TC_OA_PurchasePriceModel> GetTC_OA_PurchasePriceList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string UserCodeEqual, string UnitCodeEqual, DateTime ApplayDateEqual, string NameEqual, string UseWayEqual, string TypeEqual, string SuggestEqual, int AuditingEqual)
        {
            List <TC_OA_PurchasePriceModel> models        = new List <TC_OA_PurchasePriceModel>();
            TC_OA_PurchasePriceQueryModel   objQueryModel = new TC_OA_PurchasePriceQueryModel();

            objQueryModel.StartRecord     = StartRecord;
            objQueryModel.MaxRecords      = MaxRecords;
            objQueryModel.SortColumns     = SortColumns;
            objQueryModel.CodeEqual       = CodeEqual;
            objQueryModel.UserCodeEqual   = UserCodeEqual;
            objQueryModel.UnitCodeEqual   = UnitCodeEqual;
            objQueryModel.ApplayDateEqual = ApplayDateEqual;
            objQueryModel.NameEqual       = NameEqual;
            objQueryModel.UseWayEqual     = UseWayEqual;
            objQueryModel.TypeEqual       = TypeEqual;
            objQueryModel.SuggestEqual    = SuggestEqual;
            objQueryModel.AuditingEqual   = AuditingEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    models = new TC_OA_PurchasePriceBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Example #3
0
        public TC_OA_PurchasePriceModel GetTC_OA_PurchasePrice(int Code)
        {
            TC_OA_PurchasePriceModel model = new TC_OA_PurchasePriceModel();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    model = new TC_OA_PurchasePriceBLL().GetModel(Code, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
Example #4
0
        public List <TC_OA_PurchasePriceModel> GetTC_OA_PurchasePriceListOne(int Code)
        {
            List <TC_OA_PurchasePriceModel> list = new List <TC_OA_PurchasePriceModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    TC_OA_PurchasePriceBLL ebll = new TC_OA_PurchasePriceBLL();
                    list.Add(ebll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Example #5
0
        public List <TC_OA_PurchasePriceModel> GetTC_OA_PurchasePriceList(TC_OA_PurchasePriceQueryModel QueryModel)
        {
            List <TC_OA_PurchasePriceModel> models = new List <TC_OA_PurchasePriceModel>();

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