public JsonResult GetData([FromBody] SamataPostData data) { PopulateJobDoneModel(data); return(Json(new { msg = "Kaina uz darbus: " + GetTotalPrice() }));; }
public JobDone PopulateJobDoneModel(SamataPostData data) { jobDone.Category = data.Category; jobDone.JobType = data.JobType; jobDone.JobName = data.JobName; jobDone.Price = int.Parse(data.Price); if (data.Quantity != "") { jobDone.Quantity = int.Parse(data.Quantity); } if (data.Meters != "") { jobDone.Meters = int.Parse(data.Meters); } return(jobDone); }