public ActionResult Email_Verification(string EmailVerifictionKey) { string errormsg = ""; using (Auth_Svc.UserAuthenticationServiceClient iGstSvc = new Auth_Svc.UserAuthenticationServiceClient()) { try { if (!string.IsNullOrEmpty(EmailVerifictionKey)) { iGstSvc.Email_Verification(EmailVerifictionKey, out errormsg); if (errormsg.Trim().Length > 0) { return(Json(errormsg, JsonRequestBehavior.AllowGet)); } else { return(Json("Your email verified successfully", JsonRequestBehavior.AllowGet)); } } } catch (Exception ex) { return(Json(ex.Message + ex.StackTrace + ex.InnerException, JsonRequestBehavior.AllowGet)); //Common.ErrorLog.LogSQLErrors_Comments(null, "Login-User-Method-wscall", ex); } } return(Json(ErrorMessage, JsonRequestBehavior.AllowGet)); }
public ActionResult GetList_UserRegistered() { using (Auth_Svc.UserAuthenticationServiceClient iGstSvc = new Auth_Svc.UserAuthenticationServiceClient()) { return(View("~/Views/MasterPages/UserRegisteredList.cshtml", iGstSvc.GetList_UserModerate("", "", "R"))); } }
public ActionResult GetDetails_OrganizationAccountant() { string OrganizationCode = ""; if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null) { OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim(); } using (Auth_Svc.UserAuthenticationServiceClient iGstSvc = new Auth_Svc.UserAuthenticationServiceClient()) { return(PartialView("~/Views/MasterPages/OrganizationAccountanDetails.cshtml", iGstSvc.GetDetails_OrganizationAccountant("", OrganizationCode, "", false))); } }
public ActionResult GetList_OrganizationDropdownList() { string OrganizationCode = ""; if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null) { OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim(); } using (Auth_Svc.UserAuthenticationServiceClient iGstSvc = new Auth_Svc.UserAuthenticationServiceClient()) { return(Json(iGstSvc.GetList_OrganizationDropdownList(OrganizationCode, "", ""), JsonRequestBehavior.AllowGet)); } }
public ActionResult GetList_Accountant() { string OrganizationCode = ""; if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null) { OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim(); } using (Auth_Svc.UserAuthenticationServiceClient iGstSvc = new Auth_Svc.UserAuthenticationServiceClient()) { return(View("~/Views/MasterPages/UserAccountantList.cshtml", iGstSvc.GetList_UserModerate(OrganizationCode, "", "A"))); } }
public ActionResult User_PasswordSave(string OldPssword, string NewPassword) { using (Auth_Svc.UserAuthenticationServiceClient iGstSvc = new Auth_Svc.UserAuthenticationServiceClient()) { string ErrorMessage = ""; bool bSuccess = iGstSvc.User_ChangePassword(OldPssword, NewPassword, (UserInfo)Session["UserDetails"], out ErrorMessage); if (ErrorMessage.Trim().Length > 0) { return(Json(ErrorMessage, JsonRequestBehavior.AllowGet)); } else { return(Json("Ok", JsonRequestBehavior.AllowGet)); } } }
public ActionResult User_ForgotPassword(string UserCodeEmailIDMobile, string OTPSendOption) { using (Auth_Svc.UserAuthenticationServiceClient iGstSvc = new Auth_Svc.UserAuthenticationServiceClient()) { string OTPValidityDuration = System.Configuration.ConfigurationManager.AppSettings["OTPValidityDuration"].ToString(); string OTP = ""; string ErrorMessage = ""; bool bSuccess = iGstSvc.User_ForgotPassword(UserCodeEmailIDMobile, OTPValidityDuration, OTPSendOption, "", out OTP, out ErrorMessage); if (ErrorMessage.Trim().Length > 0) { return(Json(ErrorMessage, JsonRequestBehavior.AllowGet)); } else { return(View("~/Views/MasterPages/UserRegistrationLogin.cshtml")); } } }
/*[ValidateAntiForgeryToken]*/ public ActionResult User_Login(string UserCode, string Password, string UserType, string returnUrl) { using (Auth_Svc.UserAuthenticationServiceClient iGstSvc = new Auth_Svc.UserAuthenticationServiceClient()) { try { UserInfo objUserInfo = iGstSvc.User_Login(UserCode, Password, UserType, out ErrorMessage); //return Json("Error during login=>iuyiuyiuyiyi"+ objUserInfo.UserCode, JsonRequestBehavior.AllowGet); if (objUserInfo != null && objUserInfo.UserCode != null) { SignInStatus UserAccountSatus = SignInStatus.Success; Session["UserDetails"] = objUserInfo; string UserName = System.Web.HttpContext.Current.User.Identity.Name; switch (UserAccountSatus) { case SignInStatus.Success: return(Json("Ok", JsonRequestBehavior.AllowGet)); case SignInStatus.LockedOut: return(View("~/Views/MasterPages/Lockout.cshtml")); case SignInStatus.RequiresVerification: return(RedirectToAction("SendCode", new { ReturnUrl = returnUrl })); case SignInStatus.Failure: default: return(Json("Invalid login attempt.", JsonRequestBehavior.AllowGet)); } } } catch (Exception ex) { return(Json(ex.Message + ex.StackTrace + ex.InnerException, JsonRequestBehavior.AllowGet)); //Common.ErrorLog.LogSQLErrors_Comments(null, "Login-User-Method-wscall", ex); } } return(Json(ErrorMessage, JsonRequestBehavior.AllowGet)); }
public ActionResult Save_OrganizationAccountant(string isOnlyDelete, string ID, string AccountantCode, string OrganizationCode) { using (Auth_Svc.UserAuthenticationServiceClient iGstSvc = new Auth_Svc.UserAuthenticationServiceClient()) { if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null) { OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim(); } OrganizationAccountantInfo obj = new OrganizationAccountantInfo(); obj.OrganizationCode = OrganizationCode; obj.AccountantCode = AccountantCode; obj.ID = ID; if (iGstSvc.Save_OrganizationAccountant(isOnlyDelete.Trim().ToUpper() == "Y", obj, ((UserInfo)Session["UserDetails"]), out ErrorMessage)) { return(Json("Ok", JsonRequestBehavior.AllowGet)); } } return(Json(ErrorMessage, JsonRequestBehavior.AllowGet)); }
public ActionResult GetDetails_UserRegistered(string UserCode) { string OrganizationCode = ""; if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null) { OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim(); } using (Auth_Svc.UserAuthenticationServiceClient iGstSvc = new Auth_Svc.UserAuthenticationServiceClient()) { UserInfo obj = iGstSvc.GetDetails_UserModerate(UserCode); ViewBag.Organizations = CommonMethods.ListOrganizations(obj.OrganizationCode); ViewBag.Countries_Basic = CommonMethods.ListCountry(obj.Country); ViewBag.State_Basic = CommonMethods.ListStates(obj.Country, obj.State); ListStaticValue_RegtypeDeliveryPaymentTitleSafix("", "", "", obj.Title, obj.Safix); return(PartialView("~/Views/MasterPages/UserRegisteredDetails.cshtml", iGstSvc.GetDetails_UserModerate(UserCode))); } }
public static string ListOrganizations(string SelectedOrganization) { List <OrganizationInfo> Organizations = null; System.Text.StringBuilder sbOrganizationList = new System.Text.StringBuilder(); sbOrganizationList.AppendLine("<option value=\"\">Select one</option>"); if (System.Web.HttpContext.Current.Session["Organization"] == null) { try { SelectedOrganization = ((UserInfo)System.Web.HttpContext.Current.Session["UserDetails"]).OrganizationCode.Trim(); if (((UserInfo)System.Web.HttpContext.Current.Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R") { if (((UserInfo)System.Web.HttpContext.Current.Session["UserDetails"]).OrganizationCode != null && ((UserInfo)System.Web.HttpContext.Current.Session["UserDetails"]).OrganizationCode.Trim().Length > 0) { Organizations = new Auth_Svc.UserAuthenticationServiceClient().GetList_OrganizationDropdownList(((UserInfo)System.Web.HttpContext.Current.Session["UserDetails"]).OrganizationCode.Trim(), "", ""); if (Organizations != null && Organizations.Count > 0) { System.Web.HttpContext.Current.Session["Organization"] = Organizations; foreach (OrganizationInfo country in Organizations) { if (!string.IsNullOrEmpty(SelectedOrganization) && country.OrganizationCode.Trim() == SelectedOrganization.Trim()) { sbOrganizationList.AppendLine("<option selected=\"selected\" value=\"" + country.OrganizationCode + "\">" + country.OrganizationName + "</option>"); } } } } } else if (((UserInfo)System.Web.HttpContext.Current.Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "M") { Organizations = new Auth_Svc.UserAuthenticationServiceClient().GetList_OrganizationDropdownList("", "", ""); if (Organizations != null && Organizations.Count > 0) { System.Web.HttpContext.Current.Session["Organization"] = Organizations; foreach (OrganizationInfo country in Organizations) { if (!string.IsNullOrEmpty(SelectedOrganization) && country.OrganizationCode.Trim() == SelectedOrganization.Trim()) { sbOrganizationList.AppendLine("<option selected=\"selected\" value=\"" + country.OrganizationCode + "\">" + country.OrganizationName + "</option>"); } else { sbOrganizationList.AppendLine("<option value=\"" + country.OrganizationCode + "\">" + country.OrganizationName + "</option>"); } } } } else if (((UserInfo)System.Web.HttpContext.Current.Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "A") { Organizations = new Auth_Svc.UserAuthenticationServiceClient().GetList_OrganizationDropdownList("", "", ""); if (Organizations != null && Organizations.Count > 0) { System.Web.HttpContext.Current.Session["Organization"] = Organizations; foreach (OrganizationInfo country in Organizations) { if (!string.IsNullOrEmpty(SelectedOrganization) && country.OrganizationCode.Trim() == SelectedOrganization.Trim()) { sbOrganizationList.AppendLine("<option selected=\"selected\" value=\"" + country.OrganizationCode + "\">" + country.OrganizationName + "</option>"); } else { sbOrganizationList.AppendLine("<option value=\"" + country.OrganizationCode + "\">" + country.OrganizationName + "</option>"); } } } } else { System.Web.HttpContext.Current.Session["Organization"] = null; } } catch (Exception ex) { ErrorLog.LogErrors_Comments(ex.Message + ex.InnerException + ex.StackTrace, "Controler", "Organization ist", ""); System.Web.HttpContext.Current.Session["Organization"] = null; Organizations = new List <OrganizationInfo>(); } } else { Organizations = (List <OrganizationInfo>)System.Web.HttpContext.Current.Session["Organization"]; if (Organizations != null && Organizations.Count > 0) { System.Web.HttpContext.Current.Session["Organization"] = Organizations; foreach (OrganizationInfo country in Organizations) { if (!string.IsNullOrEmpty(SelectedOrganization) && country.OrganizationCode.Trim() == SelectedOrganization.Trim()) { sbOrganizationList.AppendLine("<option selected=\"selected\" value=\"" + country.OrganizationCode + "\">" + country.OrganizationName + "</option>"); } else { sbOrganizationList.AppendLine("<option value=\"" + country.OrganizationCode + "\">" + country.OrganizationName + "</option>"); } } } } return(sbOrganizationList.ToString()); }
public ActionResult User_Registration(string UserType, string FirstName, string MidName, string LastName, string OrganizaionName, string UserID, string Street1, string EmailID, string Mobile, string City, string State, string Country, string Password) { using (Auth_Svc.UserAuthenticationServiceClient iGstSvc = new Auth_Svc.UserAuthenticationServiceClient()) { UserInfo objUserInfoToBeSaved = new UserInfo(); objUserInfoToBeSaved.UserCode = ""; objUserInfoToBeSaved.UserType = UserType.Trim().ToUpper(); //objUserInfoToBeSaved.IsMainUser = (IsMainUser != null && IsMainUser.Trim().ToUpper() == "Y"); objUserInfoToBeSaved.IsActive = true; objUserInfoToBeSaved.IsApproved = false; objUserInfoToBeSaved.OrganizationCode = ""; objUserInfoToBeSaved.OrganizationName = OrganizaionName; objUserInfoToBeSaved.Title = ""; objUserInfoToBeSaved.First_Name = FirstName; objUserInfoToBeSaved.Last_Name = LastName; objUserInfoToBeSaved.Middle_Name = MidName; objUserInfoToBeSaved.Street1 = Street1; objUserInfoToBeSaved.City = City; objUserInfoToBeSaved.State = State; objUserInfoToBeSaved.Country = Country; objUserInfoToBeSaved.EmailID = EmailID; objUserInfoToBeSaved.MobileNumber = Mobile; objUserInfoToBeSaved.Functions = ""; objUserInfoToBeSaved.Password = Password; if (iGstSvc.Save_UserModerate(false, objUserInfoToBeSaved, "", "", out ErrorMessage)) { //return Json("Ok", JsonRequestBehavior.AllowGet); //return new NormalLoginController().User_Login(EmailID, Password, UserType.Trim().ToUpper(), ""); //return RedirectToAction("processlogin", "NormalLogin", new { UserCode = EmailID, Password = Password, UserType = UserType.Trim().ToUpper(), returnUrl = "" }); UserInfo objUserInfo = iGstSvc.User_Login(EmailID, Password, UserType, out ErrorMessage); //return Json("Error during login=>iuyiuyiuyiyi"+ objUserInfo.UserCode, JsonRequestBehavior.AllowGet); if (objUserInfo != null && objUserInfo.UserCode != null) { SignInStatus UserAccountSatus = SignInStatus.Success; Session["UserDetails"] = objUserInfo; string UserName = System.Web.HttpContext.Current.User.Identity.Name; switch (UserAccountSatus) { case SignInStatus.Success: return(Json("Ok", JsonRequestBehavior.AllowGet)); case SignInStatus.LockedOut: return(View("~/Views/MasterPages/Lockout.cshtml")); case SignInStatus.RequiresVerification: return(RedirectToAction("SendCode", new { ReturnUrl = "" })); case SignInStatus.Failure: default: return(Json("Invalid login attempt.", JsonRequestBehavior.AllowGet)); } } } return(Json(ErrorMessage, JsonRequestBehavior.AllowGet)); } }
public ActionResult Save_UserModerate(string isOnlyDelete, string UserType, string OrganizaionName, string OrganizaionCode, string UserCode, string dob, string Sex, string Title, string Safix, string First_name, string Middle_name, string Last_name, string EmailID, string Mobile, string Address, string Street2, string City, string State, string Country, string PIN, string IsActive, string isApproved, string Functions, string Password, string Notes) { if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null) { OrganizaionName = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim(); } using (Auth_Svc.UserAuthenticationServiceClient iGstSvc = new Auth_Svc.UserAuthenticationServiceClient()) { UserInfo objUserInfoToBeSaved = new UserInfo(); objUserInfoToBeSaved.UserCode = UserCode; objUserInfoToBeSaved.UserType = UserType; //objUserInfoToBeSaved.IsMainUser = (IsMainUser != null && IsMainUser.Trim().ToUpper() == "Y"); objUserInfoToBeSaved.IsActive = (IsActive != null && IsActive.Trim().ToUpper() == "Y"); objUserInfoToBeSaved.IsApproved = (isApproved != null && isApproved.Trim().ToUpper() == "Y"); objUserInfoToBeSaved.OrganizationName = OrganizaionName; objUserInfoToBeSaved.OrganizationCode = OrganizaionCode; objUserInfoToBeSaved.Title = Title; objUserInfoToBeSaved.DOB = dob; objUserInfoToBeSaved.Sex = Sex; objUserInfoToBeSaved.Safix = Safix; objUserInfoToBeSaved.First_Name = First_name; objUserInfoToBeSaved.Last_Name = Last_name; objUserInfoToBeSaved.Middle_Name = Middle_name; objUserInfoToBeSaved.Street1 = Address; objUserInfoToBeSaved.Street2 = Street2; objUserInfoToBeSaved.City = City; objUserInfoToBeSaved.State = State; objUserInfoToBeSaved.Country = Country; objUserInfoToBeSaved.EmailID = EmailID; objUserInfoToBeSaved.MobileNumber = Mobile; objUserInfoToBeSaved.Functions = Functions; objUserInfoToBeSaved.Password = Password; objUserInfoToBeSaved.Notes = Notes; //objUserInfoToBeSaved.UserBranchRoleList = new List<UserBranchRoleMappingInfo>(); //UserBranchRoleMappingInfo objFunction = null; //foreach (string str in Functions.Split('#')) //{ // objFunction = new UserBranchRoleMappingInfo(); // string[] arry = str.Split(','); // if (arry.Length == 2) // { // objFunction.FunctionID = arry[0].Trim(); // objFunction.BranchID = arry[1].Trim(); // } // else // { // objUserInfoToBeSaved = null; // objFunction = null; // return Json("Iternal Problem: in permission level", JsonRequestBehavior.AllowGet); // } // objUserInfoToBeSaved.UserBranchRoleList.Add(objFunction); //} if (iGstSvc.Save_UserModerate(isOnlyDelete.Trim().ToUpper() == "Y", objUserInfoToBeSaved, ((UserInfo)Session["UserDetails"]).UserCode, Functions, out ErrorMessage)) { return(Json("Ok", JsonRequestBehavior.AllowGet)); } return(Json(ErrorMessage, JsonRequestBehavior.AllowGet)); } }