/// <summary> /// 保存服务信息 /// </summary> /// <param name="request"></param> /// <returns></returns> public BaseResponse <IList <ServiceRecord> > SaveServiceRec(ServiceRec request) { var response = new BaseResponse <IList <ServiceRecord> >(); foreach (var item in request.Data) { Mapper.Reset(); Mapper.CreateMap <ServiceRecord, LTC_SERVICERECORD>(); Mapper.CreateMap <LTC_SERVICERECORD, ServiceRecord>(); var Model = unitOfWork.GetRepository <LTC_SERVICERECORD>().dbSet.FirstOrDefault(m => m.SERVICERECORDID == item.ServiceRecordId); if (Model == null) { Model = Mapper.Map <LTC_SERVICERECORD>(item); Model.NSID = SecurityHelper.CurrentPrincipal.OrgId; Model.ISDELETE = false; Model.OPERATOR = SecurityHelper.CurrentPrincipal.EmpNo; Model.CREATEBY = SecurityHelper.CurrentPrincipal.EmpNo; Model.UPDATEBY = SecurityHelper.CurrentPrincipal.EmpNo; Model.STATUS = 0; Model.CREATETIME = DateTime.Now; Model.UPDATETIME = DateTime.Now; unitOfWork.GetRepository <LTC_SERVICERECORD>().Insert(Model); } else { Mapper.Map(item, Model); Model.UPDATEBY = SecurityHelper.CurrentPrincipal.EmpNo; Model.UPDATETIME = DateTime.Now; unitOfWork.GetRepository <LTC_SERVICERECORD>().Update(Model); } unitOfWork.Save(); } return(response); }
public void setElement(int index, ServiceRec value) { if (m_ServiceRec.Count - 1 < index) { return; } m_ServiceRec[index] = value; m_ServiceRec[index].setParent(this); setParentPresenceVector(); }
public ServiceRec(ServiceRec value) { /// Initiliaze the protected variables m_parent = null; m_URI = ""; m_MajorVersionNumber = 0; m_MinorVersionNumber = 0; /// Copy the values m_URI = value.m_URI; m_MajorVersionNumber = value.m_MajorVersionNumber; m_MinorVersionNumber = value.m_MinorVersionNumber; }
public bool isEqual(ServiceRec value) { if ((m_URI.Length != value.m_URI.Length) || (m_URI.CompareTo(value.m_URI) != 0)) { return(false); } if (this.getMajorVersionNumber() != value.getMajorVersionNumber()) { return(false); } if (this.getMinorVersionNumber() != value.getMinorVersionNumber()) { return(false); } return(true); }
public void addElement(ServiceRec value) { m_ServiceRec.Add(value); m_ServiceRec[m_ServiceRec.Count - 1].setParent(this); setParentPresenceVector(); }
public bool notEquals(ServiceRec value) { return(!this.isEqual(value)); }
public RegisterServices.RegisterServicesBody.ServiceList.ServiceRec setServiceRec(ServiceRec value) { m_URI = value.m_URI; m_MajorVersionNumber = value.m_MajorVersionNumber; m_MinorVersionNumber = value.m_MinorVersionNumber; return(this); }