示例#1
0
        private void BtnDelete_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("Are sure to delete this account?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dr == DialogResult.Yes)
            {
                try
                {
                    JobRepo.DeleteFromJobSeekerJob(this.Id);

                    JobRepo.DeleteJob(this.Id);

                    CompanyRepo.DeleteCompany(this.Id);

                    MessageBox.Show("Company profile deleted!", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
                this.BackHome();
                this.Dispose();
            }
            else
            {
                return;
            }
        }
示例#2
0
 private void BtnSaveCompanyProfile_Click(object sender, EventArgs e)
 {
     this.Name      = this.txtCompanyName.Text;
     this.Password  = this.txtCompanyPassword.Text;
     this.Address   = this.txtCompanyAddress.Text;
     this.ContactNo = this.txtCompanyContact.Text;
     this.Email     = this.txtCompanyEmail.Text;
     if (this.CompanyLogoSelected)
     {
         if (Validation.Text(this.Name, this.Password, this.Address, this.ContactNo, this.Email))
         {
             if (Validation.ValidEmail(this.Email) && Validation.IsNumber(this.ContactNo))
             {
                 string sql;
                 try
                 {
                     if (this.Purpose != "update")
                     {
                         CompanyRepo.InsertCompany(this.CompanyId, this.Password, this.Name, this.Address, this.Email, this.ContactNo, this.CompanyLogoPath);
                         MessageBox.Show("Account Creadted SuccessFully!\nYour Company ID is " + this.CompanyId, "Message!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                         DataAccess.UpdateCompanySerial();
                     }
                     else
                     {
                         CompanyRepo.UpdateCompany(this.Password, this.Name, this.Address, this.Email, this.ContactNo, this.CompanyLogoPath, this.CompanyId);
                         MessageBox.Show("Account Updated", "Info!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                         new SigninForm(this.Back).Visible = true;
                         this.DestroyCompany();
                         this.Dispose();
                     }
                     this.Back();
                     this.Dispose();
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show(ex.ToString(), "Error!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
             else
             {
                 MessageBox.Show("Email or Contact number is not in valid format", "'Format Issue!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
         }
         else
         {
             MessageBox.Show("All the boxes are required to fillup.", "Message!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
     }
     else
     {
         MessageBox.Show("Please upload a company logo", "Message!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
示例#3
0
        private void SetAll()
        {
            this.JobId                 = Convert.ToInt32(this.Row.Cells[0].Value);
            this.Title                 = this.lblOutputTitle.Text = this.Row.Cells[1].Value.ToString();
            this.Type                  = this.lblOutputType.Text = this.Row.Cells[2].Value.ToString();
            this.Category              = this.lblOutputCategory.Text = this.Row.Cells[3].Value.ToString();
            this.Description           = this.lblOutputDescription.Text = this.Row.Cells[4].Value.ToString();
            this.Vacancy               = Convert.ToUInt16(this.Row.Cells[5].Value);
            this.lblOutputVacancy.Text = this.Vacancy.ToString();
            string[] deadline = this.Row.Cells[6].Value.ToString().Split(' ');
            this.DeadLine                  = this.lblOutputDeadline.Text = deadline[0];
            this.Address                   = this.lblOutputAddress.Text = this.Row.Cells[7].Value.ToString();
            this.Salary                    = Convert.ToDouble(this.Row.Cells[8].Value);
            this.lblOutputSalary.Text      = this.Salary.ToString();
            this.CompanyId                 = this.Row.Cells[9].Value.ToString();
            this.CompanyDs                 = CompanyRepo.GetAll(this.CompanyId);
            this.lblOutputCompanyName.Text = this.CompanyDs.Tables[0].Rows[0]["name"].ToString();
            string sql = JobSeekerRepo.GetAppliedJobSeeker(this.JobId);

            this.PopulateDGVAppliedJobSeekers(sql);
        }
示例#4
0
        private bool ValidateLogin()
        {
            string sql;

            try
            {
                if (this.Id.StartsWith("C-"))
                {
                    this.User = "******";
                    sql       = CompanyRepo.CompanySignIn(this.Id, this.Password);
                }
                else if (this.Id.StartsWith("JS-"))
                {
                    this.User = "******";
                    sql       = JobSeekerRepo.JobSeekerSignIn(this.Id, this.Password);
                }
                else
                {
                    MessageBox.Show("User Id is incorrect.\nTry Again.", "Not Found!!", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    return(false);
                }
                this.Ds = DataAccess.ExecuteQuery(sql);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
            if (this.Ds.Tables[0].Rows.Count == 1)
            {
                return(true);
            }
            else
            {
                MessageBox.Show("User Doesn't Exists", "Not Found!", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return(false);
            }
        }