public static Substance Create(SubstanceDto dto) { var subst = new Substance { Name = dto.Name }; Validate(subst); return(subst); }
public static Substance Create(SubstanceDto dto, SubstanceGroup substanceGroup) { var substance = Create(dto); if (substanceGroup == null) { return(substance); } substance.SetSubstanceGroup(substanceGroup); return(substance); }
public ActionResult SaveSubstance(SubstanceDto dto) { if (String.IsNullOrWhiteSpace(dto.Name)) { return(this.Direct(new { success = false })); } if (dto.Id == Guid.Empty.ToString()) { dto.Id = new Guid().ToString(); } return(this.Direct(new { success = true, data = dto })); }
public ActionResult AddNewSubstance(SubstanceDto substanceDto) { var success = true; var message = String.Empty; try { } catch (Exception e) { success = false; message = e.ToString(); } return this.Direct(new { success, data = substanceDto, message }); }
public ActionResult AddNewSubstance(SubstanceDto substanceDto) { var success = true; var message = String.Empty; try { } catch (Exception e) { success = false; message = e.ToString(); } return(this.Direct(new { success, data = substanceDto, message })); }
public ActionResult SaveSubstance(SubstanceDto dto) { if (String.IsNullOrWhiteSpace(dto.Name)) return this.Direct(new { success = false }); if (dto.Id == Guid.Empty.ToString()) dto.Id = new Guid().ToString(); return this.Direct(new { success = true, data = dto }); }