protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                return;
            }

            LookupUtility.BindUserRoleLookup(ddlRoleSearch, SessionContext);

            FillGrid();
        }
        protected void gridViewList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string[] arg = new string[2];
            arg = e.CommandArgument.ToString().Split(';');

            if (e.CommandName == "EditRow")
            {
                ViewState["UserId"] = Convert.ToString(arg[0]);
                long UserId = Utility.GetLong(ViewState["UserId"]);

                ViewState["Update"] = "Update";

                LookupUtility.BindCompanyLookup(ddlCompany, SessionContext);
                LookupUtility.BindUserRoleLookup(ddlRole, SessionContext);
                LookupUtility.BindDesignationTypeLookup(ddlDesignationType, SessionContext);
                // LookupUtility.BindLocationLookup(ddlLocation, SessionContext);

                UserEntity entity = new HRRepository(SessionContext).GetEmployeeInformationById(UserId);

                //Utility.SetLookupSelectedValue(ddlCompany, Convert.ToString(entity.CompanyId));
                //Utility.SetLookupSelectedValue(ddlRole, Convert.ToString(entity.RoleId));
                //Utility.SetLookupSelectedValue(ddlDesignationType, Convert.ToString(entity.DesignationTypeId));
                //Utility.SetLookupSelectedValue(ddlLocation, Convert.ToString(entity.LocationId));

                //txtEmployeeName.Text = entity.UserName;
                //txtEmployeeCode.Text = entity.EmployeeCode;
                //txtNICNumber.Text = entity.NICNo;

                //txtMobileNumber.Text = entity.MobileNumber;
                //txtEmailId.Text = entity.UserEmailId;
                //txtParmanentAddress.Text = entity.ParmanentAddress;
                //txtPresentAddress.Text = entity.PresentAddress;

                //txtPOCName.Text = entity.POCName;
                //txtPOCMobileNo.Text = entity.POCMobileNo;
                //txtPOCEmailId.Text = entity.POCEmailId;
                //txtPOCParmanentAddress.Text = entity.POCParmanentAddress; ;
                //txtPOCRemark.Text = entity.POCRemark;
                //txtCNICNo.Text = entity.CNICNo;

                //txtPOCPhoneNo.Text = entity.POCPhoneNo;
                //txtPOCRelation.Text = entity.POCRelation;
                //txtPOCPresentAddress.Text = entity.POCPresentAddress;

                ImageUserImage.ImageUrl = entity.PhotoPath;
                chkIsActive.Checked     = entity.IsActive;

                DIVList.Visible   = false;
                DIVDetail.Visible = true;
            }
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            ClearPageControl();

            ViewState["Add"] = "Add";

            chkIsActive.Checked = true;

            LookupUtility.BindCompanyLookup(ddlCompany, SessionContext);
            LookupUtility.BindUserRoleLookup(ddlRole, SessionContext);
            LookupUtility.BindDesignationTypeLookup(ddlDesignationType, SessionContext);
            //  LookupUtility.BindLocationLookup(ddlLocation, SessionContext);

            DIVList.Visible   = false;
            DIVDetail.Visible = true;
        }