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

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new TCheckPaymentSumBLL().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 <TCheckPaymentSumModel> GetTCheckPaymentSumList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string SendUnitEqual, DateTime SumDateEqual, string AuditingEqual)
        {
            List <TCheckPaymentSumModel> models        = new List <TCheckPaymentSumModel>();
            TCheckPaymentSumQueryModel   objQueryModel = new TCheckPaymentSumQueryModel();

            objQueryModel.StartRecord   = StartRecord;
            objQueryModel.MaxRecords    = MaxRecords;
            objQueryModel.SortColumns   = SortColumns;
            objQueryModel.CodeEqual     = CodeEqual;
            objQueryModel.SendUnitEqual = SendUnitEqual;
            objQueryModel.SumDateEqual  = SumDateEqual;
            objQueryModel.AuditingEqual = AuditingEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    models = new TCheckPaymentSumBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Exemple #3
0
        public TCheckPaymentSumModel GetTCheckPaymentSum(int Code)
        {
            TCheckPaymentSumModel model = new TCheckPaymentSumModel();

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

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

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