コード例 #1
0
        public JsonResult GetData([FromBody] SamataPostData data)
        {
            PopulateJobDoneModel(data);


            return(Json(new
            {
                msg = "Kaina uz darbus: " + GetTotalPrice()
            }));;
        }
コード例 #2
0
        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);
        }