internal void DeleteSelf(IAcreedor parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } // if we're new then don't update the database if (this.IsNew) { return; } try { SessionCode = parent.SessionCode; Session().Delete(Session().Get <ProductoProveedorRecord>(Oid)); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkNew(); }
public static void Edit(ProviderViewModel source, HttpRequestBase request = null) { IAcreedor item = null; switch (source.ETipoAcreedor) { case ETipoAcreedor.Proveedor: case ETipoAcreedor.Acreedor: case ETipoAcreedor.Partner: item = Proveedor.Get(source.OidAcreedor, source.ETipoAcreedor); break; case ETipoAcreedor.Naviera: item = Naviera.Get(source.OidAcreedor); break; case ETipoAcreedor.Despachante: item = Despachante.Get(source.OidAcreedor); break; case ETipoAcreedor.TransportistaDestino: case ETipoAcreedor.TransportistaOrigen: item = Transporter.Get(source.OidAcreedor, source.ETipoAcreedor); break; } source.CopyTo(item, request); item.ISave(); }
public InvoicePaymentAddForm(Form parent, IAcreedor acreedor) : base(parent, acreedor) { InitializeComponent(); SetFormData(acreedor); this.Text = Resources.Labels.PAGO_ADD_TITLE; }
public void CopyTo(IAcreedor dest, HttpRequestBase request = null) { foreach (PropertyInfo item in this.GetType().GetProperties()) { if (item == null) { continue; } if (item.Name == "Oid") { continue; } if (request != null && request[item.Name] == null) { continue; } try { PropertyInfo propdest = typeof(IAcreedor).GetProperty(item.Name); if (propdest != null) { propdest.SetValue(dest, item.GetValue(this, null), null); } } catch { } } }
public CustomAgentForm(IAcreedor item, bool isModal, Form parent) : base(item.Oid, new object[1] { item }, isModal, parent) { InitializeComponent(); }
public void Update(IAcreedor parent) { this.RaiseListChangedEvents = false; // update (thus deleting) any deleted child objects foreach (Payment obj in DeletedList) { obj.DeleteSelf(parent); } // now that they are deleted, remove them from memory too DeletedList.Clear(); // add/update any current child objects // no se usa un foreach porque puede variar la cantidad de elementos // si se ha cambiado alguno de fecha ya que se crea uno nuevo y se anula el anterior for (int i = 0; i < Items.Count; i++) { Payment obj = Items[i]; if (obj.IsNew) { obj.Insert(parent); } else { obj.Update(parent); } } this.RaiseListChangedEvents = true; }
internal static string SELECT(IAcreedor source) { return(SELECT(new QueryConditions() { Acreedor = source.IGetInfo() })); }
internal void Update(IAcreedor parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } //Debe obtener la sesion del padre pq el objeto es padre a su vez SessionCode = parent.SessionCode; ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Resources.Messages.GENERIC_VALIDATION_ERROR); } PayrollBatchRecord obj = parent.Session().Get <PayrollBatchRecord>(Oid); obj.CopyValues(Base.Record); parent.Session().Update(obj); UpdateAssociatedExpenses(); MarkOld(); }
public EmployeeForm(IAcreedor item, Form parent) : base(item.Oid, new object[1] { item }, true, parent) { InitializeComponent(); }
public SupplierForm(IAcreedor item, bool isModal, Form parent) : base(item.Oid, new object[2] { item.ETipoAcreedor, item }, isModal, parent) { InitializeComponent(); }
public PaymentRpt GetDetailReport(Payment item, IAcreedor acreedor, InputInvoiceList facturas) { if (item == null) { return(null); } PaymentRpt doc = new PaymentRpt(); List <PaymentPrint> pList = new List <PaymentPrint>(); List <TransactionPaymentPrint> pagosList = new List <TransactionPaymentPrint>(); foreach (TransactionPayment pagoFactura in item.Operations) { pagosList.Add(TransactionPaymentPrint.New(pagoFactura.GetInfo(), facturas.GetItem(pagoFactura.OidOperation))); } //Si no existen conceptos, no tiene sentido un informe detallado. Además, falla en Crystal Reports if (pagosList.Count <= 0) { return(null); } pList.Add(PaymentPrint.New(item.GetInfo(false), acreedor, false)); doc.SetDataSource(pList); doc.Subreports["Cuerpo"].SetDataSource(pagosList); doc.SetParameterValue("Empresa", Schema.Name); return(doc); }
public TransporterForm(IAcreedor item, Form parent) : base(item.Oid, new object[2] { item.ETipoAcreedor, item }, true, parent) { InitializeComponent(); }
public EmployeeAddForm(IAcreedor entity, Form parent) : base(entity, parent) { InitializeComponent(); SetFormData(); _mf_type = ManagerFormType.MFAdd; }
public void Update(IAcreedor parent) { this.RaiseListChangedEvents = false; // update (thus deleting) any deleted child objects foreach (ProductoProveedor obj in DeletedList) { obj.DeleteSelf(parent); } // now that they are deleted, remove them from memory too DeletedList.Clear(); // add/update any current child objects foreach (ProductoProveedor obj in this) { if (obj.IsNew) { obj.Insert(parent); } else { obj.Update(parent); } } this.RaiseListChangedEvents = true; }
public ShippingCompanyForm(IAcreedor item, Form parent) : base(item.Oid, new object[1] { item }, true, parent) { InitializeComponent(); }
internal void Insert(IAcreedor parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } //Debe obtener la sesion del padre pq el objeto es padre a su vez SessionCode = parent.SessionCode; GetNewCode(); UpdateAssociatedExpenses(); ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Resources.Messages.GENERIC_VALIDATION_ERROR); } parent.Session().Save(Base.Record); MarkOld(); }
/// <summary> /// Guarda en la bd el objeto actual /// </summary> protected override bool SaveObject() { using (StatusBusy busy = new StatusBusy(moleQule.Face.Resources.Messages.SAVING)) { this.Datos.RaiseListChangedEvents = false; IAcreedor temp = _entity.IClone(); temp.ApplyEdit(); // do the save try { _entity = temp.ISave(); _entity.ApplyEdit(); return(true); } catch (Exception ex) { PgMng.ShowInfoException(iQExceptionHandler.GetAllMessages(ex)); return(false); } finally { this.Datos.RaiseListChangedEvents = true; } } }
public static ProviderBase New(IAcreedor source) { ProviderBase obj = new ProviderBase(); obj.CopyValues(source); return(obj); }
protected void SetFormData(IAcreedor source) { _holder.LoadChilds(typeof(Payment), true); _entity = _holder.Pagos.NewItem(source, ETipoPago.Factura); _entity.CopyFrom(source, ETipoPago.Factura); base.SetFormData(); }
public EmployeeEditForm(IAcreedor item, Form parent) : base(item, parent) { InitializeComponent(); SetFormData(); this.Text = string.Format(Resources.Labels.EMPLOYEE_TITLE, _entity.NombreCompleto); _mf_type = ManagerFormType.MFEdit; }
public static ProductoProveedores GetChildList(IAcreedor parent, bool childs) { CriteriaEx criteria = ProductoProveedor.GetCriteria(parent.SessionCode); criteria.Query = ProductoProveedores.SELECT(parent); criteria.Childs = childs; return(DataPortal.Fetch <ProductoProveedores>(criteria)); }
public static string SELECT(IAcreedor acreedor) { QueryConditions conditions = new QueryConditions { Acreedor = acreedor.IGetInfo() }; conditions.TipoAcreedor[0] = acreedor.ETipoAcreedor; if (acreedor.ETipoAcreedor == ETipoAcreedor.Empleado) return Employee.SELECT_PAGOS_NOMINAS(); else return SELECT_BASE(conditions); }
public void ChangeState(EEstado status, Payment item, IAcreedor parent) { Payment obj = GetItem(item.Oid); if (obj != null) { obj.ChangeEstado(status); //parent.UpdateCredito(); } }
public virtual void CopyValues(IAcreedor source) { if (source == null) { return; } _record.CopyValues(source.ProviderBase.Record); CopyCommonValues(source); }
public ProveedorEditForm(IAcreedor item, Form parent) : base(item, parent) { InitializeComponent(); if (_entity != null) { SetFormData(); } _mf_type = ManagerFormType.MFEdit; }
public static PaymentSummary Get(IAcreedor acreedor) { CriteriaEx criteria = Expedient.GetCriteria(Expedient.OpenSession()); if (nHManager.Instance.UseDirectSQL) criteria.Query = PaymentSummary.SELECT(acreedor); Expedient.BeginTransaction(criteria.Session); return DataPortal.Fetch<PaymentSummary>(criteria); }
public static Payments GetChildList(IAcreedor parent, bool childs) { CriteriaEx criteria = Payment.GetCriteria(parent.SessionCode); criteria.Query = SELECT(parent); criteria.Childs = childs; Payments list = DataPortal.Fetch <Payments>(criteria); return(list); }
public InvoicePaymentEditForm(Form parent, IAcreedor acreedor, Payment pago, bool locked) : base(parent, acreedor) { InitializeComponent(); _locked = locked; _entity = pago; SetFormData(); this.Text = Resources.Labels.PAGO_DETAIL_TITLE; }
public static string SELECT(IAcreedor item) { QueryConditions conditions = new QueryConditions { TipoAcreedor = new ETipoAcreedor[1] { item.ETipoAcreedor }, Acreedor = item.IGetInfo() }; return(SELECT(conditions)); }
public TransactionPayment GetItemByAgenteExpediente(IAcreedor agente, long oid_expediente) { foreach (TransactionPayment item in this) { if ((item.OidExpediente == oid_expediente) && (item.ETipoAcreedor == agente.ETipoAcreedor)) { return(item); } } return(null); }