示例#1
0
 private static void DeleteEmploy()
 {
     try
     {
         int deleteEmployID;
         Console.WriteLine("Enter EmployID to Delete:");
         deleteEmployID = Convert.ToInt32(Console.ReadLine());
         Employ deleteEmploy = EmployBL.SearchEmployBL(deleteEmployID);
         if (deleteEmploy != null)
         {
             bool guestdeleted = EmployBL.DeleteEmployBL(deleteEmployID);
             if (guestdeleted)
             {
                 Console.WriteLine("Employ Deleted");
             }
             else
             {
                 Console.WriteLine("Employ not Deleted ");
             }
         }
         else
         {
             Console.WriteLine("No Employ Details Available");
         }
     }
     catch (EmployException ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
示例#2
0
 private static void SearchEmployByID()
 {
     try
     {
         int searchEmployID;
         Console.WriteLine("Enter EmployID to Search:");
         searchEmployID = Convert.ToInt32(Console.ReadLine());
         Employ searchEmploy = EmployBL.SearchEmployBL(searchEmployID);
         if (searchEmploy != null)
         {
             Console.WriteLine("******************************************************************************");
             Console.WriteLine("EmployID\t\tName\t\tDepartment\t\tSalary");
             Console.WriteLine("******************************************************************************");
             Console.WriteLine("{0}\t\t{1}\t\t{2}{3}", searchEmploy.EmployID, searchEmploy.EmployName, searchEmploy.Department, searchEmploy.Salary);
             Console.WriteLine("******************************************************************************");
         }
         else
         {
             Console.WriteLine("No Employ Details Available");
         }
     }
     catch (EmployException ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
示例#3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            int    searchEmployID = Convert.ToInt32(txtEmpId.Text);
            Employ searchEmploy   = EmployBL.SearchEmployBL(searchEmployID);

            if (searchEmploy != null)
            {
                txtEmpname.Text    = searchEmploy.EmployName;
                txtSalary.Text     = searchEmploy.Salary.ToString();
                txtDepartment.Text = searchEmploy.Department;
            }
        }
示例#4
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            int    updateEmployID = Convert.ToInt32(txtEmpId.Text);
            Employ updatedEmploy  = EmployBL.SearchEmployBL(updateEmployID);

            if (updatedEmploy != null)
            {
                updatedEmploy.EmployName = txtEmpname.Text;
                updatedEmploy.Department = txtDepartment.Text;
                updatedEmploy.Salary     = Convert.ToInt32(txtSalary.Text);
                bool employUpdated = EmployBL.UpdateEmployBL(updatedEmploy);
                if (employUpdated)
                {
                    MessageBox.Show("Record Updated...");
                }
            }
        }
示例#5
0
 private static void UpdateEmploy()
 {
     try
     {
         int updateEmployID;
         Console.WriteLine("Enter EmployID to Update Details:");
         updateEmployID = Convert.ToInt32(Console.ReadLine());
         Employ updatedEmploy = EmployBL.SearchEmployBL(updateEmployID);
         if (updatedEmploy != null)
         {
             Console.WriteLine("Update Employ Name :");
             updatedEmploy.EmployName = Console.ReadLine();
             Console.WriteLine("Update Employ Department ");
             updatedEmploy.Department = Console.ReadLine();
             Console.WriteLine("Update Salary :");
             updatedEmploy.Salary = Convert.ToInt32(Console.ReadLine());
             bool employUpdated = EmployBL.UpdateEmployBL(updatedEmploy);
             if (employUpdated)
             {
                 Console.WriteLine("Employ Details Updated");
             }
             else
             {
                 Console.WriteLine("Employ Details not Updated ");
             }
         }
         else
         {
             Console.WriteLine("No Employ Details Available");
         }
     }
     catch (EmployException ex)
     {
         Console.WriteLine(ex.Message);
     }
 }