Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            btnUpdate.Attributes.Add("onclick", "clcontent();");
            DataSet dsEmployeeList           = new DataSet();
            DataSet dsEmployeePermissionList = new DataSet();

            changeLinks();
            getCompanyName();
            try
            {
                if (!IsPostBack)
                {
                    dropPermission.bindEmployeeCheckbox(chkPermission);//Bind client name  into dropdown
                    lblMsg.Text = "";
                    int employeeId = Convert.ToInt32(Request.QueryString["employeeId"]);
                    dsEmployeeList = dbEditInfo.SelectEmployeeDetails(employeeId);
                    if (dsEmployeeList.Tables.Count > 0)
                    {
                        if (dsEmployeeList != null && dsEmployeeList.Tables.Count > 0 && dsEmployeeList.Tables[0].Rows.Count > 0)
                        {
                            txtFirstName.Text = Convert.ToString(dsEmployeeList.Tables[0].Rows[0]["admin_fname"]);
                            txtLastName.Text  = Convert.ToString(dsEmployeeList.Tables[0].Rows[0]["admin_lname"]);
                            txtEmail.Text     = Convert.ToString(dsEmployeeList.Tables[0].Rows[0]["admin_email"]);
                            //string strPass1 = EncryptDecrypt.encryptPassword(Convert.ToString(dsEmployeeList.Tables[0].Rows[0]["admin_password"]));
                            //string strPass = EncryptDecrypt.decryptPassword(Convert.ToString(dsEmployeeList.Tables[0].Rows[0]["admin_password"]));
                            string strPass1 = Convert.ToString(dsEmployeeList.Tables[0].Rows[0]["admin_password"]);
                            string strPass  = Convert.ToString(dsEmployeeList.Tables[0].Rows[0]["admin_password"]);
                            txtPassword.Text = strPass;
                            ViewState["EmployeePassword"] = strPass;
                            dsEmployeePermissionList      = dbEditInfo.SelectEmployeePermissionDetails(employeeId);
                            if (dsEmployeePermissionList.Tables.Count > 0)
                            {
                                if (dsEmployeePermissionList != null && dsEmployeePermissionList.Tables.Count > 0 && dsEmployeePermissionList.Tables[0].Rows.Count > 0)
                                {
                                    for (int intEmpPermission = 0; intEmpPermission < chkPermission.Items.Count; intEmpPermission++)
                                    {
                                        for (int intEmployee = 0; intEmployee < dsEmployeePermissionList.Tables[0].Rows.Count; intEmployee++)
                                        {
                                            if (Convert.ToInt32(chkPermission.Items[intEmpPermission].Value) == Convert.ToInt32(dsEmployeePermissionList.Tables[0].Rows[intEmployee]["permissions_id"]))
                                            {
                                                chkPermission.Items[intEmpPermission].Selected = true;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     btnAdd.Attributes.Add("onclick", "clcontent();");
     changeLinks();
     getCompanyName();
     if (!IsPostBack)
     {
         dropPermission.bindEmployeeCheckbox(chkPermission);//Bind client name  into dropdown
         lblMsg.Text = "";
     }
 }