public JsonResult Edit(BfCodeInfo model, string pdCodes, string pdNames, string sortNos, string Ids, string gridStage) { model.LAST_MODIFIED_DATE = DateTime.Now; //添加参数明细 if (!string.IsNullOrEmpty(pdCodes)) { var pdCodeList = pdCodes.Split(','); var pdNamesList = pdNames.Split(','); var sortNoList = sortNos.Split(','); var idList = Ids.Split(','); var dtlList = pdCodeList.Select((t, i) => new BfCodeDetailInfo { CODE = t, NAME = pdNamesList[i], SEQ_NUM = sortNoList[i], LAST_MODIFIED_DATE = DateTime.Now, ID = int.Parse(idList[i]) }).ToList(); model.BfCodeDtlInfoList = dtlList; } var result = (new BfCodeInfoManager()).Update(model); if (result) { return(Json(new ResponseMessage() { IsSuccess = true })); } return(Json(new ResponseMessage() { IsSuccess = false, ErrorCode = 0, Message = "修改失败" })); }
public JsonResult Add(BfCodeInfo model, string pdCodes, string pdNames, string sortNos) { if (string.IsNullOrEmpty(model.CODE) || string.IsNullOrEmpty(model.DESCRIPTION)) { return(Json(new ResponseMessage() { IsSuccess = false, ErrorCode = (int)ResponseIntValue.Fail, Message = "请输入必填字段" })); } model.LAST_MODIFIED_DATE = DateTime.Now; //添加参数明细 if (!string.IsNullOrEmpty(pdCodes)) { var pdCodeList = pdCodes.Split(','); var pdNamesList = pdNames.Split(','); var sortNoList = sortNos.Split(','); var dtlList = pdCodeList.Select((t, i) => new BfCodeDetailInfo { CODE = t, NAME = pdNamesList[i], SEQ_NUM = sortNoList[i], LAST_MODIFIED_DATE = DateTime.Now }).ToList(); model.BfCodeDtlInfoList = dtlList; } var result = (new BfCodeInfoManager()).Add(model); if (result > 0) { return(Json(new ResponseMessage() { IsSuccess = true })); } return(Json(new ResponseMessage() { IsSuccess = false, ErrorCode = (int)result, Message = "新增失败" })); }
public JsonResult CheckCode(BfCodeInfo model) { return(Json((new BfCodeInfoManager()).CheckCode(model))); }