protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                txtempname.Text = Session["candName"].ToString();

                txtloc.Text  = Session["loc"].ToString();
                txtgend.Text = Session["Gender"].ToString();

                var dateTimeNow = DateTime.Parse(Session["DOB"].ToString());
                txtdob.Text = dateTimeNow.ToShortDateString();

                var dateTimeNow1 = DateTime.Parse(Session["DOJ"].ToString());
                txtdoj.Text = dateTimeNow1.ToShortDateString();
                txtPid.Text = Session["ProjectID"].ToString();

                if (!IsPostBack)
                {
                    IEmployeeBLL objEmpBLL = EmployeeFactoryBLL.createEmployeeBLL();
                    List <int>   list1     = objEmpBLL.getUnitHeadID();
                    ddlunithead.DataSource = list1;
                    ddlunithead.DataBind();
                    ddlunithead.Items.Insert(0, "--Select--");
                }
            }


            catch (Exception)
            {
            }
        }
Esempio n. 2
0
        protected void BtnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                string       empName     = txtEmpName.Text;
                string       designation = txtdesignation.Text;
                Int32        ctc         = Convert.ToInt32(txtctc.Text);
                Int32        unitHead    = Convert.ToInt32(txtUnitHead.Text);
                IEmployeeBO  objBo       = EmployeeBOFactory.createEmployeeBO(empName, designation, ctc, unitHead);
                IEmployeeBLL objBll      = EmployeeFactoryBLL.createEmployeeBLL();
                int          res         = objBll.editEmployees(objBo);

                if (res > 0)
                {
                    Response.Write("<script>if(confirm('Employee Details Updated  Successfully.')){document.location='EditEmployeeDetails.aspx';}</script>");
                }
                else
                {
                    Response.Write("<script>if(confirm('Employee not Details Updated  Successfully.')){document.location='EditEmployeeDetails.aspx';}</script>");
                }
            }
            catch (Exception)
            {
            }
        }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         IEmployeeBLL objEmpBLL = EmployeeFactoryBLL.createEmployeeBLL();
         List <int>   list      = objEmpBLL.getEmployeeID();
         ddlEmpID.DataSource = list;
         ddlEmpID.DataBind();
         ddlEmpID.Items.Insert(0, "--Select--");
     }
 }
Esempio n. 4
0
        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                LblEmpID.Visible       = true;
                LblEmpName.Visible     = true;
                LblDesgn.Visible       = true;
                LblCTC.Visible         = true;
                LblUnitHeadID.Visible  = true;
                txtEmpID.Visible       = true;
                txtEmpName.Visible     = true;
                txtdesignation.Visible = true;
                txtctc.Visible         = true;
                rectc.Visible          = true;
                redesignation.Visible  = true;
                rfvctc.Visible         = true;
                rfvdesignation.Visible = true;

                txtUnitHead.Visible = true;
                BtnUpdate.Visible   = true;
                BtnCancel.Visible   = true;
                BtnSubmit.Visible   = false;
                LblEmpID1.Visible   = false;
                ddlEmpID.Visible    = false;
                int id = Convert.ToInt32(ddlEmpID.SelectedValue);

                Session["empid"] = ddlEmpID.SelectedValue;
                txtEmpID.Text    = Session["empid"].ToString();
                IEmployeeBO  objBo  = EmployeeBOFactory.createEmployeeBO(id);
                IEmployeeBLL objBll = EmployeeFactoryBLL.createEmployeeBLL();
                txtEmpName.Text = objBll.getEmpName(id);

                txtUnitHead.Text    = Convert.ToString(objBll.getUnitHeadId(id));
                txtctc.Text         = Convert.ToString(objBll.getctc(id));
                txtdesignation.Text = objBll.getDesignation(id);

                txtUnitHead.DataBind();

                txtEmpName.DataBind();
                ddlEmpID.Items.Insert(0, "--Select--");
            }
            catch (Exception)
            {
            }
        }
Esempio n. 5
0
        protected void bindData()
        {
            try
            {
                for (int i = 0; i < 5; i++)
                {
                    List <IEmployeeBO> list   = EmployeeBOFactory.createEmployeeBO();
                    IEmployeeBLL       objBLL = EmployeeFactoryBLL.createEmployeeBLL();
                    list = objBLL.ViewEmployee();
                    grdEmployee.DataSource = list;

                    if (list.Count != 0)
                    {
                        grdEmployee.DataBind();
                    }
                    else
                    {
                        this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Employee Doesnot Exit')", true);
                    }
                }
            }catch (Exception)
            { }
        }