Exemple #1
0
        public int Delete(TC_PaymentSumModel ObjModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new TC_PaymentSumBLL().Delete(ObjModel.Code, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Exemple #2
0
        public List <TC_PaymentSumModel> GetTC_PaymentSumList(string SortColumns, int StartRecord, int MaxRecords, string CollectBillCodeEqual, string SendUnitCodeEqual, DateTime AuditDateTimeStartEqual, DateTime AuditDateTimeEndEqual, string StatusEqual)
        {
            List <TC_PaymentSumModel> models        = new List <TC_PaymentSumModel>();
            TC_PaymentSumQueryModel   objQueryModel = new TC_PaymentSumQueryModel();

            objQueryModel.StartRecord             = StartRecord;
            objQueryModel.MaxRecords              = MaxRecords;
            objQueryModel.SortColumns             = SortColumns;
            objQueryModel.CollectBillCodeEqual    = CollectBillCodeEqual;
            objQueryModel.SendUnitCodeEqual       = SendUnitCodeEqual;
            objQueryModel.AuditDateTimeStartEqual = AuditDateTimeStartEqual;
            objQueryModel.AuditDateTimeEndEqual   = AuditDateTimeEndEqual;
            objQueryModel.StatusEqual             = StatusEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    models = new TC_PaymentSumBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Exemple #3
0
        public TC_PaymentSumModel GetTC_PaymentSum(int Code)
        {
            TC_PaymentSumModel model = new TC_PaymentSumModel();

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

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    TC_PaymentSumBLL mbll = new TC_PaymentSumBLL();
                    list.Add(mbll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Exemple #5
0
        public List <TC_PaymentSumModel> GetTC_PaymentSumList(TC_PaymentSumQueryModel QueryModel)
        {
            List <TC_PaymentSumModel> models = new List <TC_PaymentSumModel>();

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