public void SavePayment([FromBody] LanePayment value) { if (null == value) { return; } Random rand = new Random(); if (string.IsNullOrWhiteSpace(value.ApproveCode)) { value.ApproveCode = rand.Next(10000000).ToString("D8"); // auto generate. } LanePayment.Save(value); }
public NDbResult <LanePayment> SavePayment([FromBody] LanePayment value) { NDbResult <LanePayment> result; if (null == value) { result = new NDbResult <LanePayment>(); result.ParameterIsNull(); } else { if (string.IsNullOrWhiteSpace(value.ApproveCode)) { Random rand = new Random(); value.ApproveCode = rand.Next(10000000).ToString("D8"); // auto generate. } result = LanePayment.Save(value); } return(result); }