protected void LinkLineAction(DataGridViewRow row) { if (row == null) { return; } if (_entity.EMedioPago != EMedioPago.CompensacionFactura) { if (_deallocated == 0) { UnlinkLineAction(row); return; } } NominaInfo item = row.DataBoundItem as NominaInfo; if (item == null) { return; } _entity.InsertNewTransactionPayment(item, _deallocated); UpdateAllocated(); MarkAsNoActiva(row); }
protected override void SetUnlinkedGridValues(string grid_name) { if (grid_name == Nominas_DGW.Name) { Payment Pago = (Payment)Payments_BS.Current; NominaInfo item = null; foreach (DataGridViewRow row in Nominas_DGW.Rows) { if (row.IsNewRow) { return; } item = row.DataBoundItem as NominaInfo; if (item == null) { continue; } row.Cells[FacturaAsignado.Index].Value = Pago.Operations.GetItemByFactura(item.Oid).Cantidad; row.Cells[FacturaAnteriores.Index].Value = item.TotalPagado - Pago.Operations.GetItemByFactura(item.Oid).Cantidad; } } }
protected override void MarkAsActiva(DataGridViewRow row) { NominaInfo item = row.DataBoundItem as NominaInfo; item.Vinculado = Library.Store.Resources.Labels.SET_PAGO; base.MarkAsActiva(row); }
protected virtual void VerPendienteAction() { if (Pendientes_DGW.CurrentRow == null) { return; } NominaInfo nomina = Pendientes_DGW.CurrentRow.DataBoundItem as NominaInfo; PayrollBatchViewForm form = new PayrollBatchViewForm(nomina.OidRemesa, nomina.Oid, this); form.ShowDialog(this); }
protected override void SetGridFormat() { foreach (DataGridViewRow row in Payrolls_DGW.Rows) { if (row.IsNewRow) { return; } NominaInfo item = (NominaInfo)row.DataBoundItem; Face.Common.ControlTools.Instance.SetRowColor(row, item.EEstado); } }
protected virtual void PrintPendienteListAction() { if (Pendientes_DGW.CurrentRow == null) { return; } NominaInfo nomina = Pendientes_DGW.CurrentRow.DataBoundItem as NominaInfo; NominaReportMng reportMng = new NominaReportMng(AppContext.ActiveSchema, this.Text, "Nómina = " + nomina.Empleado); NominaListRpt report = reportMng.GetListReport(Unpaids_BS.DataSource as PayrollList); ShowReport(report); }
protected void UnlinkLineAction(DataGridViewRow row) { if (row == null) { return; } NominaInfo item = row.DataBoundItem as NominaInfo; _entity.DeleteTransactionPayment(item); UpdateAllocated(); MarkAsActiva(row); }
protected override void SetRowFormat(DataGridViewRow row) { if (!row.Displayed) { return; } if (row.IsNewRow) { return; } NominaInfo item = (NominaInfo)row.DataBoundItem; Face.Common.ControlTools.Instance.SetRowColor(row, item.EEstado); }
protected override void GetFormSourceData(object[] parameters) { if (parameters[0] == null) { if (parameters[2] != null) { _holder = (IAcreedor)parameters[2]; _holder.LoadChilds(typeof(Payment), true); _entity = _holder.Pagos.NewItem(_holder, ETipoPago.Nomina); _entity.CopyFrom(_holder, ETipoPago.Nomina); } else { _entity = Payment.New((ETipoPago)parameters[1]); } _entity.ETipoAcreedor = ETipoAcreedor.Empleado; _entity.BeginEdit(); _entity.Oid = -1; } else { _entity = (Payment)parameters[0]; _entity.BeginEdit(); _entity.Oid = -1; } if (_holder != null) { _payrolls = PayrollList.GetPendientesList((_holder as Employee).Oid, false); } else { _payrolls = PayrollList.GetPendientesList(_entity.GetInfo(false), false); } //Asociamos los gastos previamente vinculados foreach (TransactionPayment item in _entity.Operations) { NominaInfo gasto = _payrolls.GetItem(item.OidOperation); gasto.Vincula(); } }
protected override void EditLineAllocationAction(DataGridViewRow row) { InputDecimalForm form = new InputDecimalForm(); form.Message = (_entity.ETipoPago == ETipoPago.Nomina) ? Resources.Labels.IMPORTE_PAGO_NOMINA : Resources.Labels.IMPORTE_PAGO_GASTO; if (form.ShowDialog(this) == DialogResult.OK) { NominaInfo item = row.DataBoundItem as NominaInfo; _deallocated += item.Asignado; _entity.EditTransactionPayment(item, form.Value); LinkLineAction(row); SetUnlinkedGridValues(Lineas_DGW.Name); Datos_Lineas.ResetBindings(false); SetGridColors(Lineas_DGW); } }
void Datos_Pago_CurrentChanged(object sender, EventArgs e) { List <NominaInfo> lista = new List <NominaInfo>(); if (Payments_BS.Current == null) { Payrolls_BS.DataSource = lista; return; } foreach (TransactionPayment item in Pago.Operations) { NominaInfo exp = _payrolls.GetItem(item.OidOperation); if (exp != null) { lista.Add(exp); } } Payrolls_BS.DataSource = lista; }