Beispiel #1
0
        public List <CachetManageModel> GetCachetManageList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string UserNameEqual, string DeptEqual, string CachetNameEqual, DateTime StartDataEqual, DateTime EndDataEqual, string StateEqual, string TypeEqual)
        {
            List <CachetManageModel> models        = new List <CachetManageModel>();
            CachetManageQueryModel   objQueryModel = new CachetManageQueryModel();

            objQueryModel.StartRecord     = StartRecord;
            objQueryModel.MaxRecords      = MaxRecords;
            objQueryModel.SortColumns     = SortColumns;
            objQueryModel.CodeEqual       = CodeEqual;
            objQueryModel.UserNameEqual   = UserNameEqual;
            objQueryModel.DeptEqual       = DeptEqual;
            objQueryModel.CachetNameEqual = CachetNameEqual;
            objQueryModel.StartDataEqual  = StartDataEqual;
            objQueryModel.EndDataEqual    = EndDataEqual;
            objQueryModel.StateEqual      = StateEqual;
            objQueryModel.TypeEqual       = TypeEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    models = new CachetManageBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Beispiel #2
0
        public int Update(CachetManageModel ObjModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new CachetManageBLL().Update(ObjModel, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Beispiel #3
0
        public CachetManageModel GetCachetManage(int Code)
        {
            CachetManageModel model = new CachetManageModel();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    model = new CachetManageBLL().GetModel(Code, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
Beispiel #4
0
        public List <CachetManageModel> GetCachetManageListOne(int Code)
        {
            List <CachetManageModel> list = new List <CachetManageModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    CachetManageBLL ebll = new CachetManageBLL();
                    list.Add(ebll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Beispiel #5
0
        public List <CachetManageModel> GetCachetManageList(CachetManageQueryModel QueryModel)
        {
            List <CachetManageModel> models = new List <CachetManageModel>();

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