public int Delete(TC_OA_LingYongMenonySumModel ObjModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new TC_OA_LingYongMenonySumBLL().Delete(ObjModel.Code, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
        public List <TC_OA_LingYongMenonySumModel> GetTC_OA_LingYongMenonySumList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string SendUnitEqual, DateTime SumDateEqual, int AuditingEqual)
        {
            List <TC_OA_LingYongMenonySumModel> models        = new List <TC_OA_LingYongMenonySumModel>();
            TC_OA_LingYongMenonySumQueryModel   objQueryModel = new TC_OA_LingYongMenonySumQueryModel();

            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 TC_OA_LingYongMenonySumBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
        public TC_OA_LingYongMenonySumModel GetTC_OA_LingYongMenonySum(int Code)
        {
            TC_OA_LingYongMenonySumModel model = new TC_OA_LingYongMenonySumModel();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    model = new TC_OA_LingYongMenonySumBLL().GetModel(Code, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
        public List <TC_OA_LingYongMenonySumModel> GetTC_OA_LingYongMenonySumListOne(int Code)
        {
            List <TC_OA_LingYongMenonySumModel> list = new List <TC_OA_LingYongMenonySumModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    TC_OA_LingYongMenonySumBLL mbll = new TC_OA_LingYongMenonySumBLL();
                    list.Add(mbll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
        public List <TC_OA_LingYongMenonySumModel> GetTC_OA_LingYongMenonySumList(TC_OA_LingYongMenonySumQueryModel QueryModel)
        {
            List <TC_OA_LingYongMenonySumModel> models = new List <TC_OA_LingYongMenonySumModel>();

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