protected ArrayList GenerateEmailAddress(Int64 EmployeeID)
    {
        ArrayList AlistEmailID = new ArrayList();
        DataSet   dsEmail      = new DataSet();

        EmployeeBlogic = new Employee_BLogic();
        try
        {
            dsEmail = EmployeeBlogic.SelectEmployeeDetailByEmployeeID(EmployeeID);
            if (dsEmail != null & dsEmail.Tables.Count > 0)
            {
                if (dsEmail.Tables[0].Rows.Count > 0)
                {
                    AlistEmailID.Add(dsEmail.Tables[0].Rows[0]["EmailID"].ToString());
                    ViewState["TempEmp"] = dsEmail.Tables[0].Rows[0]["FirstName"].ToString();
                }
            }
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
        return(AlistEmailID);
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Page.Title = "Manage User";

            string          IFormat          = "dd-MMM-yyyy";
            SYS_Role_BLogic obj_BAL_SYS_Role = new SYS_Role_BLogic();
            DataSet         dsSelect         = new DataSet();
            dsSelect = obj_BAL_SYS_Role.BAL_SYS_Role_SelectAll();

            if (Session["RoleID"].ToString() == Convert.ToString((int)EnumFile.Role.E_Admin))
            {
                //EAdmin
                foreach (DataRow dr in dsSelect.Tables[0].Rows)
                {
                    if ((Convert.ToString(dr["RoleID"]) == "2") || Convert.ToString(dr["RoleID"]) == "3")
                    {
                        ListItem oList = new ListItem(Convert.ToString(dr["Role"]), Convert.ToString(dr["RoleID"]));
                        ddlRole.Items.Add(oList);
                    }
                }
            }
            else if (Session["RoleID"].ToString() == Convert.ToString((int)EnumFile.Role.S_Admin))
            {
                //SAdmin
                foreach (DataRow dr in dsSelect.Tables[0].Rows)
                {
                    if (Convert.ToString(dr["RoleID"]) == "3")
                    {
                        ListItem oList = new ListItem(Convert.ToString(dr["Role"]), Convert.ToString(dr["RoleID"]));
                        ddlRole.Items.Add(oList);
                    }
                }
            }
            //ddlRole.DataSource = dsSelect.Tables[0];
            //ddlRole.DataTextField = "Role";
            //ddlRole.DataValueField = "RoleID";
            //ddlRole.DataBind();

            ddlRole.Items.Insert(((int)EnumFile.AssignValue.Zero), new ListItem("-- Select --", "0"));

            if (Request.QueryString["Employeeid"] != "0" & Request.QueryString["Employeeid"] != null)
            {
                this.ViewState["Employeeid"] = Request.QueryString["Employeeid"];

                ArrayList AlistEmailID = new ArrayList();
                DataSet   dsEmail      = new DataSet();
                BAL_Employee = new Employee_BLogic();
                try
                {
                    dsEmail = BAL_Employee.SelectEmployeeDetailByEmployeeID(Convert.ToInt64(this.ViewState["Employeeid"]));
                    if (dsEmail != null & dsEmail.Tables.Count > 0)
                    {
                        if (dsEmail.Tables[0].Rows.Count > 0)
                        {
                            //EmployeeID, Code, RoleID, SchoolID, FirstName, MiddleName, LastName, Gender, DateOfBirth, BloodGroup, Address, EmailID, ContactNo, Qualification,
                            // Designation, SecurityQuestion, SecurityAnswer, LoginID, Password, Image, LastLoginDate, AttemptCount, IsActive, CreatedOn, CreatedBy, ModifiedOn,
                            // ModifiedBy, AllowMultipleSession
                            ddlRole.SelectedValue       = Convert.ToString(dsEmail.Tables[0].Rows[0]["RoleID"]);
                            txtAddFirstName.Text        = Convert.ToString(dsEmail.Tables[0].Rows[0]["FirstName"]);
                            txtAddMiddleName.Text       = Convert.ToString(dsEmail.Tables[0].Rows[0]["MiddleName"]);
                            txtAddLastName.Text         = Convert.ToString(dsEmail.Tables[0].Rows[0]["LastName"]);
                            rlstAddGender.SelectedValue = Convert.ToString(dsEmail.Tables[0].Rows[0]["Gender"]);
                            DateTime dt;
                            if (DateTime.TryParse(Convert.ToString(dsEmail.Tables[0].Rows[0]["DateOfBirth"]), out dt))
                            {
                                txtAddDOB.Text = dt.ToString(IFormat);
                            }
                            txtAddBloodGroup.Text       = Convert.ToString(dsEmail.Tables[0].Rows[0]["BloodGroup"]);
                            txtAddPermanentAddress.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["Address"]);
                            txtAddEmail.Text            = Convert.ToString(dsEmail.Tables[0].Rows[0]["EmailID"]);
                            txtAddContactNumber.Text    = Convert.ToString(dsEmail.Tables[0].Rows[0]["ContactNo"]);
                            txtAddQualification.Text    = Convert.ToString(dsEmail.Tables[0].Rows[0]["Qualification"]);
                            txtAddDesignation.Text      = Convert.ToString(dsEmail.Tables[0].Rows[0]["Designation"]);
                            tLoginId.Text    = Convert.ToString(dsEmail.Tables[0].Rows[0]["LoginID"]);
                            hdnLoginid.Value = Convert.ToString(dsEmail.Tables[0].Rows[0]["LoginID"]);
                            lblAddTitle.Text = "Update User: " + txtAddFirstName.Text;
                        }
                    }
                }
                catch (Exception ex)
                {
                    WebMsg.Show(ex.Message);
                }
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Page.Title = "Update Pofile";

            string IFormat = "dd-MMM-yyyy";

            if (Session["RoleID"].ToString() == Convert.ToString((int)EnumFile.Role.E_Admin))
            {
                lblRole.Text = "E-Admin";
            }
            else if (Session["RoleID"].ToString() == Convert.ToString((int)EnumFile.Role.S_Admin))
            {
                lblRole.Text = "S-Admin";
            }
            else if (Session["RoleID"].ToString() == Convert.ToString((int)EnumFile.Role.Teacher))
            {
                lblRole.Text = "Teacher";
            }

            if (Request.QueryString["Employeeid"] != "0" & Request.QueryString["Employeeid"] != null)
            {
                this.ViewState["Employeeid"] = AppSessions.EmpolyeeID;

                ArrayList AlistEmailID = new ArrayList();
                DataSet   dsEmail      = new DataSet();
                BAL_Employee = new Employee_BLogic();
                try
                {
                    dsEmail = BAL_Employee.SelectEmployeeDetailByEmployeeID(Convert.ToInt64(this.ViewState["Employeeid"]));
                    if (dsEmail != null & dsEmail.Tables.Count > 0)
                    {
                        if (dsEmail.Tables[0].Rows.Count > 0)
                        {
                            //EmployeeID, Code, RoleID, SchoolID, FirstName, MiddleName, LastName, Gender, DateOfBirth, BloodGroup, Address, EmailID, ContactNo, Qualification,
                            // Designation, SecurityQuestion, SecurityAnswer, LoginID, Password, Image, LastLoginDate, AttemptCount, IsActive, CreatedOn, CreatedBy, ModifiedOn,
                            // ModifiedBy, AllowMultipleSession
                            txtAddFirstName.Text        = Convert.ToString(dsEmail.Tables[0].Rows[0]["FirstName"]);
                            txtAddMiddleName.Text       = Convert.ToString(dsEmail.Tables[0].Rows[0]["MiddleName"]);
                            txtAddLastName.Text         = Convert.ToString(dsEmail.Tables[0].Rows[0]["LastName"]);
                            rlstAddGender.SelectedValue = Convert.ToString(dsEmail.Tables[0].Rows[0]["Gender"]);
                            DateTime dt;
                            if (DateTime.TryParse(Convert.ToString(dsEmail.Tables[0].Rows[0]["DateOfBirth"]), out dt))
                            {
                                txtAddDOB.Text = dt.ToString(IFormat);
                            }
                            txtAddBloodGroup.Text       = Convert.ToString(dsEmail.Tables[0].Rows[0]["BloodGroup"]);
                            txtAddPermanentAddress.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["Address"]);
                            txtAddEmail.Text            = Convert.ToString(dsEmail.Tables[0].Rows[0]["EmailID"]);
                            txtAddContactNumber.Text    = Convert.ToString(dsEmail.Tables[0].Rows[0]["ContactNo"]);
                            txtAddQualification.Text    = Convert.ToString(dsEmail.Tables[0].Rows[0]["Qualification"]);
                            txtAddDesignation.Text      = Convert.ToString(dsEmail.Tables[0].Rows[0]["Designation"]);
                            tLoginId.Text    = Convert.ToString(dsEmail.Tables[0].Rows[0]["LoginID"]);
                            hdnLoginid.Value = Convert.ToString(dsEmail.Tables[0].Rows[0]["LoginID"]);
                            lblAddTitle.Text = "Update Profile: " + txtAddFirstName.Text;
                        }
                    }
                }
                catch (Exception ex)
                {
                    WebMsg.Show(ex.Message);
                }
            }
        }
    }