Ejemplo n.º 1
0
        public bool Update(NhanvienModel model)
        {
            string msgError = "";

            try
            {
                var result = _dbHelper.ExecuteScalarSProcedureWithTransaction(out msgError, "sp_nhan_vien_update",
                                                                              "@manv", model.ma_nv,
                                                                              "@macv", model.ma_cv,
                                                                              "@tennv", model.ten_nv,
                                                                              "@gioitinh", model.gioi_tinh,
                                                                              "@ngaysinh", model.ngay_sinh,
                                                                              "@diachi", model.dia_chi,
                                                                              "@sdt", model.sdt);
                if ((result != null && !string.IsNullOrEmpty(result.ToString())) || !string.IsNullOrEmpty(msgError))
                {
                    throw new Exception(Convert.ToString(result) + msgError);
                }
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
 public bool Update(NhanvienModel model)
 {
     return(_res.Update(model));
 }
Ejemplo n.º 3
0
 public bool Create(NhanvienModel model)
 {
     return(_res.Create(model));
 }
Ejemplo n.º 4
0
 public NhanvienModel UpdateNhanvien([FromBody] NhanvienModel model)
 {
     _itemBusiness.Update(model);
     return(model);
 }
Ejemplo n.º 5
0
 public NhanvienModel CreateNhanvien([FromBody] NhanvienModel model)
 {
     model.ma_nv = Guid.NewGuid().ToString();
     _itemBusiness.Create(model);
     return(model);
 }