public JsonResult GetChildUsers() { try { DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo(); DataControl.BLMessaging objMsg = new DataControl.BLMessaging(); DataControl.JSONConverter objJson = new DataControl.JSONConverter(); List <MVCModels.HiDoctor_Master.UserModel> lstUser = new List <MVCModels.HiDoctor_Master.UserModel>(); lstUser = (List <MVCModels.HiDoctor_Master.UserModel>)objMsg.GetUsersForMessaging(objCurInfo.GetCompanyCode(), objCurInfo.GetUserCode()); return(Json(lstUser)); } catch { throw; } }
public LargeJsonResult GetMessageToCCDetail(string msgCode) { try { List <MVCModels.MessagingModel> lstAllMsg = new List <MVCModels.MessagingModel>(); List <MVCModels.MessagingModel> lstMsg = new List <MVCModels.MessagingModel>(); StringBuilder sbTbl = new StringBuilder(); DataControl.BLMessaging objMsg = new DataControl.BLMessaging(); lstAllMsg = (List <MVCModels.MessagingModel>)objMsg.GetSelectedMsgDetails(objCurr.GetCompanyCode(), msgCode, objCurr.GetUserCode()).ToList(); List <MVCModels.HiDoctor_Master.UserModel> lstUser = new List <MVCModels.HiDoctor_Master.UserModel>(); lstUser = (List <MVCModels.HiDoctor_Master.UserModel>)objMsg.GetUsersForMessaging(objCurr.GetCompanyCode(), objCurr.GetUserCode()); foreach (MVCModels.MessagingModel userMsg in lstAllMsg) { IEnumerable <MVCModels.HiDoctor_Master.UserModel> lstModel = lstUser.Where(c => c.User_Code == userMsg.Target_Address); if (lstModel.ToList().Count > 0) { lstMsg.Add(userMsg); } } //var a = (from msgUser in lstAllMsg // join user in lstUser on msgUser.Target_Address equals user.User_Code // where msgUser.Target_Address != user.User_Code // select (msgUser)); //lstAllMsg = a.ToList(); return(new LargeJsonResult { MaxJsonLength = Int32.MaxValue, JsonRequestBehavior = JsonRequestBehavior.AllowGet, Data = new { total = lstMsg.Count, data = lstMsg } }); } catch (Exception ex) { Dictionary <string, string> dicObj = new Dictionary <string, string>(); dicObj.Add("msgCode", msgCode); ExceptionHandler.WriteLog(ex: ex, dic: dicObj); return(null); } }
/// <summary> /// Get the child users /// </summary> /// <returns>returns the child users in th form of json </returns> public JsonResult GetChildUsers(string UserCode = "") { DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo(); DataControl.BLMessaging objMsg = new DataControl.BLMessaging(); DataControl.JSONConverter objJson = new DataControl.JSONConverter(); List <MVCModels.HiDoctor_Master.UserModel> lstUser = new List <MVCModels.HiDoctor_Master.UserModel>(); if (string.IsNullOrEmpty(UserCode)) { UserCode = objCurInfo.GetUserCode(); } lstUser = (List <MVCModels.HiDoctor_Master.UserModel>)objMsg.GetUsersForMessaging(objCurInfo.GetCompanyCode(), UserCode); string msgStartingUserType = string.Empty; return(Json(objJson.Serialize(lstUser))); }