public void InputDate(DataTable dt) { if (dt != null || dt.Rows.Count > 0) { List <ManuallyComInfoEntity> listComInfo = new List <ManuallyComInfoEntity>(); foreach (DataRow item in dt.Rows) { var ComInfo = new ManuallyComInfoEntity(); ComInfo.IGrowID = Guid.NewGuid().ToString(); ComInfo.Platform_code = item[0].ToString(); ComInfo.SpuName = item[1].ToString(); ComInfo.Price = Convert.ToDecimal(item[2].ToString()); ComInfo.Amount = Convert.ToInt16(item[3].ToString()); ComInfo.SkuCode = item[4].ToString(); ComInfo.SkuName = item[5].ToString(); ComInfo.Note = item[6].ToString(); ComInfo.Remarks = item[7].ToString(); ComInfo.DState = item[8].ToString(); ComInfo.Code = item[9].ToString(); ComInfo.CreateDate = DateTime.Now; ComInfo.CreatorUserId = "System"; ComInfo.ModifyDate = null; ComInfo.ModifyUserId = ""; ComInfo.DeleteMark = true; ComInfo.DeleteTime = null; ComInfo.DeleteUserId = ""; listComInfo.Add(ComInfo); } service.Insert(listComInfo); } }
public void SubmitForm(ManuallyComInfoEntity manuallyComInfoEntity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { manuallyComInfoEntity.Modify(keyValue); service.Update(manuallyComInfoEntity); } else { manuallyComInfoEntity.Create(); service.Insert(manuallyComInfoEntity); } }
public ActionResult SubmitForm(ManuallyComInfoEntity ManuallyComInfoEntity, string keyValue) { manuallyComInfoApp.SubmitForm(ManuallyComInfoEntity, keyValue); return(Success("操作成功。")); }