Exemplo n.º 1
0
 protected void btEditEmployee_Click(object sender, EventArgs e)
 {
     AppData.Instance.employee.FirstName = EmployeeUC.FirstName.Text;
      AppData.Instance.employee.LastName = EmployeeUC.LastName.Text;
     EmployeeRepository empRepos = new EmployeeRepository();
     lbResponse.Text = empRepos.UpdateEmployee(AppData.Instance.employee);
 }
Exemplo n.º 2
0
        protected void AddNewEmployee(object sender, EventArgs e)
        {
            AppData.Instance.employee.FirstName = EmployeeUC.FirstName.Text;
            AppData.Instance.employee.LastName = EmployeeUC.LastName.Text;
            AppData.Instance.employee.UserName = EmployeeUC.UserName.Text;

            EmployeeRepository empRepos = new EmployeeRepository();
            response.Visible = true;
            response.Text = empRepos.AddEmployee(AppData.Instance.employee);
        }
Exemplo n.º 3
0
 public bool SetUp(string userName)
 {
     AppData.Instance.SessionID = HttpContext.Current.Session.SessionID;
     EmployeeRepository empRepos = new EmployeeRepository();
     if (empRepos.GetEmployee(userName))
     {
         AppData.Instance.employee.UserName = userName;
         return true;
     }
     else
         return false;
 }
Exemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         EmployeeRepository empRepos = new EmployeeRepository();
         DataTable dt = empRepos.GetAllEmployees();
         foreach (DataRow row in AppData.Instance.employee.EmployeeTable.Rows)
         {
             ddEmployeeList.Items.Add(new ListItem(row["FirstName"].ToString() + " " + row["LastName"].ToString(), row["Employee_ID"].ToString()));
         }
     }
 }