public void Create() { var specialMaterial = new Sales_SpecialMaterial { JobID = _jobID, StatusID = 0, LsmID = 0, Leadtime = 0, ItemNum = 0, HandlingProcess = "Choose" }; _db.Sales_SpecialMaterial.Add(specialMaterial); try { //Check Validation Errors IEnumerable error = _db.GetValidationErrors(); _db.SaveChanges(); ID = specialMaterial.JobSpecialMaterialID; } catch (DbEntityValidationException dbEx) { var s = dbEx.Message; } }
public void Create(Sales_Dispatching salesDispatching) { salesDispatching = OverrideResponsible(salesDispatching); _db.Sales_Dispatching.Add(salesDispatching); try { //Check Validation Errors var error = _db.GetValidationErrors(); _db.SaveChanges(); ID = salesDispatching.TaskID; } catch (DbEntityValidationException dbEx) { var s = dbEx.Message; } }
public void Create(short statusID) { var newStatus = new Sales_JobStatusTable { jobID = _jobID, jobStatus = statusID, Performer = _eID, accomplishDate = DateTime.Now }; _db.Sales_JobStatusTable.Add(newStatus); try { //Check Validation Errors var error = _db.GetValidationErrors(); _db.SaveChanges(); } catch (DbEntityValidationException dbEx) { var s = dbEx.Message; } }