protected void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                IEmployeeBLL objEmployeeMng = EmployeeFactoryBLL.createEmployeeBLobj();
                IEmployeeBO  objEmployee    = EmployeeBOFactory.createEmpBO();
                objEmployee.EmployeeName = txtempname.Text;
                objEmployee.DOJ          = DateTime.Parse(txtdoj.Text);
                objEmployee.DOB          = DateTime.Parse(txtdob.Text);
                objEmployee.Location     = txtloc.Text;
                objEmployee.Gender       = txtgend.Text;
                objEmployee.CTC          = Convert.ToInt32(txtctc.Text);
                objEmployee.Designation  = txtdesignation.Text;
                objEmployee.UnitHeadID   = Convert.ToInt32(ddlunithead.SelectedValue);

                objEmployee.ProjectId = 100001;
                int           ID    = objEmployeeMng.addEmployee(objEmployee);
                int           id    = Int32.Parse(Session["CandID"].ToString());
                ICandidateBLL obj   = CandidateFactoryBLL.createCandidateBLobj();
                ICandidateBO  objBo = CandidateFactoryBO.createEmployeeBO(id);

                obj.deleteCandidate(id);
                Response.Write("<script>if(confirm('Details Submitted Successfully.    Employee ID :" + ID + "')){document.location='AddSelectedCandidates_HR.aspx';}</script>");
            }

            catch (Exception)
            { }
        }
示例#2
0
        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            try
            {
                GridViewRow  row    = GridView1.Rows[e.RowIndex];
                ICandidateBO objBO  = FactoryBO.CandidateFactoryBO.CreateCandidate();
                HiddenField  hdnfld = (HiddenField)row.FindControl("hdnField");
                objBO.CandidateProfileID = Convert.ToInt32(hdnfld.Value);
                DropDownList ddlBGCStatus = (DropDownList)row.FindControl("DDlBGCStatus");
                objBO.BGCTestStatus = ddlBGCStatus.SelectedItem.Text;
                TextBox txtRemarks = (TextBox)row.FindControl("TextBoxRemarks");
                objBO.Remarks = txtRemarks.Text;

                // List<ICandidateBO> ListObjBO = new List<ICandidateBO>();
                IBGCUpdatesBLL objBLL = FactoryBLL.BGCUpdatesFactoryBLL.CreateUpdatesBLL();
                int            ret    = objBLL.UpdateBGCStatus_AdminBLL(objBO);
                if (ret > 0)
                {
                    Response.Write("<script>alert('Updated Successfully')</script>");
                }
                else
                {
                    Response.Write("<script>alert('Error')</script>");
                }
                GridView1.EditIndex = -1;
                bindBGCStatus();
                //GridView1.DataSource = ListObjBO;
                //GridView1.DataBind();
            }
            catch (Exception ex)
            {
                Response.Write("<script>alert('Exception: " + ex.Message + "');window.location ='Login1.aspx';</script>");
            }
        }
示例#3
0
        protected void grdaddemp_RowEditing1(object sender, GridViewEditEventArgs e)
        {
            GridViewRow row = grdaddemp.Rows[e.NewEditIndex];

            Label lblid = (Label)row.FindControl("Label1");

            Session["CandID"] = lblid.Text;
            int id = Convert.ToInt32(lblid.Text);


            Label lblname = (Label)row.FindControl("Label2");

            Session["candName"] = lblname.Text;
            string name = lblname.Text;

            Label lblloc = (Label)row.FindControl("Label4");

            Session["loc"] = lblloc.Text;
            string loc = lblloc.Text;

            ICandidateBLL obj   = CandidateFactoryBLL.createCandidateBLobj();
            ICandidateBO  objBo = CandidateFactoryBO.createEmployeeBO(id);

            Session["DOB"] = Convert.ToString(obj.getDob(id));

            Session["Gender"]    = obj.getGender(id);
            Session["DOJ"]       = Convert.ToString(obj.getDoj(id));
            Session["ProjectID"] = Convert.ToString(obj.getProjectID(id));

            Response.Redirect("AddEmployeeDetails_HR.aspx");
            grdaddemp.EditIndex = -1;
        }
示例#4
0
 public int UpdateBGCStatus_AdminBLL(ICandidateBO objBO)
 {
     try
     {
         IBGCUpdatesDAL objDAL  = FactoryDAL.BGCUpdatesFactoryDAL.CreateUpdatesDAL();
         int            success = objDAL.UpdateBGCStatus_AdminDAL(objBO);
         return(success);
     }
     catch { throw; }
 }
示例#5
0
        public int UpdateBGCStatus_AdminDAL(ICandidateBO objBO)
        {
            try
            {
                int           testValue;
                SqlConnection conn = new SqlConnection();
                string        str  = ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
                conn.ConnectionString = str;
                conn.Open();
                SqlCommand comm = new SqlCommand();
                comm.CommandType = CommandType.StoredProcedure;
                comm.CommandText = "UpdateBGCStatus_admin";
                comm.Connection  = conn;
                comm.Parameters.AddWithValue("@Candidate_profile_ID", objBO.CandidateProfileID);

                if (objBO.BGCTestStatus == "Cleared")
                {
                    testValue = 1;
                }
                else if (objBO.BGCTestStatus == "Rejected")
                {
                    testValue = 2;
                }
                else
                {
                    testValue = 0;
                }

                comm.Parameters.AddWithValue("@BGCTest_Status", testValue);
                comm.Parameters.AddWithValue("@Remarks", objBO.Remarks);
                int rows = comm.ExecuteNonQuery();
                return(rows);
            }
            catch
            {
                throw;
            }
        }
 private void DataBind()
 {
     ICandidateBLL objCandMng = CandidateFactoryBLL.createCandidateBLobj();
     ICandidateBO  objCandBO  = CandidateFactoryBO.createCandBO();
     //ddlunithead.Items.Insert(0, "--Select--");
 }
示例#7
0
        public List <ICandidateBO> ViewCandidates_HR()
        {
            try
            {
                //List<ICandidateBO> candidateList = new List<ICandidateBO>();
                List <ICandidateBO> candidateList = new List <ICandidateBO>();

                SqlConnection conn = new SqlConnection();
                string        str  = ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
                conn.ConnectionString = str;
                conn.Open();
                SqlCommand comm = new SqlCommand();
                comm.CommandType = CommandType.StoredProcedure;
                comm.CommandText = "ViewBGCStatus_HR";
                comm.Connection  = conn;
                SqlDataReader reader = comm.ExecuteReader();
                while (reader.Read())
                {
                    ICandidateBO objBO = FactoryBO.CandidateFactoryBO.CreateCandidate();
                    objBO.CandidateProfileID = Convert.ToInt32(reader["Candidate_profile_ID"]);
                    int testStatus = Convert.ToInt32(reader["TestStatus"]);
                    if (testStatus >= 5)
                    {
                        objBO.TestStatus = "Cleared";
                    }
                    else
                    {
                        objBO.TestStatus = "Not Cleared";
                    }

                    int BGCTestStatus = Convert.ToInt32(reader["BGCTest_Status"]);
                    if (BGCTestStatus == 1)
                    {
                        objBO.BGCTestStatus = "Cleared";
                        objBO.Remarks       = "NA";
                    }
                    else if (BGCTestStatus == 2)
                    {
                        objBO.BGCTestStatus = "Rejected";
                        objBO.Remarks       = Convert.ToString(reader["Remarks"]);
                    }
                    else if (BGCTestStatus == 0)
                    {
                        objBO.BGCTestStatus = "Pending";
                        objBO.Remarks       = "NA";
                    }
                    else
                    {
                        objBO.BGCTestStatus = "Pending";
                        objBO.Remarks       = "NA";
                    }
                    candidateList.Add(objBO);
                }
                conn.Close();
                return(candidateList);
            }
            catch
            {
                throw;
            }
        }
示例#8
0
        public List <ICandidateBO> EditBGCStatus_AdminDAL(int user)
        {
            try
            {
                // int adminId = Convert.ToInt32(Session["BGCAdministratorID"]);
                //List<ICandidateBO> candidateList = new List<ICandidateBO>();
                List <ICandidateBO> candidateList = new List <ICandidateBO>();

                SqlConnection conn = new SqlConnection();
                string        str  = ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
                conn.ConnectionString = str;
                conn.Open();
                SqlCommand comm = new SqlCommand();
                comm.CommandType = CommandType.StoredProcedure;
                comm.CommandText = "displayBGCStatus_admin1";
                comm.Parameters.AddWithValue("@userID", user);
                // comm.Parameters.AddWithValue("", );
                comm.Connection = conn;
                SqlDataReader reader = comm.ExecuteReader();
                while (reader.Read())
                {
                    ICandidateBO objBO = FactoryBO.CandidateFactoryBO.CreateCandidate();
                    objBO.CandidateProfileID = Convert.ToInt32(reader["Candidate_profile_ID"]);
                    objBO.VacancyID          = Convert.ToInt32(reader["Vacancy_ID"]);
                    objBO.BGCTestID          = Convert.ToInt32(reader["BGCTest_ID"]);
                    int testStatus = Convert.ToInt32(reader["TestStatus"]);
                    if (testStatus >= 5)
                    {
                        objBO.TestStatus = "Cleared";
                    }
                    else
                    {
                        objBO.TestStatus = "Not Cleared";
                    }

                    int BGCTestStatus = Convert.ToInt32(reader["BGCTest_Status"]);
                    //if (BGCTestStatus == 0)
                    //{
                    //    objBO.BGCTestStatus = "Pending";
                    //    objBO.Remarks = "NA";
                    //}
                    //else
                    //{
                    //    objBO.BGCTestStatus = "Rejected";
                    //    objBO.Remarks = Convert.ToString(reader["Remarks"]);
                    //}
                    if (BGCTestStatus == 1)
                    {
                        objBO.BGCTestStatus = "Cleared";
                        objBO.Remarks       = "NA";
                    }
                    else if (BGCTestStatus == 2)
                    {
                        objBO.BGCTestStatus = "Rejected";
                        objBO.Remarks       = Convert.ToString(reader["Remarks"]);
                    }
                    else if (BGCTestStatus == 0)
                    {
                        objBO.BGCTestStatus = "Pending";
                        objBO.Remarks       = "NA";
                    }
                    else
                    {
                        objBO.BGCTestStatus = "Pending";
                        objBO.Remarks       = "NA";
                    }

                    candidateList.Add(objBO);
                }
                conn.Close();
                return(candidateList);
            }
            catch
            {
                throw;
            }
        }