protected void btnAdd_Click(object sender, EventArgs e)
    {
        List <t_LanguageTranslate> list = languageBL.FindAll(x => x.Language == language && x.Noted.Contains("/Supervisor/Admin/CreateUser.aspx")).ToList();
        var add_staff_successfully      = list.Where(x => x.ControlId.Contains("add_staff_successfully")).FirstOrDefault();

        string staffID = cboStaffs.Text;
        var    staff   = GetStaff();
        var    dbStaff = _staffBL.GetStaff(staffID);

        if (dbStaff == null)
        {
            _staffBL.InsertStaff(staff);
            msg.Text = add_staff_successfully.Contents;
            ReBind();
        }
        else
        {
            _staffBL.UpdateStaff(staff, dbStaff);
            msg.Text = "Đã cập nhật thông tin nhân viên.";
        }
    }
Beispiel #2
0
        public ServerResponse Get(string id)
        {
            var res = new ServerResponse();

            using (StaffBL StaffBL = new StaffBL())
            {
                try
                {
                    res.Data = StaffBL.GetStaff(id);
                }
                catch (Exception ex)
                {
                    res.Success = false;
                }
            }
            return(res);
        }