Exemplo n.º 1
0
        private void BindTextBoxvalues()
        {
            try
            {
                if (!string.IsNullOrEmpty(Request.QueryString["JoinerId"]))
                {
                    NewJoinerID = Convert.ToInt32(Request.QueryString["JoinerId"]);
                }
                CPT_NewJoiners newJoiners = new CPT_NewJoiners();
                newJoiners.NewJoinerID = NewJoinerID;
                NewJoinersBL          newJoinersBL = new NewJoinersBL();
                List <CPT_NewJoiners> lst          = newJoinersBL.uiDataBinding(newJoiners);

                firstNameTextBox.Text    = lst[0].Name;
                listDesignation.Text     = (lst[0].DesignationID.ToString());
                dojTextBox.Text          = (Convert.ToDateTime(lst[0].JoiningDate).ToShortDateString()).ToString();
                baseLocationTextBox.Text = lst[0].Location;
                interviewedTextBox.Text  = lst[0].InterviewedBy;
                expTextBox.Text          = lst[0].Experience;
                accountDropDownList.Text = lst[0].Account.ToString();
                skillListDD.Text         = lst[0].Skills.ToString();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
Exemplo n.º 2
0
        protected void NewJoinerButton_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["JoinerId"]))
            {
                NewJoinerID = Convert.ToInt32(Request.QueryString["JoinerId"]);
            }



            CPT_NewJoiners cPT_NewJoiners = new CPT_NewJoiners();

            cPT_NewJoiners.NewJoinerID   = NewJoinerID;
            cPT_NewJoiners.Name          = firstNameTextBox.Text.Trim();
            cPT_NewJoiners.DesignationID = Convert.ToInt32(listDesignation.SelectedValue);
            cPT_NewJoiners.JoiningDate   = (Convert.ToDateTime(dojTextBox.Text.Trim()));
            cPT_NewJoiners.Location      = baseLocationTextBox.Text.Trim();
            cPT_NewJoiners.Skills        = Convert.ToInt32(skillListDD.SelectedValue);
            cPT_NewJoiners.InterviewedBy = interviewedTextBox.Text.Trim();
            cPT_NewJoiners.Experience    = expTextBox.Text.Trim();
            cPT_NewJoiners.Account       = Convert.ToInt32(accountDropDownList.SelectedValue);
            NewJoinersBL newJoinersBL = new NewJoinersBL();

            newJoinersBL.Update(cPT_NewJoiners);
            Response.Redirect("NewJoiners.aspx");
        }
        private void BindTextBoxvalues()
        {
            try
            {
                if (!string.IsNullOrEmpty(Request.QueryString["JoinerId"]))
                {
                    NewJoinerID = Convert.ToInt32(Request.QueryString["JoinerId"]);
                }
                CPT_NewJoiners newJoiners = new CPT_NewJoiners();
                newJoiners.NewJoinerID = NewJoinerID;
                NewJoinersBL newJoinersBL = new NewJoinersBL();
                lst = newJoinersBL.uiDataBinding(newJoiners);


                fName.Text           = lst[0].Name;
                listDesignation.Text = lst[0].DesignationID.ToString();
                dojoining.Text       = (Convert.ToDateTime(lst[0].JoiningDate)).ToShortDateString().ToString();
                bLocation.Text       = lst[0].Location;
                expText.Text         = lst[0].Experience;
                listSkillDD.Text     = lst[0].Skills.ToString();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
Exemplo n.º 4
0
        protected void DeleteButton_Click(object sender, EventArgs e)
        {
            CPT_NewJoiners newJoiners = new CPT_NewJoiners();

            LinkButton lb = sender as LinkButton;

            jID  = Convert.ToInt32(lb.Attributes["joinerID"]);
            name = lb.Attributes["joinerName"];
            newJoiners.NewJoinerID = jID;
            Email();
            NewJoinersBL newJoinersBL = new NewJoinersBL();

            newJoinersBL.Delete(newJoiners);


            BindGrid();
        }
        protected void NewJoinerButton_Click(object sender, EventArgs e)
        {
            try
            {
                CPT_NewJoiners cPT_NewJoiners = new CPT_NewJoiners();
                cPT_NewJoiners.Account       = Convert.ToInt32(accountDropDownList.SelectedValue);
                cPT_NewJoiners.DesignationID = Convert.ToInt32(listDesignation.SelectedValue);
                cPT_NewJoiners.Experience    = expTextBox.Text.Trim();
                cPT_NewJoiners.Name          = firstNameTextBox.Text.Trim();

                cPT_NewJoiners.InterviewedBy = interviewedTextBox.Text.Trim();
                cPT_NewJoiners.JoiningDate   = Convert.ToDateTime(dojTextBox.Text.Trim());
                cPT_NewJoiners.Skills        = Convert.ToInt32(skillListDD.SelectedValue);
                cPT_NewJoiners.Location      = baseLocationTextBox.Text.Trim();

                NewJoinersBL newJoinersBL = new NewJoinersBL();
                newJoinersBL.Insert(cPT_NewJoiners);
                Response.Redirect("NewJoiners.aspx");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        protected void AddEmployee_Click(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(Request.QueryString["JoinerId"]))
                {
                    NewJoinerID = Convert.ToInt32(Request.QueryString["JoinerId"]);
                }
                if (FileUploadControl.HasFile)
                {
                    FileUploadControl.SaveAs(@"C:\Users\raian\Downloads\Data\" + FileUploadControl.FileName);
                }
                List <CPT_ResourceMaster> lstdetils = new List <CPT_ResourceMaster>();
                lstdetils = (List <CPT_ResourceMaster>)Session["UserDetails"];
                CPT_ResourceMaster employeeDetails = new CPT_ResourceMaster();


                CPT_NewJoiners newJoiners = new CPT_NewJoiners();
                newJoiners.NewJoinerID = NewJoinerID;
                NewJoinersBL newJoinersBL = new NewJoinersBL();

                lst      = newJoinersBL.uiDataBinding(newJoiners);
                name     = lst[0].Name;
                location = lst[0].Location;
                doj      = Convert.ToDateTime(lst[0].JoiningDate).ToShortDateString().ToString();
                des      = (int)lst[0].DesignationID;
                desig    = newJoinersBL.getdesignationByID(des);
                mgr      = Convert.ToInt32(RManagerDropDownList.Text);
                rmgr     = newJoinersBL.getManagerByID(mgr);
                eml      = mail.Text;
                phn      = phone.Text;

                employeeDetails.EmployeeMasterID = Convert.ToInt32(empIdText.Text.Trim());

                employeeDetails.EmployeetName      = fName.Text;
                employeeDetails.Photo              = @"C:\Users\raian\Downloads\Data\" + FileUploadControl.FileName.ToString();
                employeeDetails.ReportingManagerID = Convert.ToInt32(RManagerDropDownList.Text.Trim());
                employeeDetails.Email              = mail.Text.Trim();
                employeeDetails.EmployeePassword   = pass.Text.Trim();
                employeeDetails.BaseLocation       = bLocation.Text.Trim();
                employeeDetails.Mobile             = phone.Text.Trim();
                employeeDetails.DesignationID      = Convert.ToInt32(listDesignation.SelectedValue);
                employeeDetails.RolesID            = Convert.ToInt32(listRole.SelectedValue);
                employeeDetails.JoiningDate        = Convert.ToDateTime(dojoining.Text.Trim());
                if (employeeDetails.PAN != "")
                {
                    employeeDetails.PAN = panNoTxt.Text.Trim();
                }
                if (employeeDetails.Skillsid != "")
                {
                    employeeDetails.Skillsid = listSkillDD.SelectedValue;
                }
                if (employeeDetails.Address != "")
                {
                    employeeDetails.Address = addressTxt.Text.Trim();
                }
                if (employeeDetails.PriorWorkExperience != null)
                {
                    employeeDetails.PriorWorkExperience = (float)Convert.ToDouble(expText.Text.Trim());
                }
                if (employeeDetails.PassportNo != "")
                {
                    employeeDetails.PassportNo = passportNum.Text.Trim();
                }
                if (employeeDetails.PassportExpiryDate != null)
                {
                    employeeDetails.PassportExpiryDate = Convert.ToDateTime(passExpDate.Text.Trim().ToString());
                }
                if (employeeDetails.VisaExpiryDate != null)
                {
                    employeeDetails.VisaExpiryDate = Convert.ToDateTime(visExpDate.Text.Trim().ToString());
                }
                employeeDetails.DateOfCreation     = DateTime.Now;
                employeeDetails.DateOfModification = DateTime.Now;
                employeeDetails.CreatedBy          = lstdetils[0].EmployeeMasterID;
                employeeDetails.ModifiedBy         = lstdetils[0].EmployeeMasterID;
                employeeDetails.LastLogin          = DateTime.Now;

                ResourceMasterBL insertResource = new ResourceMasterBL();
                int flag = newJoinersBL.checkDuplicateID(Convert.ToInt32(empIdText.Text.Trim()));
                if (flag > 0)
                {
                    lblEmpID.Text = "Employee ID already exists !";
                }
                else
                {
                    insertResource.Insert(employeeDetails);
                    newJoinersBL.changeHasJoinedValue(NewJoinerID);
                    Email();
                    Response.Redirect("NewJoiners.aspx");
                }

                //NewJoinersBL newJoinersBL = new NewJoinersBL();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }