public string deleteStockInventory(stockProfit data) { bool status = reportModel.deleteStockInventory(data.id); string msg = status ? "刪除成功" : "刪除失敗"; return(msg); }
public string createStockInventory(stockProfit profit) { profit.operId = UserInfo.OperId; bool status = reportModel.createStockInventory(profit); string msg = status ? "新增成功" : "新增失敗"; return(msg); }
public JsonResult CreateStockInventory(stockProfit form) { bool status = true; bool check = true; string msg = ""; if (form.operId == 0) { check = false; } if (string.IsNullOrEmpty(form.code)) { check = false; } if (form.buyShares == 0) { check = false; } if (form.buyPrice == 0) { check = false; } if (check) { status = reportModel.createStockInventory(form); msg = status ? "新增成功!" : "新增失敗!"; } else { status = false; msg = "資料輸入錯誤!"; } return(Json(new Results <DBNull> { Success = status, Message = msg, Data = null, TotalCount = status ? 1 : 0 })); }