示例#1
0
        public List <UserHelpGroupModel> GetUserHelpGroupList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string GroupNameEqual, string UserCodeEqual, DateTime CreateTimeEqual)
        {
            List <UserHelpGroupModel> models        = new List <UserHelpGroupModel>();
            UserHelpGroupQueryModel   objQueryModel = new UserHelpGroupQueryModel();

            objQueryModel.StartRecord     = StartRecord;
            objQueryModel.MaxRecords      = MaxRecords;
            objQueryModel.SortColumns     = SortColumns;
            objQueryModel.CodeEqual       = CodeEqual;
            objQueryModel.GroupNameEqual  = GroupNameEqual;
            objQueryModel.UserCodeEqual   = UserCodeEqual;
            objQueryModel.CreateTimeEqual = CreateTimeEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    models = new UserHelpGroupBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
示例#2
0
        public int Update(UserHelpGroupModel ObjModel)
        {
            int num = 0;

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

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    model = new UserHelpGroupBLL().GetModel(Code, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
示例#4
0
        public List <UserHelpGroupModel> GetUserHelpGroupListOne(int Code)
        {
            List <UserHelpGroupModel> list = new List <UserHelpGroupModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    UserHelpGroupBLL pbll = new UserHelpGroupBLL();
                    list.Add(pbll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
示例#5
0
        public List <UserHelpGroupModel> GetUserHelpGroupList(UserHelpGroupQueryModel QueryModel)
        {
            List <UserHelpGroupModel> models = new List <UserHelpGroupModel>();

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