예제 #1
0
        protected void Reactivate_Employee_Click(object sender, EventArgs e)
        {
            try
            {
                this.message.CssClass = "errorMessage";
                this.message.Visible  = true;
                if (Page.IsValid == true)
                {
                    DataSet _DataList = null;
                    _DataList = DatabaseManager.Data.DBAccessManager.ReactivateEmployee(Tab1_EmployeeID.Text.ToString(), Int32.Parse(Page.User.Identity.Name.ToString()));
                    if (_DataList.Tables[0].Rows.Count > 0)
                    {
                        String  Result, EmployeeName, EmpEmail, Password;
                        DataRow _DataRow = _DataList.Tables[0].Rows[0];
                        Result = _DataRow["Result"].ToString();


                        if (Result == "")
                        {
                            EmployeeName = _DataRow["EmployeeName"].ToString();
                            EmpEmail     = _DataRow["EmpEmail"].ToString();
                            Password     = SchoolNetBase.DecodeFrom64(_DataRow["EmpPwd"].ToString());
                            if (EmpEmail != "")
                            {
                                EmployeePasswordResetNotification(EmployeeName, EmpEmail, Password);
                            }

                            this.message.Text = "Employee Profile has been successfully reactivated from HRM system.";
                            ResetFields();
                        }
                        else
                        {
                            this.message.Text = Result;
                        }
                    }
                }
                else
                {
                    this.message.Text = "Error:Could not save the information. Please check the inputs";
                }
            }
            catch (Exception exception)
            {
                this.message.Visible  = true;
                this.message.Text     = ErrorLogging.LogError(exception, "Unknown Exception Occured. Please contact support.");
                this.message.CssClass = "errorMessage";
            }
        }
예제 #2
0
 private void Tab3_Submit_Click(object sender, EventArgs e)
 {
     try
     {
         if (Page.IsValid == true)
         {
             DataSet _DataList = null;
             _DataList = DatabaseManager.Data.DBAccessManager.RetrievePassword(this.Tab3_Emailaddress.Text.ToString().Trim());
             if (_DataList.Tables.Count > 0)
             {
                 if (_DataList.Tables[0].Rows.Count > 0) // Member Login Information
                 {
                     DataRow _DataRow     = _DataList.Tables[0].Rows[0];
                     string  userName     = _DataRow["userName"].ToString();
                     string  emailAddress = _DataRow["Work_Email"].ToString();
                     string  password     = SchoolNetBase.DecodeFrom64(_DataRow["Password"].ToString());
                     string  employeeName = _DataRow["EmployeeName"].ToString();
                     SendPasswordRetrieveMail(employeeName, userName, emailAddress, password);
                 }
                 else
                 {
                     this.errorMessage.Visible  = true;
                     this.errorMessage.Text     = "Sorry, We could not find your email address.Please check your email address again.";
                     this.errorMessage.CssClass = "errorMessage";
                     //  this.Reset_Click(sender,e);
                 }
             }
             else
             {
                 this.errorMessage.Visible  = true;
                 this.errorMessage.Text     = "Sorry, We could not find your email address.Please check your email address again.";
                 this.errorMessage.CssClass = "errorMessage";
                 //  this.Reset_Click(sender,e);
             }
         }
     }
     catch (Exception exception)
     {
         this.errorMessage.Visible  = true;
         this.errorMessage.Text     = ErrorLogging.LogError(exception, "Unknown Exception Occured.Please contact Support.");
         this.errorMessage.CssClass = "errorMessage";
     }
 }