/// <summary> /// 增加一条数据 /// </summary> public int Add(SCZM.Model.Repair.repair_SettlementList model, out string message) { message = "保存成功!"; int rowId = dal.Add(model); if (rowId < 1) { message = "保存失败!"; } else { DAL.Repair.repair_Intention dal_Intention = new DAL.Repair.repair_Intention(); dal_Intention.UpdateRepairState(model.IntentionId.ToString(), 40); BLL.System.sys_Attachment attachmenBLL = new BLL.System.sys_Attachment(); string IDList = (model.AttachmentId_Settlement == "" || model.AttachmentId_Settlement == null ? "" : model.AttachmentId_Settlement + ",") ; string FileUse = "维修结算"; if (IDList != "") { attachmenBLL.UpdateUseList(Utils.DelLastComma(IDList), FileUse, rowId); } } return(rowId); }
/// <summary> /// 批量删除数据 /// </summary> public bool DeleteList(string IDList, string IntentionIdList, out string message) { message = "删除成功!"; int rows = dal.DeleteList(IDList, IntentionIdList); if (rows == 0) { message = "对不起,所选数据已被其他人删除!"; return(false); } else { DAL.Repair.repair_Intention dal_Intention = new DAL.Repair.repair_Intention(); dal_Intention.UpdateRepairState(IntentionIdList, 30); return(true); } }