Exemplo n.º 1
0
        public List <CachetTypeManageModel> GetCachetTypeManageList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string CachetNameEqual, string TypeEqual)
        {
            List <CachetTypeManageModel> models        = new List <CachetTypeManageModel>();
            CachetTypeManageQueryModel   objQueryModel = new CachetTypeManageQueryModel();

            objQueryModel.StartRecord     = StartRecord;
            objQueryModel.MaxRecords      = MaxRecords;
            objQueryModel.SortColumns     = SortColumns;
            objQueryModel.CodeEqual       = CodeEqual;
            objQueryModel.CachetNameEqual = CachetNameEqual;
            objQueryModel.TypeEqual       = TypeEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    models = new CachetTypeManageBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Exemplo n.º 2
0
        public int Update(CachetTypeManageModel ObjModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new CachetTypeManageBLL().Update(ObjModel, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Exemplo n.º 3
0
        public CachetTypeManageModel GetCachetTypeManage(int Code)
        {
            CachetTypeManageModel model = new CachetTypeManageModel();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    model = new CachetTypeManageBLL().GetModel(Code, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
Exemplo n.º 4
0
        public List <CachetTypeManageModel> GetCachetTypeManageListOne(int Code)
        {
            List <CachetTypeManageModel> list = new List <CachetTypeManageModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    CachetTypeManageBLL ebll = new CachetTypeManageBLL();
                    list.Add(ebll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Exemplo n.º 5
0
        public List <CachetTypeManageModel> GetCachetTypeManageList(CachetTypeManageQueryModel QueryModel)
        {
            List <CachetTypeManageModel> models = new List <CachetTypeManageModel>();

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