示例#1
0
 public void AddManpowerSupplier(ManpowerSupplier manpowerSupplier, string UserName, int UserId, int concernId)
 {
     manpowerSupplier.ConcernId        = concernId;
     manpowerSupplier.CreatorId        = UserId;
     manpowerSupplier.ModificationDate = DateTime.Now;
     manpowerSupplier.CreationDate     = DateTime.Now;
     manpowerSupplier.ModifierId       = UserId;
     _context.ManpowerSuppliers.Add(manpowerSupplier);
     _context.SaveChanges();
 }
示例#2
0
        public void UpdateManpowerSupplier(ManpowerSupplier manpowerSupplier, int id, string UserName, int UserId, int concernId)
        {
            var supplier = _context.ManpowerSuppliers.FirstOrDefault(x => x.ManpowerSupplierId == id);

            supplier.Name             = manpowerSupplier.Name;
            supplier.Address          = manpowerSupplier.Address;
            supplier.ContactNumber    = manpowerSupplier.ContactNumber;
            supplier.Description      = manpowerSupplier.Description;
            supplier.ModificationDate = DateTime.Now;
            supplier.ModifierId       = UserId;
            _context.SaveChanges();
        }