public static void AddInductiondriver(this tbl_induction induction, InductionViewModel inductionVm) { induction.tenant_id = inductionVm.tenant_id; induction.project_id = inductionVm.project_id; induction.master_emp_id = inductionVm.master_emp_id; induction.empcode = inductionVm.empcode; induction.name = inductionVm.name; induction.date_of_joining = DateTime.Now;//inductionVm.date_of_joining; induction.induction_date = DateTime.Now; induction.wbi_no = inductionVm.wbi_no; }
public HttpResponseMessage Saveinductdriver(HttpRequestMessage request, InductionViewModel Saveinductdriver) { return(CreateHttpResponse(request, () => { HttpResponseMessage response = null; if (!ModelState.IsValid) { response = request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState); } else { tbl_induction newdriver = new tbl_induction(); newdriver.AddInductiondriver(Saveinductdriver); _InductionRepository.Add(newdriver); _unitOfWork.Commit(); response = request.CreateResponse <InductionViewModel>(HttpStatusCode.Created, Saveinductdriver); } return response; })); }