public static Agente Get(Type entityType, IAgenteHipatia hipatiaAgent, bool childs = false) { EntidadInfo entidad = EntidadInfo.Get(entityType); if (entidad.Oid != 0) { QueryConditions conditions = new QueryConditions() { Entity = entidad, IHipatiaAgent = hipatiaAgent }; Agente obj = Get(SELECT(conditions, false), childs); if (obj == null) { throw new HipatiaException(String.Format(Resources.Messages.AGENTE_NOT_FOUND, hipatiaAgent.NombreHipatia), HipatiaCode.NO_AGENTE); } return(obj); } else { throw new HipatiaException(Resources.Messages.ENTIDAD_NOT_FOUND + entityType.ToString(), HipatiaCode.NO_ENTIDAD); } }
public static DocumentViewModel New(DocumentoInfo source, IAgenteHipatia agent) { DocumentViewModel obj = new DocumentViewModel(); obj.CopyFrom(source); obj.OidAgent = agent.Oid; return(obj); }
public virtual void CopyFrom(EntidadInfo entity, IAgenteHipatia agent) { OidEntidad = entity.Oid; OidAgenteExt = agent.Oid; Nombre = agent.NombreHipatia; Fecha = DateTime.Today; Entidad = entity.Tipo; }
public AgenteEditForm(Type tipoEntidad, IAgenteHipatia agenteH, Form parent) : base(-1, parent) { InitializeComponent(); _entity = Agente.Get(tipoEntidad, agenteH); _entity.BeginEdit(); SetFormData(); this.Text = Resources.Labels.AGENTE_EDIT_TITLE + " " + Entity.Nombre.ToUpper(); _mf_type = ManagerFormType.MFEdit; }
public static DocumentListViewModel Get(Documentos sourceList, IAgenteHipatia agent) { DocumentListViewModel list = new DocumentListViewModel(); foreach (Documento item in sourceList) { list.Add(DocumentViewModel.New(item, agent)); } return(list); }
public AgenteAddForm(EntidadInfo entity, IAgenteHipatia agent, Form parent) : base(-1, parent) { InitializeComponent(); _entity.CopyFrom(entity, agent); _entity.Codigo = _entity.GetCode(); SetFormData(); _mf_type = ManagerFormType.MFAdd; this.Text = Resources.Labels.AGENTE_ADD_TITLE; }
public static DocumentoList GetListByAgente(IAgenteHipatia agente) { CriteriaEx criteria = Documento.GetCriteria(Documento.OpenSession()); criteria.Childs = true; QueryConditions conditions = new QueryConditions { IHipatiaAgent = agente }; criteria.Query = DocumentoList.SELECT_BY_AGENTE(conditions); DocumentoList list = DataPortal.Fetch <DocumentoList>(criteria); CloseSession(criteria.SessionCode); return(list); }
public static Agente New(Type entityType, IAgenteHipatia agent) { if (!CanAddObject()) { throw new System.Security.SecurityException(Resources.Messages.USER_NOT_ALLOWED); } EntidadInfo entity = EntidadInfo.Get(entityType); if (entity.Oid != 0) { Agente obj = DataPortal.Create <Agente>(new CriteriaCs(-1)); obj.CopyFrom(entity, agent); return(obj); } else { throw new HipatiaException(Resources.Messages.ENTIDAD_NOT_FOUND + entityType.ToString(), HipatiaCode.NO_ENTIDAD); } }
public override void UpdateList() { /*switch (_current_action) * { * case molAction.Add: * if (_entity == null) return; * List.AddItem(_entity.GetInfo(false)); * if (FilterType == IFilterType.Filter) * { * AgenteList listA = AgenteList.GetList(_filter_results); * listA.AddItem(_entity.GetInfo(false)); * _filter_results = listA.GetSortedList(); * } * break; * * case molAction.Edit: * case molAction.Lock: * case molAction.Unlock: * if (_entity == null) return; * ActiveItem.CopyFrom(_entity); * break; * * case molAction.Delete: * if (ActiveItem == null) return; * List.RemoveItem(ActiveOID); * if (FilterType == IFilterType.Filter) * { * AgenteList listD = AgenteList.GetList(_filter_results); * listD.RemoveItem(ActiveOID); * _filter_results = listD.GetSortedList(); * } * break; * }*/ _entity = null; RefreshSources(); }
public AgenteEditForm(Type tipoEntidad, IAgenteHipatia agenteH) : this(tipoEntidad, agenteH, null) { }
public static string GetCode(EntidadInfo entidad, IAgenteHipatia agente_h) { return("GD#" + entidad.Oid.ToString("00") + agente_h.Oid.ToString("00000")); }
public AgenteAddForm(Type tipoEntidad, IAgenteHipatia agente_h) : this(tipoEntidad, agente_h, null) { }