Пример #1
0
 public async Task <IActionResult> Post([FromBody] set_integral value)
 {
     value.CreatedAt = DateTime.Now;
     value.UpdatedAt = DateTime.Now;
     value.IsValid   = true;
     if (User.Identity is ClaimsIdentity identity)
     {
         value.CreatedBy = identity.Name ?? "test";
     }
     //if (!string.IsNullOrEmpty(value.HouseTypeTxt))
     //{
     //    var ht = value.HouseTypeTxt.Split(',');
     //    foreach (var h in ht)
     //    {
     //        integral.HouseTypeId = int.Parse(h);
     //        integral.Id = -1;
     //        _setIntegralRpt.Add(integral);
     //    }
     //}
     //if (!string.IsNullOrEmpty(value.ServiceItemTxt))
     //{
     //    var ht = value.ServiceItemTxt.Split(',');
     //    foreach (var h in ht)
     //    {
     //        integral.ServiceItemId = int.Parse(h);
     //        integral.Id = -1;
     //        _setIntegralRpt.Add(integral);
     //    }
     //}
     _setIntegralRpt.Add(value);
     _setIntegralRpt.Commit();
     return(new OkObjectResult(value));
 }
Пример #2
0
 public async Task <IActionResult> Post([FromBody] set_integral value)
 {
     value.CreatedAt = DateTime.Now;
     value.UpdatedAt = DateTime.Now;
     value.IsValid   = true;
     if (User.Identity is ClaimsIdentity identity)
     {
         value.CreatedBy = identity.Name ?? "admin";
     }
     _setIntegralRpt.Add(value);
     _setIntegralRpt.Commit();
     return(new OkObjectResult(value));
 }