protected void grdPagos_RowCommand(object sender, GridViewCommandEventArgs e) { unidadesFuncionalesServ serv = new unidadesFuncionalesServ(); GridViewRow GridViewrow = null; try { if (e.CommandSource.GetType().ToString().ToUpper().Contains("IMAGEBUTTON")) { ImageButton _ImgButton = (ImageButton)e.CommandSource; GridViewrow = (GridViewRow)_ImgButton.NamingContainer; string Tipo = e.CommandName.ToUpper(); lblError.Text = ""; switch (Tipo) { case "COBRAR": serv.PagarExpensa(Convert.ToDecimal(GridViewrow.Cells[1].Text), Convert.ToDecimal(GridViewrow.Cells[2].Text)); grdAlquileres.DataSource = null; grdAlquileres.DataBind(); grdPagos.DataSource = null; grdPagos.DataBind(); break; default: break; } } } catch (Exception ex) { lblError.Text = ex.Message; } }
private void GuardarPagos_y_UnidadesFuncionaesCtaCte(unidadesFuncionalesServ _unidadesFuncionalesServ, expensasServ _expensasServ, pagosServ _pagosServ) { Dictionary <decimal, UnidadesFuncionalesModel> map = (Dictionary <decimal, UnidadesFuncionalesModel>)Session["MapPagoId"]; foreach (var item in map) { var pago = _unidadesFuncionalesServ.GetPago(item.Value.PagoId); int expensaID = Convert.ToInt32(Session["ExpensaId"]); var PagoId = pago.ID.ToString(); decimal coeficiente = pago.Coeficiente; decimal gastosOrdinarios = _expensasServ.GetTotalGastosOrdinarios(expensaID); decimal gastosExtraordinarios = _expensasServ.GetTotalGastosExtraordinarios(expensaID); decimal subtotalGastoOrdinario = gastosOrdinarios * coeficiente / 100; decimal subtotalGastoExtraordinario = gastosExtraordinarios * coeficiente / 100; decimal subtotalGastoCocheraOrd = _pagosServ.GetTotalGastosEvOrdinariosUF(int.Parse(PagoId)); decimal subtotalGastoCocheraExt = _pagosServ.GetTotalGastosEvExtUF(int.Parse(PagoId)); decimal importeGastoParticular = pago.ImporteGastoParticular; //GARDAR en PAGOS y en UnidadFuncionalCtaCte pago.ImportePago1 = subtotalGastoOrdinario + subtotalGastoExtraordinario + subtotalGastoCocheraOrd + subtotalGastoCocheraExt + importeGastoParticular; _pagosServ.ActualizarImportePago1(pago); DAO.UnidadesFuncionalesCtaCte ufCtaCte = new DAO.UnidadesFuncionalesCtaCte() { UnidadesFuncionales = _unidadesFuncionalesServ.GetUnidadFuncional(Session["idConsorcio"].ToString(), item.Value.UF), Haber = pago.ImportePago1, Fecha = DateTime.Now, Detalle = "Expensa " + item.Value.PeriodoDetalle }; _unidadesFuncionalesServ.AddHaber(ufCtaCte); } }
protected void btnAceptarExpensasUF_Click(object sender, EventArgs e) { string confirmValue = Request.Form["confirm_value"]; if (confirmValue == "Si") { unidadesFuncionalesServ _unidadesFuncionalesServ = new unidadesFuncionalesServ(); expensasServ _expensasServ = new expensasServ(context); pagosServ _pagosServ = new pagosServ(context); _unidadesFuncionalesServ.FinalizarPagos(Session["idConsorcio"].ToString(), Convert.ToInt32(Session["PeriodoNumerico"].ToString())); GuardarPagos_y_UnidadesFuncionaesCtaCte(_unidadesFuncionalesServ, _expensasServ, _pagosServ); grdUnidades.DataSource = ""; grdUnidades.DataBind(); divBotonesUF.Visible = false; } expensasServ expensasServ = new expensasServ(context); var ExpensaId = expensasServ.AgregarExpensa(Session["idConsorcio"].ToString()); CargarGrillaExpensas(); }
public TotalesUF() { ExpensasEntities context = new ExpensasEntities(); _expensasServ = new expensasServ(context); _pagosServ = new pagosServ(context); _unidadesFuncServ = new unidadesFuncionalesServ(); }
protected void btnBuscarNombre_Click(object sender, EventArgs e) { unidadesFuncionalesServ serv = new unidadesFuncionalesServ(); var uf = serv.GetUFByFilter(txtNombre.Text, ""); grdAlquileres.DataSource = uf; grdAlquileres.DataBind(); }
public ExpensaUFNueva() { ExpensasEntities context = new ExpensasEntities(); _expensasServ = new expensasServ(context); _gastosServ = new gastosServ(context); _pagosServ = new pagosServ(context); _unidadesFuncServ = new unidadesFuncionalesServ(); _pagosNeg = new pagosNeg(_pagosServ); }
protected void btnAnularExpensasUF_Click(object sender, EventArgs e) { string confirmValue = Request.Form["confirm_value"]; if (confirmValue == "Si") { unidadesFuncionalesServ serv = new unidadesFuncionalesServ(); serv.CancelarPagos(Session["idConsorcio"].ToString(), Convert.ToInt32(Session["PeriodoNumerico"].ToString())); grdUnidades.DataSource = ""; grdUnidades.DataBind(); divBotonesUF.Visible = false; CargarGrillaExpensas(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { unidadesFuncionalesServ serv = new unidadesFuncionalesServ(); CargarGrillaExpensas(); if (Session["direccionConsorcio"] != null) { lblTitulo.Text = "Expensas de " + Session["direccionConsorcio"].ToString(); } if (bool.Parse(Session["MostrarDivUF"].ToString())) { grdUnidades.DataSource = serv.GetPagos(Session["idConsorcio"].ToString(), Convert.ToInt32(Session["PeriodoNumerico"].ToString())); grdUnidades.DataBind(); divBotonesUF.Visible = true; } } }
protected void btnActualizar_Click(object sender, EventArgs e) { if (txtImporteGastoParticular.Text.IsNumeric() == false) { ConstantesWeb.MostrarError("No se ingreso un Importe correcto", this.Page); } else { ConstantesWeb.MostrarError(string.Empty, this.Page); unidadesFuncionalesServ serv = new unidadesFuncionalesServ(); decimal PagoId = Session["PagoId"].ToString().ToDecimal(); decimal importe = Convert.ToDecimal(txtImporteGastoParticular.Text); serv.GuardarGastoParticular(PagoId, importe, txtDetalleGastoParticular.Text.ToUpper()); var pago = _unidadesFuncServ.GetPago(PagoId); totalesUF.CalcularTotales(pago); txtImporteGastoParticular.Text = pago.ImporteGastoParticular.ToString("0.00"); txtDetalleGastoParticular.Text = pago.DetalleGastoParticular; } }
protected void grdExpensas_RowCommand(object sender, GridViewCommandEventArgs e) { GridViewRow GridViewrow = null; try { if (e.CommandSource.GetType().ToString().ToUpper().Contains("IMAGEBUTTON")) { ImageButton _ImgButton = (ImageButton)e.CommandSource; GridViewrow = (GridViewRow)_ImgButton.NamingContainer; string Tipo = e.CommandName.ToUpper(); lblError.Text = ""; switch (Tipo) { case "UNIDADESFUNCIONALES": divBotonesUF.Visible = false; unidadesFuncionalesServ serv = new unidadesFuncionalesServ(); Dictionary <decimal, UnidadesFuncionalesModel> map = new Dictionary <decimal, UnidadesFuncionalesModel>(); if (GridViewrow.Cells[2].Text == "Aceptado" || GridViewrow.Cells[2].Text == "Finalizado") { Session["Estado"] = GridViewrow.Cells[2].Text; Session["ExpensaId"] = GridViewrow.Cells[col_Expensa_ID].Text; Session["PeriodoNumerico"] = GridViewrow.Cells[col_Periodo].Text; var pagos = serv.GetPagos(Session["idConsorcio"].ToString(), Convert.ToInt32(GridViewrow.Cells[col_Periodo].Text)); grdUnidades.DataSource = pagos; grdUnidades.DataBind(); if (GridViewrow.Cells[2].Text == "Aceptado") { divBotonesUF.Visible = true; Session["MostrarDivUF"] = true; } for (int i = 1; i <= pagos.Count; i++) { map.Add(i, pagos[i - 1]); } Session["MapPagoId"] = map; } else { grdUnidades.DataSource = null; grdUnidades.DataBind(); divBotonesUF.Visible = false; ClientScript.RegisterStartupScript(GetType(), "Atencion", "alert('La Expensa no esta Aceptada')", true); } break; case "EXPENSAS": if (GridViewrow.Cells[2].Text != "Finalizado") { if (GridViewrow.Cells[2].Text == "Aceptado") { Session["Estado"] = "Aceptado"; } else { Session["Estado"] = "En Proceso"; } Session["Periodo"] = GridViewrow.Cells[col_PeriodoExpensa].Text; Session["ExpensaId"] = GridViewrow.Cells[col_Expensa_ID].Text; Response.Redirect("ExpensaNueva.aspx", false); } else { ClientScript.RegisterStartupScript(GetType(), "Atencion", "alert('La Expensa se encuentra Finalizada')", true); } break; default: break; } } } catch (Exception ex) { lblError.Text = ex.Message; } }
public GastosParticulares() { _unidadesFuncServ = new unidadesFuncionalesServ(); }