public JsonResult GetVaredeAndSadere(ProductInStockpileModelView SenderObj) { if (ModelState.IsValid) { if (SenderObj != null) { int id_Mpc = 0; if (Int32.TryParse(SenderObj.InOutStructures.id_Mpc, out id_Mpc)) { string id_CreatedByAdmin = "0"; if (Session["AdministratorRegistery"] != null) { id_CreatedByAdmin = ((Administrator)Session["AdministratorRegistery"]).id_Admin; } else { var coockie = HttpContext.Request.Cookies.Get(ProjectProperies.AuthCoockieCode()); Administrator administratorobj = CoockieController.SayMyName(coockie.Value); id_CreatedByAdmin = administratorobj.id_Admin; } PDBC db = new PDBC(); db.Connect(); using (DataTable dt = db.Select("SELECT [id_PQT] ,[PriceModule] FROM [tlb_Product_MainProductConnector] WHERE [id_MPC] = " + id_Mpc)) { using (DataTable dtStockpile = db.Select("SELECT [id_Stockpile] FROM [tbl_Modules_StockpileMainTable] WHERE [id_MPC] = " + id_Mpc)) { db.DC(); if (dtStockpile.Rows.Count > 0) { if (dt.Rows.Count > 0) { List <ExcParameters> allpars = new List <ExcParameters>(); ExcParameters par = new ExcParameters() { _KEY = "@id_TransactionType", _VALUE = SenderObj.InOutStructures.Whichone }; allpars.Add(par); par = new ExcParameters() { _KEY = "@id_Stockpile", _VALUE = dtStockpile.Rows[0]["id_Stockpile"].ToString() }; allpars.Add(par); if (SenderObj.InOutStructures.Whichone == "1") { par = new ExcParameters() { _KEY = "@shop_id", _VALUE = SenderObj.InOutStructures.Shopid1 }; allpars.Add(par); } else { par = new ExcParameters() { _KEY = "@shop_id", _VALUE = SenderObj.InOutStructures.shopid2 }; allpars.Add(par); } string[] dates = SenderObj.InOutStructures.ActionDate.Split('/'); string[] times = SenderObj.InOutStructures.Time.Split(':'); PersianDateTime persianDateTime = new PersianDateTime(Convert.ToInt32(dates[0]), Convert.ToInt32(dates[1]), Convert.ToInt32(dates[2]), Convert.ToInt32(times[0]), Convert.ToInt32(times[1]), 0); par = new ExcParameters() { _KEY = "@StockpileDate_Transaction", _VALUE = persianDateTime.ToDateTime() }; allpars.Add(par); par = new ExcParameters() { _KEY = "@StockpileTime_Transaction", _VALUE = SenderObj.InOutStructures.Time }; allpars.Add(par); par = new ExcParameters() { _KEY = "@id_PQT", _VALUE = dt.Rows[0]["id_PQT"].ToString() }; allpars.Add(par); par = new ExcParameters() { _KEY = "@MoneyId", _VALUE = dt.Rows[0]["PriceModule"].ToString() }; allpars.Add(par); par = new ExcParameters() { _KEY = "@PriceOf_Transaction", _VALUE = SenderObj.InOutStructures.INOUTPrice }; allpars.Add(par); par = new ExcParameters() { _KEY = "@PQTValueOf_Transaction", _VALUE = SenderObj.InOutStructures.INOUTValue }; allpars.Add(par); if (!string.IsNullOrEmpty(SenderObj.InOutStructures.Description)) { par = new ExcParameters() { _KEY = "@Description_Transaction", _VALUE = SenderObj.InOutStructures.Description }; allpars.Add(par); } else { par = new ExcParameters() { _KEY = "@Description_Transaction", _VALUE = "" }; allpars.Add(par); } par = new ExcParameters() { _KEY = "@id_SubmiterAdmin", _VALUE = id_CreatedByAdmin }; allpars.Add(par); db.Connect(); string result = db.Script("INSERT INTO [tbl_Modules_StockpileTransactionMainTable]([id_TransactionType],[id_Stockpile],[shop_id],[StockpileDate_Transaction],[StockpileTime_Transaction],[id_PQT],[MoneyId],[PriceOf_Transaction],[PQTValueOf_Transaction],[Description_Transaction],[id_SubmiterAdmin]) VALUES(@id_TransactionType,@id_Stockpile,@shop_id,@StockpileDate_Transaction,@StockpileTime_Transaction,@id_PQT,@MoneyId,@PriceOf_Transaction,@PQTValueOf_Transaction,@Description_Transaction,@id_SubmiterAdmin)", allpars); db.DC(); if (result == "1") { var ModelSender = new ErrorReporterModel { ErrorID = "SX1645605", Errormessage = $"اطلاعات با موفقیت ثبت شد!", Errortype = "Success" }; return(Json(ModelSender)); } else { PPBugReporter rep = new PPBugReporter(BugTypeFrom.SQL, "IN Controller : {AdministratorStockpileController}\nMethod : {public JsonResult GetVarede(ProductInStockpileModelView senderObj) Script : INSERT INTO [tbl_Modules_StockpileTransactionMainTable]([id_TransactionType],[id_Stockpile],[shop_id],[Submitdate_Transaction],[StockpileDate_Transaction],[StockpileTime_Transaction],[id_PQT],[MoneyId],[PriceOf_Transaction],[PQTValueOf_Transaction],[Description_Transaction],[id_SubmiterAdmin]) VALUES(@id_TransactionType,@id_Stockpile,@shop_id,@Submitdate_Transaction,@StockpileDate_Transaction,@StockpileTime_Transaction,@id_PQT,@MoneyId,@PriceOf_Transaction,@PQTValueOf_Transaction,@Description_Transaction,@id_SubmiterAdmin) ||| Result :" + result); var ModelSender = new ErrorReporterModel { ErrorID = "EX1186781", Errormessage = $"عدم توانایی در ثبت اطلاعات", Errortype = "Error" }; return(Json(ModelSender)); } } else { var ModelSender = new ErrorReporterModel { ErrorID = "EX645756697", Errormessage = $"محصول مورد نظر یافت نشد", Errortype = "Error" }; return(Json(ModelSender)); } } else { var ModelSender = new ErrorReporterModel { ErrorID = "EX645697", Errormessage = $"محصول مورد نظر یافت نشد", Errortype = "Error" }; return(Json(ModelSender)); } } } } else { var ModelSender = new ErrorReporterModel { ErrorID = "EX1897", Errormessage = $"اطلاعات وارده خلاف متغیر های قانونی میباشد!", Errortype = "Error" }; return(Json(ModelSender)); } } else { PPBugReporter rep = new PPBugReporter(BugTypeFrom.SQL, "IN Controller : {AdministratorStockpileController}\nMethod : {public JsonResult GetVarede(ProductInStockpileModelView senderObj) (senderObj == null)"); var ModelSender = new ErrorReporterModel { ErrorID = "EX111", Errormessage = $"ورود متغیر خلاف پروتکل های امنیتی", Errortype = "Error" }; return(Json(ModelSender)); } } else { List <ModelErrorReporter> allErrors = new List <ModelErrorReporter>(); //foreach (ModelError error in ModelState.Values.) var AllValues = ModelState.Values.ToList(); var AllKeys = ModelState.Keys.ToList(); int errorsCount = AllValues.Count; for (int i = 0; i < errorsCount; i++) { if (AllValues[i].Errors.Count > 0) { ModelErrorReporter er = new ModelErrorReporter() { IdOfProperty = AllKeys[i].Replace("InOutStructures.", "InOutStructures_"), ErrorMessage = AllValues[i].Errors[0].ErrorMessage }; allErrors.Add(er); } } var ModelSender = new ErrorReporterModel { ErrorID = "EX115", Errormessage = $"عدم رعایت استاندارد ها!", Errortype = "ErrorWithList", AllErrors = allErrors }; return(Json(ModelSender)); } return(Json("")); }
public ActionResult ChangeAuthInformations(ChangeProfileModel informations) { changeAuthInformation information = informations.authInformation; if (ModelState.IsValid) { string adminID = ""; try { adminID = ((Administrator)Session["AdministratorRegistery"]).id_Admin; } catch (Exception exception) { PPBugReporter rep = new PPBugReporter(BugTypeFrom.sessionAuth, "IN Controller : {AdministratorGeneralController}\nMethod : {public ActionResult Index(ChangeProfileModel adObj1)}") { EXOBJ = exception }; } //If Session Doesent work try { HttpCookie cookie = HttpContext.Request.Cookies.Get(ProjectProperies.AuthCoockieCode()); adminID = CoockieController.SayMyName(cookie.Value).id_Admin; } catch (Exception EX) { PPBugReporter rep = new PPBugReporter(BugTypeFrom.coockieAuth, "IN Controller : {AdministratorGeneralController}\nMethod : {public ActionResult Index(ChangeProfileModel adObj1)}") { EXOBJ = EX }; } if (string.IsNullOrEmpty(adminID)) { adminID = "NO-ID"; } PDBC db = new PDBC(); List <ExcParameters> dbparams = new List <ExcParameters>(); ExcParameters param = new ExcParameters() { _VALUE = adminID, _KEY = "@id_Admin" }; dbparams.Add(param); db.Connect(); using (DataTable dt = db.Select("SELECT [ad_password] FROM [tbl_ADMIN_main] WHERE [id_Admin] = @id_Admin", dbparams)) { db.DC(); if (dt.Rows.Count > 0) { EncDec en = new EncDec(); string md5GeneratedPW = en.HMACMD5Generator(information.OLDpassword); if (md5GeneratedPW == dt.Rows[0]["ad_password"].ToString()) { if (string.IsNullOrEmpty(information.Newpassword1)) { param = new ExcParameters() { _VALUE = information.Username, _KEY = "@ad_username" }; dbparams.Add(param); db.Connect(); string result = db.Script("UPDATE [tbl_ADMIN_main] SET [ad_username] = @ad_username WHERE [id_Admin] = @id_Admin", dbparams); db.DC(); if (result == "1") { try { var sessionChanger = (Administrator)Session["AdministratorRegistery"]; sessionChanger.Username = information.Username; Session["AdministratorRegistery"] = sessionChanger; } catch (Exception EX) { PPBugReporter rep = new PPBugReporter(BugTypeFrom.sessionAuth, "IN Controller : {AdministratorGeneralController}\nMethod : {public ActionResult Index(ChangeProfileModel adObj LINE 298)}") { EXOBJ = EX }; } try { HttpCookie cookie = HttpContext.Request.Cookies.Get(ProjectProperies.AuthCoockieCode()); var sessionChanger = CoockieController.SayMyName(cookie.Value); sessionChanger.Username = information.Username; var userCookieIDV = new HttpCookie(ProjectProperies.AuthCoockieCode()); userCookieIDV.Value = CoockieController.SetCoockie(sessionChanger);; userCookieIDV.Expires = DateTime.Now.AddYears(5); Response.SetCookie(userCookieIDV); } catch (Exception EX) { PPBugReporter rep = new PPBugReporter(BugTypeFrom.coockieAuth, "IN Controller : {AdministratorGeneralController}\nMethod : {public ActionResult Index(ChangeProfileModel adObj LINE 315)}") { EXOBJ = EX }; } var ModelSender = new ErrorReporterModel { ErrorID = "SX102", Errormessage = "نام کاربری با موفقیت ویرایش شد!", Errortype = "Success" }; return(Json(ModelSender)); } else { PPBugReporter rep = new PPBugReporter(BugTypeFrom.SQL, result); var ModelSender = new ErrorReporterModel { ErrorID = "EX108", Errormessage = "عدم توانایی در ایجاد نشست فعال برای شما با پشتیبانی تماس حاصل فرمایید", Errortype = "Error" }; return(Json(ModelSender)); } } else { if (information.Newpassword1 == information.Newpassword2) { param = new ExcParameters() { _VALUE = information.Username, _KEY = "@ad_username" }; dbparams.Add(param); param = new ExcParameters() { _VALUE = md5GeneratedPW, _KEY = "@ad_password" }; dbparams.Add(param); db.Connect(); string result = db.Script("UPDATE [tbl_ADMIN_main] SET [ad_password] = @ad_password,[ad_username] = @ad_username WHERE [id_Admin] = @id_Admin", dbparams); db.DC(); if (result == "1") { try { var sessionChanger = (Administrator)Session["AdministratorRegistery"]; sessionChanger.Username = information.Username; Session["AdministratorRegistery"] = sessionChanger; } catch (Exception EX) { PPBugReporter rep = new PPBugReporter(BugTypeFrom.sessionAuth, "IN Controller : {AdministratorGeneralController}\nMethod : {public ActionResult Index(ChangeProfileModel adObj LINE 126)}") { EXOBJ = EX }; } try { HttpCookie cookie = HttpContext.Request.Cookies.Get(ProjectProperies.AuthCoockieCode()); var sessionChanger = CoockieController.SayMyName(cookie.Value); sessionChanger.Username = information.Username; var userCookieIDV = new HttpCookie(ProjectProperies.AuthCoockieCode()); userCookieIDV.Value = CoockieController.SetCoockie(sessionChanger);; userCookieIDV.Expires = DateTime.Now.AddYears(5); Response.SetCookie(userCookieIDV); } catch (Exception EX) { PPBugReporter rep = new PPBugReporter(BugTypeFrom.coockieAuth, "IN Controller : {AdministratorGeneralController}\nMethod : {public ActionResult Index(ChangeProfileModel adObj LINE 126)}") { EXOBJ = EX }; } var ModelSender = new ErrorReporterModel { ErrorID = "SX103", Errormessage = "اطلاعات ورود با موفقیت ویرایش شد!", Errortype = "Success" }; return(Json(ModelSender)); } else { PPBugReporter rep = new PPBugReporter(BugTypeFrom.SQL, result); var ModelSender = new ErrorReporterModel { ErrorID = "EX110", Errormessage = $"عدم توانایی در ویرایش اطلاعات با پشتیبانی تماس حاصل فرمایید! کد پیگیری برای شما :{rep.CodeGenerated}", Errortype = "Error" }; return(Json(ModelSender)); } } else { List <ModelErrorReporter> allErrors = new List <ModelErrorReporter>(); ModelErrorReporter er = new ModelErrorReporter() { IdOfProperty = "authInformation_Newpassword1", ErrorMessage = "عدم یکسانی کلمه های عبور" }; allErrors.Add(er); er = new ModelErrorReporter() { IdOfProperty = "authInformation_Newpassword2", ErrorMessage = "عدم یکسانی کلمه های عبور" }; allErrors.Add(er); var ModelSender = new ErrorReporterModel { ErrorID = "EX109", Errormessage = "عدم یکسانی کلمه های عبور", Errortype = "ErrorWithList", AllErrors = allErrors }; return(Json(ModelSender)); } } } else { List <ModelErrorReporter> allErrors = new List <ModelErrorReporter>(); ModelErrorReporter er = new ModelErrorReporter() { IdOfProperty = "authInformation_OLDpassword", ErrorMessage = "کلمه عبور بدرستی وارد نشده است" }; allErrors.Add(er); var ModelSender = new ErrorReporterModel { ErrorID = "EX105", Errormessage = $"کلمه عبور حال شما کلید شما برای ایجاد تغییرات میباشد", Errortype = "ErrorWithList", AllErrors = allErrors }; return(Json(ModelSender)); } } else { var ModelSender = new ErrorReporterModel { ErrorID = "EX107", Errormessage = $"کاربر یافت نشد با پشتیبانی تماس بفرمایید", Errortype = "Error", }; return(Json(ModelSender)); } } } else { List <ModelErrorReporter> allErrors = new List <ModelErrorReporter>(); var AllValues = ModelState.Values.ToList(); var AllKeys = ModelState.Keys.ToList(); int errorsCount = AllValues.Count; for (int i = 0; i < errorsCount; i++) { if (AllValues[i].Errors.Count > 0) { ModelErrorReporter er = new ModelErrorReporter() { IdOfProperty = AllKeys[i].Replace("authInformation.", "authInformation_"), ErrorMessage = AllValues[i].Errors[0].ErrorMessage }; allErrors.Add(er); } } var ModelSender = new ErrorReporterModel { ErrorID = "EX106", Errormessage = $"عدم رعایت استاندارد ها!", Errortype = "ErrorWithList", AllErrors = allErrors }; return(Json(ModelSender)); } }
public ActionResult Index(ChangeProfileModel adObj1) { Administrator adObj = adObj1.administrator; if (ModelState.IsValid) { string adminID = ""; try { adminID = ((Administrator)Session["AdministratorRegistery"]).id_Admin; } catch (Exception exception) { PPBugReporter rep = new PPBugReporter(BugTypeFrom.sessionAuth, "IN Controller : {AdministratorGeneralController}\nMethod : {public ActionResult Index(ChangeProfileModel adObj1)}") { EXOBJ = exception }; } //If Session Doesent work try { HttpCookie cookie = HttpContext.Request.Cookies.Get(ProjectProperies.AuthCoockieCode()); adminID = CoockieController.SayMyName(cookie.Value).id_Admin; } catch (Exception EX) { PPBugReporter rep = new PPBugReporter(BugTypeFrom.coockieAuth, "IN Controller : {AdministratorGeneralController}\nMethod : {public ActionResult Index(ChangeProfileModel adObj1)}") { EXOBJ = EX }; } if (string.IsNullOrEmpty(adminID)) { adminID = "NO-ID"; } PDBC db = new PDBC(); List <ExcParameters> dbparams = new List <ExcParameters>(); adObj.ad_avatarprofile = "/AdminDesignResource/app/media/img/users/100_12.jpg"; ExcParameters param = new ExcParameters() { _VALUE = adminID, _KEY = "@id_Admin" }; dbparams.Add(param); param = new ExcParameters() { _VALUE = adObj.ad_firstname, _KEY = "@ad_firstname" }; dbparams.Add(param); param = new ExcParameters() { _VALUE = adObj.ad_lastname, _KEY = "@ad_lastname" }; dbparams.Add(param); param = new ExcParameters() { _VALUE = adObj.ad_avatarprofile, _KEY = "@ad_avatarprofile" }; dbparams.Add(param); param = new ExcParameters() { _VALUE = adObj.ad_email, _KEY = "@ad_email" }; dbparams.Add(param); param = new ExcParameters() { _VALUE = adObj.ad_phone, _KEY = "@ad_phone" }; dbparams.Add(param); param = new ExcParameters() { _VALUE = adObj.ad_mobile, _KEY = "@ad_mobile" }; dbparams.Add(param); param = new ExcParameters() { _VALUE = adObj.ad_NickName, _KEY = "@ad_NickName" }; dbparams.Add(param); db.Connect(); string result = db.Script( "UPDATE [tbl_ADMIN_main] SET [ad_firstname] = @ad_firstname ,[ad_lastname] = @ad_lastname ,[ad_avatarprofile] = @ad_avatarprofile ,[ad_email] = @ad_email ,[ad_phone] = @ad_phone ,[ad_mobile] = @ad_mobile ,[ad_NickName] = @ad_NickName WHERE id_Admin=@id_Admin", dbparams); db.DC(); if (result == "1") { try { var sessionChanger = (Administrator)Session["AdministratorRegistery"]; sessionChanger.ad_avatarprofile = adObj.ad_avatarprofile; sessionChanger.ad_NickName = adObj.ad_NickName; sessionChanger.ad_firstname = adObj.ad_firstname; sessionChanger.ad_lastname = adObj.ad_lastname; sessionChanger.ad_email = adObj.ad_email; sessionChanger.ad_phone = adObj.ad_phone; sessionChanger.ad_mobile = adObj.ad_mobile; Session["AdministratorRegistery"] = sessionChanger; } catch (Exception EX) { PPBugReporter rep = new PPBugReporter(BugTypeFrom.sessionAuth, "IN Controller : {AdministratorGeneralController}\nMethod : {public ActionResult Index(ChangeProfileModel adObj LINE 126)}") { EXOBJ = EX }; } try { HttpCookie cookie = HttpContext.Request.Cookies.Get(ProjectProperies.AuthCoockieCode()); var sessionChanger = CoockieController.SayMyName(cookie.Value); sessionChanger.ad_avatarprofile = adObj.ad_avatarprofile; sessionChanger.ad_NickName = adObj.ad_NickName; sessionChanger.ad_firstname = adObj.ad_firstname; sessionChanger.ad_lastname = adObj.ad_lastname; sessionChanger.ad_email = adObj.ad_email; sessionChanger.ad_phone = adObj.ad_phone; sessionChanger.ad_mobile = adObj.ad_mobile; var userCookieIDV = new HttpCookie(ProjectProperies.AuthCoockieCode()); userCookieIDV.Value = CoockieController.SetCoockie(sessionChanger);; userCookieIDV.Expires = DateTime.Now.AddYears(5); Response.SetCookie(userCookieIDV); } catch (Exception EX) { PPBugReporter rep = new PPBugReporter(BugTypeFrom.coockieAuth, "IN Controller : {AdministratorGeneralController}\nMethod : {public ActionResult Index(ChangeProfileModel adObj LINE 126)}") { EXOBJ = EX }; } var ModelSender = new ErrorReporterModel { ErrorID = "SX101", Errormessage = "اطلاعات کاربری با موفقیت ویرایش شد!", Errortype = "Success" }; return(Json(ModelSender)); } else { PPBugReporter rep = new PPBugReporter(BugTypeFrom.SQL, result); var ModelSender = new ErrorReporterModel { ErrorID = "EX103", Errormessage = $"عدم توانایی در ویرایش اطلاعات با پشتیبانی تماس حاصل فرمایید! کد پیگیری برای شما :{rep.CodeGenerated}", Errortype = "Error" }; ViewBag.EXLogin = ModelSender; return(Json(ModelSender)); } } else { List <ModelErrorReporter> allErrors = new List <ModelErrorReporter>(); //foreach (ModelError error in ModelState.Values.) var AllValues = ModelState.Values.ToList(); var AllKeys = ModelState.Keys.ToList(); int errorsCount = AllValues.Count; for (int i = 0; i < errorsCount; i++) { if (AllValues[i].Errors.Count > 0) { ModelErrorReporter er = new ModelErrorReporter() { IdOfProperty = AllKeys[i].Replace("administrator.", "administrator_"), ErrorMessage = AllValues[i].Errors[0].ErrorMessage }; allErrors.Add(er); } } var ModelSender = new ErrorReporterModel { ErrorID = "EX104", Errormessage = $"عدم رعایت استاندارد ها!", Errortype = "ErrorWithList", AllErrors = allErrors }; return(Json(ModelSender)); } }
protected override void OnActionExecuting(ActionExecutingContext filterContext) { if (Session["AdministratorRegistery"] != null) { ProfileProperty propfileinfo = new ProfileProperty() { avatarImageSrc = ((Administrator)Session["AdministratorRegistery"]).ad_avatarprofile, name = ((Administrator)Session["AdministratorRegistery"]).ad_NickName, fullname = ((Administrator)Session["AdministratorRegistery"]).ad_firstname + " " + ((Administrator)Session["AdministratorRegistery"]).ad_lastname, ipAdmin = Request.UserHostAddress, Firstname = ((Administrator)Session["AdministratorRegistery"]).ad_firstname, Lastname = ((Administrator)Session["AdministratorRegistery"]).ad_lastname, email = ((Administrator)Session["AdministratorRegistery"]).ad_email, phone = ((Administrator)Session["AdministratorRegistery"]).ad_phone, mobile = ((Administrator)Session["AdministratorRegistery"]).ad_mobile, Username = ((Administrator)Session["AdministratorRegistery"]).Username }; ViewBag.ProfileInfo = propfileinfo; //End of Admin Profile //start PAGE - TITLE string actionName = filterContext.RouteData.Values["action"].ToString(); string controllerName = filterContext.RouteData.Values["controller"].ToString(); ViewBag.pageTitle = TitleFounder.GetAdminPanelTitle(controllerName, actionName); //END of PAGE - TITLE base.OnActionExecuting(filterContext); } else if (HttpContext.Request.Cookies.Get(ProjectProperies.AuthCoockieCode()) != null) { var coockie = HttpContext.Request.Cookies.Get(ProjectProperies.AuthCoockieCode()); Administrator administratorobj = CoockieController.SayMyName(coockie.Value); if ((DateTime.Now - administratorobj.SayMyTime).TotalHours > 6) { string actionName1 = filterContext.RouteData.Values["action"].ToString(); string controllerName1 = filterContext.RouteData.Values["controller"].ToString(); string urlRedirection = controllerName1 + "-A_" + actionName1; if (!urlRedirection.Contains("AdminLoginAuth-A_index")) { TempData["urlRedirection"] = urlRedirection; filterContext.Result = RedirectToAction("index", "AdminLoginAuth", new { @urlRedirection = urlRedirection }); } else { filterContext.Result = RedirectToAction("index", "AdminLoginAuth"); } } ProfileProperty propfileinfo = new ProfileProperty() { avatarImageSrc = administratorobj.ad_avatarprofile, name = administratorobj.ad_NickName, fullname = administratorobj.ad_firstname + " " + administratorobj.ad_lastname, ipAdmin = Request.UserHostAddress, Firstname = administratorobj.ad_firstname, Lastname = administratorobj.ad_lastname, email = administratorobj.ad_email, phone = administratorobj.ad_phone, mobile = administratorobj.ad_mobile, Username = administratorobj.Username }; administratorobj.SayMyTime = DateTime.Now; var userCookieIDV = new HttpCookie(ProjectProperies.AuthCoockieCode()); userCookieIDV.Value = CoockieController.SetCoockie(administratorobj);; userCookieIDV.Expires = DateTime.Now.AddYears(5); Response.SetCookie(userCookieIDV); ViewBag.ProfileInfo = propfileinfo; //End of Admin Profile //start PAGE - TITLE string actionName = filterContext.RouteData.Values["action"].ToString(); string controllerName = filterContext.RouteData.Values["controller"].ToString(); ViewBag.pageTitle = TitleFounder.GetAdminPanelTitle(controllerName, actionName); //END of PAGE - TITLE base.OnActionExecuting(filterContext); } else { string actionName = filterContext.RouteData.Values["action"].ToString(); string controllerName = filterContext.RouteData.Values["controller"].ToString(); string urlRedirection = controllerName + "-A_" + actionName; if (!urlRedirection.Contains("AdminLoginAuth-A_index")) { TempData["urlRedirection"] = urlRedirection; filterContext.Result = RedirectToAction("index", "AdminLoginAuth", new { @urlRedirection = urlRedirection }); } else { filterContext.Result = RedirectToAction("index", "AdminLoginAuth"); } } }