public ActionResult UserCreate(string Id) { string eMsg = SiteMainMenuList("User Details", "Settings", "UserList"); if (!string.IsNullOrEmpty(eMsg)) { return(RedirectToOut(eMsg)); } //else if (!SiteUserAccess("", "V")) return RedirectToOut(); ViewBag.ListUserRole = List_UserRole(); ViewBag.GenderList = List_Gender(); ViewBag.UserTypeList = List_UserType(); SelectListItem OnTop = new SelectListItem() { Text = "Select...", Value = "" }; ViewBag.ListUserRole.Insert(0, OnTop); HcUsersEntity obj = new HcUsersEntity(); obj.Gender = "Male"; if (!string.IsNullOrEmpty(Id)) { obj = (HcUsersEntity)ExecuteDB(HCareTaks.AG_GetSingleHcUsersRecordById, Id); if (obj == null) { obj = new HcUsersEntity(); } } return(View(obj)); }
public ActionResult LogForgotPassword(HcUsersEntity iGet) { if (string.IsNullOrEmpty(iGet.Logname) || string.IsNullOrEmpty(iGet.SecurPass) || string.IsNullOrEmpty(iGet.Logpass) || string.IsNullOrEmpty(iGet.ConfirmPass)) { ViewBag.FPMessage = "Sorry, Please Check Required Fields."; } else if (string.IsNullOrEmpty(iGet.Logpass) != string.IsNullOrEmpty(iGet.ConfirmPass)) { ViewBag.FPMessage = "Sorry, Please Check Passwords."; } else { HcUsersEntity obj = new HcUsersEntity(); obj.Logname = iGet.Logname; obj.SecurPass = iGet.SecurPass; DataTable dt = (DataTable)ExecuteDB(HCareTaks.AG_GetAllHcUsersRecord, obj); if (dt.Rows.Count == 0) { ViewBag.FPMessage = "Sorry, You are not Registered."; } else if (dt.Rows[0]["IsActive"].ToString() == "Inactive") { ViewBag.FPMessage = "Sorry, You are Inactiveted."; } else { obj.QueryFlag = "LogPass"; obj.Logpass = iGet.Logpass; obj.Id = dt.Rows[0]["ID"].ToString(); bool Success = (bool)ExecuteDB(HCareTaks.AG_UpdateHcUsersInfo, obj); ViewBag.FPMessage = Success ? "Your Password has been changed." : "Sorry something went wrong!"; } } return(View(iGet)); }
public object UpdateHcUsersInfo(object param) { Database db = DatabaseFactory.CreateDatabase(); object retObj = null; using (DbConnection connection = db.CreateConnection()) { connection.Open(); DbTransaction transaction = connection.BeginTransaction(); try { HcUsersEntity hcUsersEntity = (HcUsersEntity)param; HcUsersDAL hcUsersDAL = new HcUsersDAL(); retObj = (object)hcUsersDAL.UpdateHcUsersInfo(hcUsersEntity, db, transaction); transaction.Commit(); } catch { transaction.Rollback(); throw; } finally { connection.Close(); } } return(retObj); }
public ActionResult LogRegistration() { ViewBag.GenderList = List_Gender(); HcUsersEntity obj = new HcUsersEntity(); obj.Gender = "Male"; return(View(obj)); }
public ActionResult Login(SiteInfo obj) { if (string.IsNullOrEmpty(obj.LoginUser)) { ViewBag.LogedMessage = "Sorry, Empty Username"; } else if (string.IsNullOrEmpty(obj.LoginPass)) { ViewBag.LogedMessage = "Sorry, Empty Password"; } else { HcUsersEntity uObj = new HcUsersEntity(); uObj.Isactive = "Active"; uObj.Logname = obj.LoginUser; uObj.Logpass = obj.LoginPass; DataTable dt = (DataTable)ExecuteDB(HCareTaks.AG_GetAllHcUsersRecord, uObj); string Id = dt.Rows.Count > 0 ? dt.Rows[0]["Id"].ToString() : ""; bool Success = !string.IsNullOrEmpty(Id) ? fnUserInfoSession(Id) : false; //................................................. Set Demo Sessions if (!Success) { Success = true; Session["UserId"] = "7734E724-2181-44CD-ADC7-E3AC493ED8AB"; Session["UserName"] = "******"; Session["UserType"] = "Admin"; Session["UserRoleId"] = ""; Session["UserImage"] = "/Content/rkscript/docx/UserImage/NoImage.jpg"; Session["UserDefaultBoard"] = "Admin"; Session["UserAllDashboard"] = "Admin,Doctor,Lab,Shop"; } if (Success && Session["UserType"].ToString() == "Admin") { return(RedirectToAction("AdminDashboard", "AdmHome")); } else if (Success && Session["UserRoleId"] != null) { return(RedirectToAction("Dashboard", "AdmHome")); } else if (Success) { return(RedirectToAction("MyBoard", "WebAccount")); } else { ViewBag.LogedMessage = "Sorry something went wrong!"; } } return(View()); }
public JsonResult UserSaveUpdate(HcUsersEntity obj) { bool Success = false; string Message = "Sorry something went wrong!"; bool Mail = !string.IsNullOrEmpty(obj.Email) ? RkIsEmailValid(obj.Email) : true; if (!string.IsNullOrEmpty(obj.Logname) && !string.IsNullOrEmpty(obj.Logpass) && !string.IsNullOrEmpty(obj.FirstName) && Mail) { HcUsersEntity iGet = new HcUsersEntity(); iGet.Logname = obj.Logname; DataTable dt = (DataTable)ExecuteDB(HCareTaks.AG_GetAllHcUsersRecord, iGet); if (dt.Rows.Count > 0 && (string.IsNullOrEmpty(obj.Id) || (obj.Id.ToLower() != dt.Rows[0]["ID"].ToString().ToLower()))) { Message = "Sorry, You are already Registered."; } else { if (string.IsNullOrEmpty(obj.Isactive)) { obj.Isactive = "Active"; } if (string.IsNullOrEmpty(obj.Id)) { obj.Createdby = Session["UserId"].ToString(); obj.Createdtime = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"); obj.Id = (string)ExecuteDB(HCareTaks.AG_SaveHcUsersInfo, obj); if (!string.IsNullOrEmpty(obj.Id)) { Success = true; } } else { obj.Updatedby = Session["UserId"].ToString(); obj.Updatedtime = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"); Success = (bool)ExecuteDB(HCareTaks.AG_UpdateHcUsersInfo, obj); } } } else { Message = "Sorry, Validation Error!"; } if (Success) { Message = "Process has been done successfully"; } return(Json(new { Success = Success, Message = Message, Id = obj.Id })); }
public JsonResult UserDeleteById(string Id) { bool Success = false; HcUsersEntity obj = (HcUsersEntity)ExecuteDB(HCareTaks.AG_GetSingleHcUsersRecordById, Id); if (obj != null) { obj.Updatedby = Session["UserId"].ToString(); obj.Updatedtime = DateTime.Now.ToString("dd/MM/yyyy"); obj.Isactive = "Inactive"; Success = (bool)ExecuteDB(HCareTaks.AG_UpdateHcUsersInfo, obj); } string Message = Success ? "Delete Success" : "Sorry something went wrong!"; return(Json(new { Success = Success, Message = Message })); }
string UserListTableData() { string TableData = ""; HcUsersEntity obj = new HcUsersEntity(); DataTable dt = (DataTable)ExecuteDB(HCareTaks.AG_GetAllHcUsersRecord, obj); int Count = 1; foreach (DataRow dr in dt.Rows) { string Action = "<i class='mdi mdi-table-edit iAction' title='Edit This' onclick=\"EditDetails('" + dr["ID"].ToString() + "')\" style='color:orange'></i>"; Action += "<i class='mdi mdi-close-box iAction' title='Inactive This' onclick=\"DeleteDetails('" + dr["ID"].ToString() + "', this)\" style='color:red'></i>"; TableData += "<tr>" + "<td>" + dr["LogName"] + "</td>" + "<td>" + dr["SecurPass"] + "</td>" + "<td>" + dr["FirstName"] + "</td>" + "<td>" + dr["LastName"] + "</td>" + "<td>" + dr["Email"] + "</td>" + "<td>" + dr["Gender"] + "</td>" + "<td>" + dr["UserType"] + "</td>" + "<td class='IsActive'>" + dr["IsActive"] + "</td>" + "<td>" + Action + "</td>" + "</tr>"; Count += 1; } string CreateBtn = "<button class='btn btn-primary' type='button' onclick='CreateDetails()' style='margin-bottom:10px;'> New</button>"; string tHead = "<tr>" + "<th>UserId</th>" + "<th>SecurPass</th>" + "<th>First Name</th>" + "<th>Last Name</th>" + "<th>Email</th>" + "<th>Gender</th>" + "<th>UserType</th>" + "<th>IsActive</th>" + "<th>Action</th>" + "</tr>"; TableData = CreateBtn + "<div class='table-responsive'><table id='zero_config' class='table table-striped table-bordered'>" + "<thead>" + tHead + "</thead><tbody>" + TableData + "</tbody></table></div>"; return(TableData); }
public ActionResult LogRegistration(HcUsersEntity iGet) { ViewBag.GenderList = List_Gender(); bool Mail = !string.IsNullOrEmpty(iGet.Email) ? RkIsEmailValid(iGet.Email) : true; if (string.IsNullOrEmpty(iGet.Logname) || string.IsNullOrEmpty(iGet.SecurPass) || string.IsNullOrEmpty(iGet.Logpass) || string.IsNullOrEmpty(iGet.ConfirmPass) || string.IsNullOrEmpty(iGet.FirstName)) { ViewBag.FPMessage = "Sorry, Please Check Required Fields."; } else if (string.IsNullOrEmpty(iGet.Logpass) != string.IsNullOrEmpty(iGet.ConfirmPass)) { ViewBag.FPMessage = "Sorry, Please Check Passwords."; } else if (!Mail) { ViewBag.FPMessage = "Sorry, Please Check Your Email Address."; } else { HcUsersEntity obj = new HcUsersEntity(); obj.Logname = iGet.Logname; DataTable dt = (DataTable)ExecuteDB(HCareTaks.AG_GetAllHcUsersRecord, obj); if (dt.Rows.Count > 0) { ViewBag.FPMessage = "Sorry, You are already Registered."; } else { obj.Logpass = iGet.Logpass; obj.SecurPass = DateFormatWebToDb(iGet.SecurPass); obj.Email = iGet.Email; obj.FirstName = iGet.FirstName; obj.LastName = iGet.LastName; obj.Gender = iGet.Gender; obj.Address = iGet.Address; obj.Usertype = "Patient"; obj.Isactive = "Active"; obj.Createdtime = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"); obj.Id = (string)ExecuteDB(HCareTaks.AG_SaveHcUsersInfo, obj); ViewBag.FPMessage = !string.IsNullOrEmpty(obj.Id) ? "Your Registration has been completed. <a href='/WebAccount/Login' class='text-warning'>Login</a>" : "Sorry something went wrong!"; } } return(View(iGet)); }
public bool UpdateHcUsersInfo(HcUsersEntity hcUsersEntity, Database db, DbTransaction transaction) { string sql = "UPDATE HC_Users SET LogName= @Logname, LogPass= @Logpass, userImageUrl=@userImageUrl, SecurPass= @SecurPass, Email= @Email, FirstName= @FirstName, LastName= @LastName, Gender= @Gender, Address= @Address, UserType= @Usertype, UserID= @Userid, RoleID= @Roleid, IsActive= @Isactive, UpdatedBy= @Updatedby, UpdatedTime= @Updatedtime WHERE Id=@Id"; if (hcUsersEntity.QueryFlag == "LastLogIn") { sql = "UPDATE HC_Users SET LastLogIn= @Lastlogin WHERE Id=@Id"; } else if (hcUsersEntity.QueryFlag == "LogPass") { sql = "UPDATE HC_Users SET LogPass= @Logpass WHERE Id=@Id"; } DbCommand dbCommand = db.GetSqlStringCommand(sql); db.AddInParameter(dbCommand, "Id", DbType.String, hcUsersEntity.Id); db.AddInParameter(dbCommand, "Logname", DbType.String, hcUsersEntity.Logname); db.AddInParameter(dbCommand, "Logpass", DbType.String, hcUsersEntity.Logpass); db.AddInParameter(dbCommand, "SecurPass", DbType.String, hcUsersEntity.SecurPass); db.AddInParameter(dbCommand, "Email", DbType.String, hcUsersEntity.Email); db.AddInParameter(dbCommand, "FirstName", DbType.String, hcUsersEntity.FirstName); db.AddInParameter(dbCommand, "LastName", DbType.String, hcUsersEntity.LastName); db.AddInParameter(dbCommand, "Gender", DbType.String, hcUsersEntity.Gender); db.AddInParameter(dbCommand, "Address", DbType.String, hcUsersEntity.Address); db.AddInParameter(dbCommand, "Usertype", DbType.String, hcUsersEntity.Usertype); db.AddInParameter(dbCommand, "Userid", DbType.String, hcUsersEntity.Userid); db.AddInParameter(dbCommand, "Roleid", DbType.String, hcUsersEntity.Roleid); db.AddInParameter(dbCommand, "Isactive", DbType.String, hcUsersEntity.Isactive); db.AddInParameter(dbCommand, "Updatedby", DbType.String, hcUsersEntity.Updatedby); db.AddInParameter(dbCommand, "Updatedtime", DbType.String, hcUsersEntity.Updatedtime); db.AddInParameter(dbCommand, "Lastlogin", DbType.String, hcUsersEntity.Lastlogin); db.AddInParameter(dbCommand, "userImageUrl", DbType.String, hcUsersEntity.Lastlogin); db.ExecuteNonQuery(dbCommand, transaction); return(true); }
public object SaveHcUsersInfo(HcUsersEntity hcUsersEntity, Database db, DbTransaction transaction) { string sql = "INSERT INTO HC_Users ( LogName, LogPass, SecurPass, Email, FirstName, LastName, Gender, Address, UserType, UserID, RoleID, IsActive, CreatedBy, CreatedTime ) output inserted.ID VALUES ( @Logname, @Logpass, @SecurPass, @Email, @FirstName, @LastName, @Gender, @Address, @Usertype, @Userid, @Roleid, @Isactive, @Createdby, @Createdtime )"; DbCommand dbCommand = db.GetSqlStringCommand(sql); db.AddInParameter(dbCommand, "Logname", DbType.String, hcUsersEntity.Logname); db.AddInParameter(dbCommand, "Logpass", DbType.String, hcUsersEntity.Logpass); db.AddInParameter(dbCommand, "SecurPass", DbType.String, hcUsersEntity.SecurPass); db.AddInParameter(dbCommand, "Email", DbType.String, hcUsersEntity.Email); db.AddInParameter(dbCommand, "FirstName", DbType.String, hcUsersEntity.FirstName); db.AddInParameter(dbCommand, "LastName", DbType.String, hcUsersEntity.LastName); db.AddInParameter(dbCommand, "Gender", DbType.String, hcUsersEntity.Gender); db.AddInParameter(dbCommand, "Address", DbType.String, hcUsersEntity.Address); db.AddInParameter(dbCommand, "Usertype", DbType.String, hcUsersEntity.Usertype); db.AddInParameter(dbCommand, "Userid", DbType.String, hcUsersEntity.Userid); db.AddInParameter(dbCommand, "Roleid", DbType.String, hcUsersEntity.Roleid); db.AddInParameter(dbCommand, "Isactive", DbType.String, hcUsersEntity.Isactive); db.AddInParameter(dbCommand, "Createdby", DbType.String, hcUsersEntity.Createdby); db.AddInParameter(dbCommand, "Createdtime", DbType.String, hcUsersEntity.Createdtime); var id = db.ExecuteScalar(dbCommand, transaction).ToString(); return(id); }
public DataTable GetAllHcUsersRecord(object param) { Database db = DatabaseFactory.CreateDatabase(); string sql = @"SELECT ID, userImageUrl, LogName, LogPass, SecurPass, Email, FirstName, LastName, Gender, Address, UserType, UserID, RoleID, IsActive, CreatedBy, CreatedTime, UpdatedBy, UpdatedTime, LastLogIn , 'User Name' UserName FROM HC_Users Where 1=1"; HcUsersEntity obj = new HcUsersEntity(); if (param != null) { obj = (HcUsersEntity)param; } if (!string.IsNullOrEmpty(obj.Logname)) { sql += " And LogName = '" + obj.Logname + "'"; } if (!string.IsNullOrEmpty(obj.Logpass)) { sql += " And LogPass = '******'"; } if (!string.IsNullOrEmpty(obj.SecurPass)) { sql += " And SecurPass = '******'"; } if (!string.IsNullOrEmpty(obj.Isactive)) { sql += " And IsActive = '" + obj.Isactive + "'"; } sql += " Order By LogName Asc"; DbCommand dbCommand = db.GetSqlStringCommand(sql); DataSet ds = db.ExecuteDataSet(dbCommand); return(ds.Tables[0]); }
public HcUsersEntity GetSingleHcUsersRecordById(object param) { Database db = DatabaseFactory.CreateDatabase(); string sql = "SELECT ID, LogName, LogPass, SecurPass, Email, FirstName, LastName, Gender, Address, UserType, UserID, RoleID, IsActive, CreatedBy, CreatedTime, UpdatedBy, UpdatedTime, LastLogIn FROM HC_Users WHERE Id=@Id"; DbCommand dbCommand = db.GetSqlStringCommand(sql); db.AddInParameter(dbCommand, "Id", DbType.String, param); HcUsersEntity hcUsersEntity = null; using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { if (dataReader.Read()) { hcUsersEntity = new HcUsersEntity(); if (dataReader["ID"] != DBNull.Value) { hcUsersEntity.Id = dataReader["ID"].ToString(); } if (dataReader["LogName"] != DBNull.Value) { hcUsersEntity.Logname = dataReader["LogName"].ToString(); } if (dataReader["LogPass"] != DBNull.Value) { hcUsersEntity.Logpass = dataReader["LogPass"].ToString(); } if (dataReader["SecurPass"] != DBNull.Value) { hcUsersEntity.SecurPass = dataReader["SecurPass"].ToString(); } if (dataReader["Email"] != DBNull.Value) { hcUsersEntity.Email = dataReader["Email"].ToString(); } if (dataReader["FirstName"] != DBNull.Value) { hcUsersEntity.FirstName = dataReader["FirstName"].ToString(); } if (dataReader["LastName"] != DBNull.Value) { hcUsersEntity.LastName = dataReader["LastName"].ToString(); } if (dataReader["Gender"] != DBNull.Value) { hcUsersEntity.Gender = dataReader["Gender"].ToString(); } if (dataReader["Address"] != DBNull.Value) { hcUsersEntity.Address = dataReader["Address"].ToString(); } if (dataReader["UserType"] != DBNull.Value) { hcUsersEntity.Usertype = dataReader["UserType"].ToString(); } if (dataReader["UserID"] != DBNull.Value) { hcUsersEntity.Userid = dataReader["UserID"].ToString(); } if (dataReader["RoleID"] != DBNull.Value) { hcUsersEntity.Roleid = dataReader["RoleID"].ToString(); } if (dataReader["IsActive"] != DBNull.Value) { hcUsersEntity.Isactive = dataReader["IsActive"].ToString(); } if (dataReader["CreatedBy"] != DBNull.Value) { hcUsersEntity.Createdby = dataReader["CreatedBy"].ToString(); } if (dataReader["CreatedTime"] != DBNull.Value) { hcUsersEntity.Createdtime = dataReader["CreatedTime"].ToString(); } if (dataReader["UpdatedBy"] != DBNull.Value) { hcUsersEntity.Updatedby = dataReader["UpdatedBy"].ToString(); } if (dataReader["UpdatedTime"] != DBNull.Value) { hcUsersEntity.Updatedtime = dataReader["UpdatedTime"].ToString(); } if (dataReader["LastLogIn"] != DBNull.Value) { hcUsersEntity.Lastlogin = dataReader["LastLogIn"].ToString(); } } } return(hcUsersEntity); }
public string SiteMainMenuList(string cPageHead = "", string cController = "", string cAction = "") { string ErrorMsg = ""; ViewBag.SitePageHead = cPageHead; bool IsActive = false; if (Session["UserId"] != null) { HcUsersEntity obj = (HcUsersEntity)ExecuteDB(HCareTaks.AG_GetSingleHcUsersRecordById, Session["UserId"].ToString()); if (obj != null && obj.Isactive == "Active") { IsActive = true; } } if (!IsActive || Session["UserType"].ToString() == "Patient" || (Session["UserType"].ToString() != "Admin" && Session["UserRoleId"] == null)) { ErrorMsg = "Sorry, Authentication Error!"; } else { bool IsAdmin = Session["UserType"].ToString() == "Admin" ? true : false; List <AdmRoledetailsEntity> rDetl = new List <AdmRoledetailsEntity>(); if (!IsAdmin) { AdmRoledetailsEntity obj = new AdmRoledetailsEntity(); obj.Roleid = Session["UserRoleId"].ToString(); obj.Isview = "checked"; obj.Isactive = "Active"; DataTable aDt = (DataTable)ExecuteDB(HCareTaks.AG_GetAllAdmRoledetailsRecord, obj); foreach (DataRow dr in aDt.Rows) { rDetl.Add(new AdmRoledetailsEntity { Featureid = dr["FeatureId"].ToString(), Isview = dr["IsView"].ToString(), Isadd = dr["IsAdd"].ToString(), Isedit = dr["IsEdit"].ToString(), Isdelete = dr["IsDelete"].ToString() }); } } string cSelected = cPageHead.Contains("Dashboard") ? "selected" : ""; string cActive = !string.IsNullOrEmpty(cSelected) ? "active" : ""; string cIn = !string.IsNullOrEmpty(cSelected) ? "in" : ""; string SiteMenuList = "<li class='sidebar-item " + cSelected + "'> <a class='sidebar-link waves-effect waves-dark sidebar-link " + cActive + "' href='/AdmHome/Dashboard' aria-expanded='false'><i class='mdi mdi-view-dashboard'></i><span class='hide-menu'>Dashboard</span></a></li>"; //..... Get Main Menu List List <SiteInfo> MainList = SiteMainMenusList(); foreach (SiteInfo Menu in MainList) { string mID = Menu.MenuId, mIcon = Menu.MenuIcon, mName = Menu.MenuName, mUrl = Menu.MenuUrl; string[] Url = mUrl.Split(new string[] { "/" }, StringSplitOptions.None); string Controller = Url.Length > 1 ? Url[1] : "", Action = Url.Length > 2 ? Url[2] : ""; //..... Get Sub Menu List List <SiteInfo> SubList = SiteSubMenusList(mID); if (SubList.Count > 0) { string SubMenu = "", mActive = ""; foreach (SiteInfo Sub in SubList) { bool iView = IsAdmin; if (!IsAdmin && rDetl.Count > 0) { var aDr = rDetl.FirstOrDefault(m => m.Featureid.ToUpper() == Sub.MenuId.ToUpper()); if (aDr != null) { iView = true; } } if (iView) { string sID = Sub.MenuId, sName = Sub.MenuName, sIcon = Sub.MenuIcon, sUrl = Sub.MenuUrl; Url = sUrl.Split(new string[] { "/" }, StringSplitOptions.None); Controller = Url.Length > 1 ? Url[1] : ""; Action = Url.Length > 2 ? Url[2] : ""; cActive = cController == Controller && cAction == Action && string.IsNullOrEmpty(Url[0]) ? "active" : ""; if (!string.IsNullOrEmpty(cActive)) { mActive = cActive; } SubMenu += "<li class='sidebar-item " + cActive + "'><a href='" + sUrl + "' class='sidebar-link " + cActive + "'><i class='" + sIcon + "'></i><span class='hide-menu'> " + sName + " </span></a></li>"; } } if (!string.IsNullOrEmpty(SubMenu)) { cSelected = !string.IsNullOrEmpty(mActive) ? "selected" : ""; cIn = !string.IsNullOrEmpty(mActive) ? "in" : ""; SiteMenuList += "<li class='sidebar-item " + cSelected + "'> <a class='sidebar-link has-arrow waves-effect waves-dark " + mActive + "' href='javascript:void(0)' aria-expanded='false'><i class='" + mIcon + "'></i><span class='hide-menu'>" + mName + " </span></a>" + "<ul aria-expanded='false' class='collapse first-level " + cIn + "'>" + SubMenu + "</ul></li>"; } } //else //{ // cSelected = cController == Controller && cAction == Action && string.IsNullOrEmpty(Url[0]) ? "selected" : ""; // cActive = !string.IsNullOrEmpty(cSelected) ? "active" : ""; // SiteMenuList += "<li class='sidebar-item " + cSelected + "'> <a class='sidebar-link waves-effect waves-dark sidebar-link " + cActive + "' href='" + mUrl + "' aria-expanded='false'><i class='" + mIcon + "'></i><span class='hide-menu'>" + mName + "</span></a></li>"; //} } ViewBag.SiteMainMenuList = SiteMenuList; ViewBag.SiteDashboardMenuList = DashboardMenuList(); //Session["SiteMainMenuList"] = SiteMenuList; } return(ErrorMsg); }
bool fnUserInfoSession(string Id) { bool Success = false; HcUsersEntity uInfo = (HcUsersEntity)ExecuteDB(HCareTaks.AG_GetSingleHcUsersRecordById, Id); if (uInfo != null) { Success = true; string uId = uInfo.Id, uName = uInfo.FirstName + " " + uInfo.LastName, uType = uInfo.Usertype, uDetlId = uInfo.Userid, uRoleId = uInfo.Roleid, UserDefaultBoard = "", UserAllDashboard = "", UserImage = "/Content/rkscript/docx/UserImage/NoImage.jpg"; //................................................. Role Info if (uType == "Admin") { UserDefaultBoard = "Admin"; List <SiteInfo> Items = SiteDashboardList(); foreach (SiteInfo dr in Items) { UserAllDashboard += dr.MenuId + ","; } } else if (!string.IsNullOrEmpty(uRoleId)) { AdmRolemasterEntity sObj = (AdmRolemasterEntity)ExecuteDB(HCareTaks.AG_GetSingleAdmRolemasterRecordById, uRoleId); if (sObj != null) { UserDefaultBoard = sObj.DefaultBoard; UserAllDashboard = sObj.AllDashboard; } } //................................................. User Details Info if (!string.IsNullOrEmpty(uDetlId)) { if (uType == "Doctor") { HcDoctorinfoEntity sObj = (HcDoctorinfoEntity)ExecuteDB(HCareTaks.AG_GetSingleHcDoctorinfoRecordById, uDetlId); if (sObj != null && !string.IsNullOrEmpty(sObj.Photo)) { uName = sObj.Name; if (!string.IsNullOrEmpty(sObj.Photo)) { UserImage = sObj.Photo; } } } else if (uType == "Patient") { //HcDoctorinfoEntity sObj = (HcDoctorinfoEntity)ExecuteDB(HCareTaks.AG_GetSingleHcDoctorinfoRecordById, uDetlId); //if (sObj != null && !string.IsNullOrEmpty(sObj.Photo)) //{ // uName = sObj.Name; // if (!string.IsNullOrEmpty(sObj.Photo)) UserImage = sObj.Photo; //} } } if (Success) { //................................................. Set Sessions Session["UserId"] = uId; Session["UserName"] = uName; Session["UserType"] = uType; // Admin, Doctor, Patient, Staff Session["UserRoleId"] = uRoleId; Session["UserImage"] = UserImage; Session["UserDefaultBoard"] = UserDefaultBoard; Session["UserAllDashboard"] = UserDefaultBoard + "," + UserAllDashboard; //................................................. Set LastLogIn Time HcUsersEntity log = new HcUsersEntity(); log.Id = Id; log.Lastlogin = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"); log.QueryFlag = "LastLogIn"; ExecuteDB(HCareTaks.AG_UpdateHcUsersInfo, log); } } return(Success); }