Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(SCZM.Model.Repair.repair_SettlementList model, out string message)
        {
            message = "保存成功!";
            int rows = dal.Update(model);

            if (rows == 0)
            {
                message = "对不起,该条数据已被其他人删除!";
                return(false);
            }
            else
            {
                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, rows);
                }
                return(true);
            }
        }