protected void btnSavePassword_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrWhiteSpace(txtPassword.Text) || string.IsNullOrWhiteSpace(txtConfirmPassword.Text))
                {
                    ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "CallJS", "alert('Please enter Password');", true);
                }
                else if (!txtPassword.Text.Trim().Equals(txtConfirmPassword.Text.Trim()))
                {
                    ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "CallJS", "alert('Password does not matched.');", true);
                }
                else
                {
                    UserBE    userInfo = new UserBE();
                    UserBAL   userBAL  = new UserBAL();
                    CommonBAL combal   = new CommonBAL();

                    string pwd = combal.Encrypt(txtPassword.Text.Trim(), false);
                    int    i   = userBAL.SaveConfirmation(Request.QueryString["userid"].ToString(), Request.QueryString["key"].ToString(), pwd);
                    if (i > 0)
                    {
                        ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "CallJS", "alert('Password saved, Please relogin'); location.href ='login.aspx';", true);
                    }
                    else
                    {
                        ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "CallJS", "alert('try again later');", true);
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
    private void LoadDisplayName()
    {
        string displayName      = string.Empty;
        string organizationName = string.Empty;

        if (Session["SignInAccountId"] != null)
        {
            displayName = new CommonBAL().GetNameBySignInId(Session["SignInId"].ToString(), Convert.ToInt32(Session["SignInAccountTypeId"]), Convert.ToInt32(Session["SignInAccountId"]), Convert.ToInt32(Session["SignInOrganizationId"]));
        }
        else
        {
            displayName = new CommonBAL().GetNameBySignInId(Session["SignInId"].ToString(), 0, 0, Convert.ToInt32(Session["SignInOrganizationId"]));
        }

        if ((AccountType)Convert.ToInt32(Session["SignInAccountTypeId"]) == AccountType.Organization)
        {
            organizationName = new OrganizationBAL().GetOrganizationNameById(Convert.ToInt32(Session["SignInOrganizationId"]));
            lblUser.ToolTip  = "Welcome " + organizationName;

            if (organizationName.Length > 50)
            {
                lblUser.Text = "Welcome " + organizationName.Substring(0, 50) + "...";
            }
            else
            {
                lblUser.Text = "Welcome " + organizationName;
            }
            return;
        }
        else
        {
            lblUser.Text = "Welcome " + displayName;
            return;
        }
    }
Exemple #3
0
        public async Task <JsonResult> ConfirmYourEmail(string UserId)
        {
            try
            {
                if (UserId == null)
                {
                    return(Json(false, JsonRequestBehavior.AllowGet));
                }
                string code = await UserManager.GenerateEmailConfirmationTokenAsync(UserId);

                var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = UserId, code }, protocol: Request.Url.Scheme);
                var userDetail  = UserManager.FindById(UserId);

                //Fetching Path of email teamplate folder in Shared .
                string FilePath = Shared.FilePath.GetEmailTemplatesFolderPath;

                // Read the file as one string.
                StreamReader str      = new StreamReader(FilePath);
                string       MailText = str.ReadToEnd();
                str.Close();

                //Repalce variables
                MailText = MailText.Replace("[UserName]", userDetail.FirstName);
                MailText = MailText.Replace("[CallBackUrl]", callbackUrl);
                MailText = MailText.Replace("[CompanyName]", CommonBAL.CompanyName());
                await UserManager.SendEmailAsync(UserId, CommonBAL.CompanyName() + ": Confirm your account", MailText);

                return(Json(true, JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
        }
Exemple #4
0
        public string[] Send_Message_TradeConfirmation()
        {
            string[] result  = new string[2];
            int      success = 0;
            int      fail    = 0;

            foreach (MessaGenerateAndSendAAA item in messagesObjs_tradeConfirm)
            {
                CCSBAL    bal    = new CCSBAL();
                CommonBAL comBal = new CommonBAL();
                Thread.Sleep(5000);
                try
                {
                    client.Timeout = 25000;
                    client.Send(item.Mail);

                    // bal.CCS_Email_NotificationSent(item.MessageInfoBo.Cust_Code, Indication_EmailNotification.Email_NotificationType_TradeConfirmation, "HTML Formatted Email", comBal.GetCurrentServerDate().ToShortDateString());
                    //success = success + 1;
                }
                catch (Exception ex)
                {
                    //bal.CCS_Email_NotificationFailure(item.MessageInfoBo.Cust_Code, Indication_EmailNotification.Email_NotificationType_TradeConfirmation, "HTML Formatted Email", comBal.GetCurrentServerDate().ToShortDateString(), ex.Message);
                    //fail = fail + 1;
                }
            }
            //result[0] = Convert.ToString(success);
            //result[1] = Convert.ToString(fail);

            return(result);
        }
Exemple #5
0
        private void ReviewCustbalance_Load(object sender, EventArgs e)
        {
            CommonBAL commonbal = new CommonBAL();

            dtpFromDate.Value   = commonbal.GetCompanyStartDate();
            dtpToDate.Value     = commonbal.GetCurrentServerDate();
            dtpToDate.Enabled   = false;
            dtpFromDate.Enabled = false;
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            if (!commonBAL.isUserAuthorisedForPageFunc(LoggedInUser.UserId, thisPageName, "add"))
            {
                LoggedIn master = (LoggedIn)this.Master;
                master.ShowMessage("You are not authorised to Perform any operation on this page. Please contact system administrator.", false);
                return;
            }
            if (ValidData())
            {
            }
            else
            {
                LoggedIn  master       = (LoggedIn)this.Master;
                CommonBAL combal       = new CommonBAL();
                UserBE    addUserBE    = new UserBE();
                UserDAL   addUserdAL   = new UserDAL();
                UserBAL   addUserBal   = new UserBAL();
                int       ReturnOutput = 0;
                addUserBE.LastModifiedBy = ((UserBE)Session["LoggedInUser"]).UserId;

                addUserBE.UserName         = txtUserName.Text;
                addUserBE.FirstName        = txtFName.Text;
                addUserBE.MiddleName       = txtMName.Text;
                addUserBE.LastName         = txtLName.Text;
                addUserBE.PrimaryEmailId   = txtPREmailId.Text;
                addUserBE.SecondaryEmailId = txtSCEmailId.Text;
                addUserBE.MobileNo         = txtMobileNo.Text;
                addUserBE.Address1         = txtAddress1.Text;
                addUserBE.Address2         = txtAddress2.Text;
                addUserBE.Street           = txtStreet.Text;
                addUserBE.City             = txtCity.Text;
                addUserBE.State1           = txtState.Text;
                addUserBE.Country          = txtCountry.Text;
                addUserBE.SecretQuest      = ddSecretQuest.SelectedValue;
                addUserBE.SecretAns        = txtSecretAns.Text;
                addUserBE.EncPass          = combal.Encrypt(txtPass.Text, false);

                if (addUserBal.AddUser(addUserBE, ref ReturnOutput))
                {
                    if (ReturnOutput == 1)
                    {
                        master.ShowMessage("User of this User Name Already exist. ", false);
                    }
                    else if (ReturnOutput == 2)
                    {
                        clearFields();
                        master.ShowMessage("Record Inserted Successfully.", true);
                    }
                }
                else
                {
                    master.ShowMessage("Unsuccessful", false);
                }
            }
        }
        public string[] Send_Message_MoneyTrans()
        {
            string[] result  = new string[2];
            int      success = 0;
            int      fail    = 0;

            foreach (MessageObject_MoneyTran item in messagesObjs_moneyTrans)
            {
                CCSBAL    bal    = new CCSBAL();
                CommonBAL comBal = new CommonBAL();

                Thread.Sleep(5000);
                try
                {
                    client.Timeout = 15000;
                    //string userState = "Test Message";
                    client.Send(item.Mail);
                    if (item.MessageInfoBo.Payment_Media == "EFT" && item.MessageInfoBo.Deposit_Withdraw == "Withdraw")
                    {
                        bal.CCS_Email_NotificationSent(item.MessageInfoBo.Cust_Code, item.MessageInfoBo.ReferenceNo, Indication_EmailNotification.Email_NotificationType_EftWithdraw, string.Empty, comBal.GetCurrentServerDate().ToShortDateString());
                    }
                    else if (item.MessageInfoBo.Payment_Media != "EFT" && item.MessageInfoBo.Deposit_Withdraw == "Withdraw")
                    {
                        bal.CCS_Email_NotificationSent(item.MessageInfoBo.Cust_Code, item.MessageInfoBo.ReferenceNo, Indication_EmailNotification.Email_NotificationType_MoneyWithdraw, string.Empty, comBal.GetCurrentServerDate().ToShortDateString());
                    }
                    else if (item.MessageInfoBo.Deposit_Withdraw == "Deposit")
                    {
                        bal.CCS_Email_NotificationSent(item.MessageInfoBo.Cust_Code, item.MessageInfoBo.ReferenceNo, Indication_EmailNotification.Email_NotificationType_MoneyDeposit, string.Empty, comBal.GetCurrentServerDate().ToShortDateString());
                    }
                    success = success + 1;
                }
                catch (Exception ex)
                {
                    if (item.MessageInfoBo.Payment_Media == "EFT" && item.MessageInfoBo.Deposit_Withdraw == "Withdraw")
                    {
                        bal.CCS_Email_NotificationFailure(item.MessageInfoBo.Cust_Code, item.MessageInfoBo.ReferenceNo, Indication_EmailNotification.Email_NotificationType_EftWithdraw, string.Empty, comBal.GetCurrentServerDate().ToShortDateString(), ex.Message);
                    }
                    else if (item.MessageInfoBo.Payment_Media != "EFT" && item.MessageInfoBo.Deposit_Withdraw == "Withdraw")
                    {
                        bal.CCS_Email_NotificationFailure(item.MessageInfoBo.Cust_Code, item.MessageInfoBo.ReferenceNo, Indication_EmailNotification.Email_NotificationType_MoneyWithdraw, string.Empty, comBal.GetCurrentServerDate().ToShortDateString(), ex.Message);
                    }
                    else if (item.MessageInfoBo.Deposit_Withdraw == "Deposit")
                    {
                        bal.CCS_Email_NotificationFailure(item.MessageInfoBo.Cust_Code, item.MessageInfoBo.ReferenceNo, Indication_EmailNotification.Email_NotificationType_MoneyDeposit, string.Empty, comBal.GetCurrentServerDate().ToShortDateString(), ex.Message);
                    }
                    fail = fail + 1;
                }
                item.Mail.Dispose();
            }
            result[0] = Convert.ToString(success);
            result[1] = Convert.ToString(fail);

            return(result);
        }
    private void GetCustomerLedger()
    {
        List <CustomerLedger> customerLedger = CommonBAL.GetCustomerLedger(Request.QueryString);

        if ((customerLedger != null) && customerLedger.Count > 0)
        {
            Response.Write(customerLedger.ToJSON());
        }
        else
        {
            Response.Write("No Result");
        }
    }
    private void fxGetCustomerForORCR()
    {
        List <clsCustomer> objCustomers = CommonBAL.fxGetCustomerForORCR(Request.QueryString);

        if ((objCustomers != null) && objCustomers.Count > 0)
        {
            Response.Write(objCustomers.ToJSON());
        }
        else
        {
            Response.Write("No Result");
        }
    }
    private void GetEntryLedger()
    {
        List <EntryLedger> entryLedgers = CommonBAL.GetEntryLedger(Request.QueryString);

        if ((entryLedgers != null) && entryLedgers.Count > 0)
        {
            Response.Write(entryLedgers.ToJSON());
        }
        else
        {
            Response.Write("No Result");
        }
    }
    private void fxGetInternalRegion()
    {
        List <InternalRegion> objInternalRegions = CommonBAL.fxGetInternalRegion();

        if ((objInternalRegions != null) && objInternalRegions.Count > 0)
        {
            Response.Write(objInternalRegions.ToJSON());
        }
        else
        {
            Response.Write("No Result");
        }
    }
    private void fxGetCluster()
    {
        List <Cluster> objClusters = CommonBAL.fxGetCluster();

        if ((objClusters != null) && objClusters.Count > 0)
        {
            Response.Write(objClusters.ToJSON());
        }
        else
        {
            Response.Write("No Result");
        }
    }
    private void fxGetMainRegion() //newly added 08252015@4:21PM
    {
        List <InternalRegion> objMainRegion = CommonBAL.fxGetMainRegion();

        if ((objMainRegion != null) && objMainRegion.Count > 0)
        {
            Response.Write(objMainRegion.ToJSON());
        }
        else
        {
            Response.Write("No Result");
        }
    }
    private void fxGetAddOnConstant()
    {
        List <AddOnConstant> objAddOnConstants = CommonBAL.fxGetAddOnConstant();

        if ((objAddOnConstants != null) && objAddOnConstants.Count > 0)
        {
            Response.Write(objAddOnConstants.ToJSON());
        }
        else
        {
            Response.Write("No Result");
        }
    }
    private void fxGetDepartment()
    {
        List <clsDepartment> objBankAccounts = CommonBAL.fxGetDepartment(Request.QueryString);

        if ((objBankAccounts != null) && objBankAccounts.Count > 0)
        {
            Response.Write(objBankAccounts.ToJSON());
        }
        else
        {
            Response.Write("No Result");
        }
    }
    private void fxGetSupplier()
    {
        List <clsSupplier> objSuppliers = CommonBAL.fxGetSupplier(Request.QueryString);

        if ((objSuppliers != null) && objSuppliers.Count > 0)
        {
            Response.Write(objSuppliers.ToJSON());
        }
        else
        {
            Response.Write("No Result");
        }
    }
    private void fxGetPayee()
    {
        List <clsPayee> objPayees = CommonBAL.fxGetPayee(Request.QueryString);

        if ((objPayees != null) && objPayees.Count > 0)
        {
            Response.Write(objPayees.ToJSON());
        }
        else
        {
            Response.Write("No Result");
        }
    }
 private void InsertLog()
 {
     try
     {
         Admin_Alternative_Report_Bal bal = new Admin_Alternative_Report_Bal();
         CommonBAL comBal = new CommonBAL();
         DateTime  Today  = comBal.GetCurrentServerDate();
         bal.InsertAdminLog(ReportName, txt_Reason.Text.Trim(), Today);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
        protected void LoadUserDetails(ForgotPasswordBE forgotBE)
        {
            DataTable dtUserDetails = new DataTable();
            CommonBAL commonBAL     = new CommonBAL();

            dtUserDetails = (DataTable)Session["PasswordRequest"];

            forgotBE.FirstName = dtUserDetails.Rows[0]["FirstName"].ToString();
            forgotBE.EncPass   = commonBAL.Decrypt(dtUserDetails.Rows[0]["EncPass"].ToString(), false);
            forgotBE.UserName  = dtUserDetails.Rows[0]["UserName"].ToString();



            // string Password = commonBAL.Decrypt(forgotBE.EncPass, false);
        }
Exemple #20
0
        //protected void lvUserList_ItemUpdating(object sender, ListViewUpdateEventArgs e)
        //{
        //    if (!commonBAL.isUserAuthorisedForPageFunc(LoggedInUser.UserId, thisPageName, "AddRec"))
        //    {
        //        LoggedIn master = (LoggedIn)this.Master;
        //        master.ShowMessage("You are not authorised to perform this function. Please contact system administrator.", false);
        //        return;
        //    }

        //    UserBE user = new UserBE();
        //    UserBAL userBAL = new UserBAL();
        //    CommonBAL CommonBAL = new CommonBAL();
        //    user.LastModifiedBy = ((UserBE)Session["LoggedInUser"]).UserId;

        //    string UserId = lvUserList.DataKeys[e.ItemIndex].Value.ToString();//
        //    Label userName = lvUserList.Items[e.ItemIndex].FindControl("lbUserName") as Label;//
        //    TextBox firstName = lvUserList.Items[e.ItemIndex].FindControl("txtFName") as TextBox;
        //    TextBox middleName = lvUserList.Items[e.ItemIndex].FindControl("txtMName") as TextBox;
        //    TextBox lastName = lvUserList.Items[e.ItemIndex].FindControl("txtLName") as TextBox;
        //    TextBox primaryEmailId = lvUserList.Items[e.ItemIndex].FindControl("txtPREmailId") as TextBox;
        //    TextBox secondaryEmailId = lvUserList.Items[e.ItemIndex].FindControl("txtSCEmailId") as TextBox;
        //    TextBox mobileNo = lvUserList.Items[e.ItemIndex].FindControl("txtMobileNo") as TextBox;
        //    TextBox address1 = lvUserList.Items[e.ItemIndex].FindControl("txtAddress1") as TextBox;
        //    TextBox address2 = lvUserList.Items[e.ItemIndex].FindControl("txtAddress2") as TextBox;
        //    TextBox street = lvUserList.Items[e.ItemIndex].FindControl("txtStreet") as TextBox;
        //    TextBox city = lvUserList.Items[e.ItemIndex].FindControl("txtCity") as TextBox;
        //    TextBox state1 = lvUserList.Items[e.ItemIndex].FindControl("txtState1") as TextBox;
        //    TextBox country = lvUserList.Items[e.ItemIndex].FindControl("txtCountry") as TextBox;
        //    TextBox secretQuest = lvUserList.Items[e.ItemIndex].FindControl("txtSecretQuest") as TextBox;//?
        //    TextBox secretAns = lvUserList.Items[e.ItemIndex].FindControl("txtSecretAns") as TextBox;
        //    TextBox Pass = lvUserList.Items[e.ItemIndex].FindControl("txtPass") as TextBox;//?



        //    user.UserId = Convert.ToInt32(UserId);
        //    user.UserName = userName.Text;
        //    user.FirstName = firstName.Text;
        //    user.MiddleName = middleName.Text;
        //    user.LastName = lastName.Text;
        //    user.PrimaryEmailId = primaryEmailId.Text;
        //    user.SecondaryEmailId = secondaryEmailId.Text;
        //    user.MobileNo = mobileNo.Text;
        //    user.Address1 = address1.Text;
        //    user.Address2 = address2.Text;
        //    user.Street = street.Text;
        //    user.City = city.Text;
        //    user.State1 = state1.Text;
        //    user.Country = country.Text;
        //    user.SecretQuest = secretQuest.Text;
        //    user.SecretAns = secretAns.Text;
        //    user.EncPass = CommonBAL.Encrypt( Pass.Text,false);

        //    if (userBAL.Modify(user))
        //    {
        //        lvUserList.EditIndex = -1;
        //        bindLVUser();
        //        LoggedIn master = (LoggedIn)this.Master;
        //        master.ShowMessage("Record Successfully Updated.", true);
        //    }
        //    else
        //    {
        //        LoggedIn master = (LoggedIn)this.Master;
        //        master.ShowMessage("Unsuccessful",false);
        //    }
        //    recalcNoOfPages();
        //}

        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (!commonBAL.isUserAuthorisedForPageFunc(LoggedInUser.UserId, thisPageName, "edit"))
            {
                LoggedIn master = (LoggedIn)this.Master;
                master.ShowMessage("You are not authorised to perform this function. Please contact system administrator.", false);
                return;
            }

            UserBE    user      = new UserBE();
            UserBAL   userBAL   = new UserBAL();
            CommonBAL CommonBAL = new CommonBAL();

            user.LastModifiedBy = ((UserBE)Session["LoggedInUser"]).UserId;


            user.UserId           = Convert.ToInt32(hdnUserUpdateId.Value);
            user.UserName         = txtUserName.Text;
            user.FirstName        = txtFirstName.Text;
            user.MiddleName       = txtMiddleName.Text;
            user.LastName         = txtLName.Text;
            user.PrimaryEmailId   = txtPREmailId.Text;
            user.SecondaryEmailId = txtSCEmailID.Text;
            user.MobileNo         = txtMobileNo.Text;
            user.Address1         = txtAddress1.Text;
            user.Address2         = txtAddress2.Text;
            user.Street           = txtStreet.Text;
            user.City             = txtCity.Text;
            user.State1           = txtState.Text;
            user.Country          = txtCountry.Text;
            user.SecretQuest      = txtSecretQuest.Text;
            user.SecretAns        = txtSecretAns.Text;
            user.EncPass          = CommonBAL.Encrypt(txtPass.Text, false);

            if (userBAL.Modify(user))
            {
                lvUserList.EditIndex = -1;
                bindLVUser();
                LoggedIn master = (LoggedIn)this.Master;
                master.ShowMessage("Record Successfully Updated.", true);
            }
            else
            {
                LoggedIn master = (LoggedIn)this.Master;
                master.ShowMessage("Unsuccessful", false);
            }
            recalcNoOfPages();
        }
Exemple #21
0
        public PartialViewResult AddUpdateUserView(int?Id)
        {
            UserDetails userDetails = new UserDetails();
            CommonBAL   bal         = new CommonBAL();

            userDetails.RoleList    = bal.GetRolesList();
            userDetails.ManagerList = bal.GetListOfManagers();
            if (Id == null)
            {
                ViewBag.ModalTitle = "Add User";
            }
            else
            {
                ViewBag.ModalTitle = "Update User";
            }
            return(PartialView(userDetails));
        }
Exemple #22
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string RealPass = txtPass.Text;

            if (ValidData())
            {
                return;
            }

            UserBE    LoggedInUser = new UserBE();
            CommonBAL combal       = new CommonBAL();
            UserBAL   userBAL      = new UserBAL();
            DataTable dt           = new DataTable();

            // Using screen inputs create UserBE;
            LoggedInUser.UserName = txtName.Text;
            LoggedInUser.EncPass  = combal.Encrypt(txtPass.Text, false);
            if (userBAL.Validate(ref LoggedInUser))
            {
                Session["LoggedInUser"] = LoggedInUser;
                if (Session["LoggedInUser"] != null)
                {
                    LoggedInUser.UserId = ((UserBE)Session["LoggedInUser"]).UserId;
                    if (userBAL.UserAccessRight(LoggedInUser, ref dt))
                    {
                        Session["UserAccessRights"] = dt;
                        Response.Redirect(@"~\UserMaint\LoggedInHome.aspx");
                    }
                    //General master = (General)this.Master;
                    //master.ShowMessage("You are not authorised to access this page. Please contact system administrator.", false); //?? Message through Query String
                    ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "CallJS", "alert('You are not authorised to access this page. Please contact system administrator.');", true);
                    return;
                }
            }
            else
            {
                //General master = (General)this.Master;
                //master.ShowMessage("Incorrect Email or Password.", false);
                ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "CallJS", "alert('Incorrect Email or Password.');", true);
                return;
            }
        }
Exemple #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //LoggedInUser = (UserBE)Session["LoggedInUser"];

            //if (LoggedInUser == null)
            //{
            //    if (Session["QuestId"] == null)
            //    {
            //        // return to login page because user has not loggedin or session has timedout...
            //        Response.Redirect("~/Login.aspx");
            //    }
            //    else
            //    {
            //        //coming from QA_SearchQuestionWOLogin.aspx page - i.e. search w/o login - Quick Search click

            //    }
            //}

            if (!IsPostBack)
            {
                if (Session["QuestionId"] != null)
                {
                    CommonBAL commBAL = new CommonBAL();     //am??

                    bool blnTemp = commBAL.QueriesTotalViewCountrIncrement(Convert.ToInt16(Session["QuestionId"]), 0);



                    hdnQuestId.Value = Session["QuestionId"].ToString();
                    //Session["QuestIdWOLogin"] = Session["QuestionId"].ToString();
                    Session["QuestionId"] = null;
                    ShowQuestion();
                    GetAnswers();
                }
                else
                {
                    //CV?
                    //Response.Redirect("~/UserMaint/LoggedInHome.aspx");
                    Response.Redirect("~/QuestAns/QA_HomePageWOLogin.aspx");
                }
            }
        }
Exemple #24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString.Get("UserName") != null && Request.QueryString.Get("Password") != null)
        {
            string username = Request.QueryString.Get("UserName");

            string password = Request.QueryString.Get("Password");

            Response.Redirect(CommonBAL.UserLogin(username, password)
                                    ? "Home.aspx"
                                    : "LoginForm.aspx?Error=true");
        }
        else
        {
            var userprofile = WebCommon.GetUserProfile();

            Response.Redirect((userprofile == null) ? "LoginForm.aspx" : "Home.aspx", true);
            //Sample3
        }
    }
    private void fxGetGLCOAIndSupp()
    {
        try
        {
            IndSupp[] objGLCOAIndSupps = CommonBAL.fxGetGLCOAIndSupp(Request.QueryString);

            if ((objGLCOAIndSupps != null) && objGLCOAIndSupps.Length > 0)
            {
                Response.Write(WebCommon.ToJSON(objGLCOAIndSupps));
            }
            else
            {
                Response.Write("No Result");
            }
        }
        catch (Exception ex)
        {
            Response.Write("Error: " + ex.Message);
        }
    }
Exemple #26
0
        public async Task <ActionResult> ForgotPassword(ForgotPasswordViewModel model)
        {
            if (ModelState.IsValid)
            {
                var user = await UserManager.FindByNameAsync(model.Email);

                if (user == null)
                {
                    // Don't reveal that the user does not exist or is not confirmed
                    ViewBag.Header = "User does not exist!";
                    ViewBag.Error  = "It seems that this Email is not registered with us. Please contact to the administrator.";
                    ViewBag.Class  = "alert alert-warning";
                    return(View("ForgotPasswordConfirmation"));
                }
                else if (!(await UserManager.IsEmailConfirmedAsync(user.Id)))
                {
                    ViewBag.Header = "Email does not confirmed!";
                    ViewBag.Error  = "It seems that your Email does not confirmed please confirm your Email first or contact to the administrator.";
                    ViewBag.Class  = "alert alert-warning";
                    return(View("ForgotPasswordConfirmation"));
                }
                // For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=320771
                // Send an email with this link
                string code = await UserManager.GeneratePasswordResetTokenAsync(user.Id);

                var           callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code }, protocol: Request.Url.Scheme);
                StringBuilder st          = new StringBuilder();
                st.Append("<!DOCTYPE html><html><head><meta charset='utf - 8'/><title>Reset Password</title></head><body><div style='width: 650px; min - height:420px; margin: 0 auto; padding - top:1px; background - color:#1d8e07'><div style='height:auto;margin-left:8px;width:642px;min-height:420px;background-color:#fff'><div style='min-height:250px;padding:30px 35px 30px;margin:0;line-height:1.5em;word-wrap:break-word'><br /><div>Hi " + user.FirstName + ", <br></div><div><br></div><div>We heard that you lost your password. Sorry about that!<br/>But don’t worry! You can use the following link to reset your password:<br></div><div><br></div>");
                st.Append("<div><a style='border: 1px solid #1d8e07;background:#1d8e07;display:inline-block;padding:7px 15px;text-decoration:none;color:#fff' href=\"" + callbackUrl + "\" target='_blank'>Click here to reset</a> <br></div>");
                st.Append("<div><br></div><br /><br /><br /><div>Thanks!<br></div><div><br></div><div>BASE Institution Team,<br></div></div></div></div></body></html>");

                await UserManager.SendEmailAsync(user.Id, CommonBAL.CompanyName() + ": Reset Password", st.ToString());

                ViewBag.Header = "Email sent succesfully!";
                ViewBag.Error  = "Please check your email to reset your password.";
                ViewBag.Class  = "alert alert-success";
                return(View("ForgotPasswordConfirmation"));
            }
            // If we got this far, something failed, redisplay form
            return(View(model));
        }
    private void fxGetGLCOASupplementary()
    {
        try
        {
            //clsGLCOASupplementary[] objGLCOASupplementaries = clsGLBAL.fxGetGLCOASupplementary(Request.QueryString);
            Supp[] objGLCOASupplementaries = CommonBAL.fxGetGLCOASupplementary(Request.QueryString);

            if ((objGLCOASupplementaries != null) && objGLCOASupplementaries.Length > 0)
            {
                Response.Write(WebCommon.ToJSON(objGLCOASupplementaries));
            }
            else
            {
                Response.Write("No Result");
            }
        }
        catch (Exception ex)
        {
            Response.Write("Error: " + ex.Message);
        }
    }
 protected void Generatepassword()
 {
     foreach (GridDataItem dataItem in rgAdminLogIn.Items)
     {
         if (dataItem.OwnerTableView == rgAdminLogIn.MasterTableView)
         {
             Label  lblActivationCode     = (Label)dataItem.FindControl("lblActivationCode");
             Label  lblActivationCodeDisp = (Label)dataItem.FindControl("lblActivationCodeDisp");
             string newActivationCode;
             if ((lblActivationCode.Text != "Not Applicable") && (lblActivationCode.Text != ""))
             {
                 newActivationCode          = new CommonBAL().GenrateNewPassword(lblActivationCode.Text).Substring(0, 4);
                 lblActivationCodeDisp.Text = newActivationCode;
             }
             else
             {
                 lblActivationCodeDisp.Text = "Not Applicable";
             }
         }
     }
 }
        protected string GetEmailMessageHTML(string MessageKey)
        {
            //ForgotPasswordBE user = new ForgotPasswordBE();
            //ForgotPasswordBAL userBAL = new ForgotPasswordBAL();
            CommonBAL        commonBAL = new CommonBAL();
            ForgotPasswordBE forgotBE  = new ForgotPasswordBE();
            // string EmailMessageKey = MessageKey;
            string EmailMessageHTML = "";

            if (commonBAL.GetEmailMessageHTML(MessageKey, ref EmailMessageHTML))
            {
                LoadUserDetails(forgotBE);
                EmailMessageHTML = ReplaceVariale(EmailMessageHTML, forgotBE);


                return(EmailMessageHTML);
            }
            else
            {
                return("");
            }
        }
Exemple #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            LoggedInUser = (UserBE)Session["LoggedInUser"];

            if (LoggedInUser == null)
            {
                // return to login page because user has not loggedin or session has timedout...
                Response.Redirect("~/Login.aspx");
            }

            if (Session["KOId"] != null)                  //am??
            {
                hdnKOID.Value = Session["KOId"].ToString();
                CommonBAL commBAL = new CommonBAL();

                bool blnTemp = commBAL.KOTotalViewCountrIncrement(Convert.ToInt16(Session["KOId"]), (int)LoggedInUser.UserId);

                if (!IsPostBack)
                {
                    retreiveDATA();
                    Session["KOId"] = null;
                }
            }
        }