public JsonResult GroupList(GroupListParame parame) { PublicUserModel loginUser = this.GetLoginUser(); int totalSize = 0; parame.UserId = loginUser.UserID; List <GroupModel> groupList = groupBll.GroupList(parame, ref totalSize); return(Json(groupList, JsonRequestBehavior.AllowGet)); }
public virtual List <GroupModel> MyGroupList(GroupListParame parame, ref int totalSize) { DbCommand cmd = GetStoredProcCommand("P_Group_MyList"); AddInParameter(cmd, "@UserId", DbType.Int32, parame.UserId); AddInParameter(cmd, "@Status", DbType.Int32, parame.Status); DataSet ds = ExecuteDataSet(cmd); List <GroupModel> groupList = new List <GroupModel>(); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { groupList = BuildGroupModelToList(ds.Tables[0].Select()); } return(groupList); }
public virtual List <GroupModel> GroupList(GroupListParame parame, ref int totalSize) { if (parame.SearchType == 0) { return(groupDal.GroupList(parame, ref totalSize)); } else if (parame.SearchType == 1) { return(groupDal.GroupListByLetter(parame, ref totalSize)); } else if (parame.SearchType == 2) { return(groupDal.MyGroupList(parame, ref totalSize)); } return(groupDal.GroupList(parame, ref totalSize)); }
public virtual List <GroupModel> GroupListByLetter(GroupListParame parame, ref int totalSize) { DbCommand cmd = GetStoredProcCommand("P_Group_ListByLetter"); AddInParameter(cmd, "@UserId", DbType.Int32, parame.UserId); AddInParameter(cmd, "@Keyword", DbType.String, parame.KeyWord); AddInParameter(cmd, "@PageSize", DbType.Int32, parame.PageSize); AddInParameter(cmd, "@LastId", DbType.Int32, parame.LastId); AddOutParameter(cmd, "@TotalSize", DbType.Int32, 4); DataSet ds = ExecuteDataSet(cmd); int.TryParse(cmd.Parameters["@TotalSize"].Value.ToString(), out totalSize); List <GroupModel> groupList = new List <GroupModel>(); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { groupList = BuildGroupModelToList(ds.Tables[0].Select()); } return(groupList); }