/// <summary> /// 我的单据新增 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool AddPersonalRecordList(T_PF_PERSONALRECORD model) { try { PersonalRecordDAL dal = new PersonalRecordDAL(); string recordID = dal.GetExistRecord(model.SYSTYPE, model.MODELCODE, model.MODELID, model.OWNERID, model.OWNERCOMPANYID, model.ISFORWARD); if (recordID != "") { return(dal.UpdatePersonalRecord(model, recordID)); } else { var bol = dal.AddPersonalRecord(model); if (bol) { PersonnelWS.PersonnelServiceClient HRClient = new PersonnelWS.PersonnelServiceClient(); var user = HRClient.GetEmployeeByID(model.OWNERID); SendEmail("你有新的单据请登录系统查看!", user.EMAIL); Log.WriteLog("FormID=" + model.MODELID + ";MODELDESCRIPTION=" + model.MODELDESCRIPTION + ";接收EMAIL=" + user.EMAIL + ";所属人ID=" + user.OWNERID); } return(bol); } } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
/// <summary> /// 修改的单据 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool UpdatePersonalRecord(T_PF_PERSONALRECORD model) { PersonalRecordDAL dal = new PersonalRecordDAL(); if (string.IsNullOrWhiteSpace(model.PERSONALRECORDID)) { string recordID = dal.GetExistRecord(model.SYSTYPE, model.MODELCODE, model.MODELID, model.OWNERID, model.OWNERCOMPANYID, model.ISFORWARD); return(dal.UpdatePersonalRecord(model, recordID)); } else { return(dal.UpdatePersonalRecord(model, model.PERSONALRECORDID)); } }