public IHttpActionResult AddCompany(Company entity)
        {
            try
            {
                entity.CompID       = Guid.NewGuid().ToString().ToUpper();
                entity.CompOriginID = entity.CompID;
                entity.Status       = 1;
                _context.Company.Add(entity);
                _context.SaveChanges();

                operationResult.Success = true;
                operationResult.Caption = "THanh cong";
                operationResult.Message = "THem thanh cong company";
            }
            catch (Exception e)
            {
                operationResult.Success = false;
                operationResult.Caption = "Fail";
                operationResult.Message = e.Message;
            }

            return(Ok(operationResult));
        }
Esempio n. 2
0
 public void Save()
 {
     _context.SaveChanges();
 }