예제 #1
0
        protected void TxtConsultar_Click(object sender, EventArgs e)
        {
            Cls_Ingreso_DAL Obj_Ingreso_Dal = new Cls_Ingreso_DAL();

            Obj_Ingreso_Dal.sIdPersona = txtCedula.Value;
            Obj_Ingreso_BLL.Cargar(ref Obj_Ingreso_Dal);
            if (Obj_Ingreso_Dal.DS.Tables.Count == 0)
            {
                Response.Write("<script>window.alert('La cédula ingresada no corresponde a ningún cliente. Por favor ingrese un cliente válido.');</script>");
            }
            else
            {
                DataTable dt = Obj_Ingreso_Dal.DS.Tables[0];
                if (dt.Rows.Count == 0)
                {
                    Response.Write("<script>window.alert('La cédula ingresada no corresponde a ningún cliente. Por favor ingrese un cliente válido.');</script>");
                }
                foreach (DataRow row in dt.Rows)
                {
                    txtnombre.Value      = Convert.ToString(row[1]);
                    TxtTipoCliente.Value = Convert.ToString(row[2]);
                    TxtMembresia.Value   = Convert.ToString(row[3]);
                    TxtCosto.Value       = Convert.ToString(row[4]);
                }
            }
        }
예제 #2
0
        public void Insertar_Detalle_Factura(ref Cls_Ingreso_DAL Obj_Ingreso_Dal)
        {
            CatalogosMantenimientosClient Obj_Ingresos_Client = new CatalogosMantenimientosClient();
            string sMsjError = string.Empty;

            Obj_Ingresos_Client.Insertar_Detalle_Factura(Obj_Ingreso_Dal.sIdPersona, Obj_Ingreso_Dal.fCosto, Obj_Ingreso_Dal.bIdTipoServicio, Obj_Ingreso_Dal.fTotal, ref sMsjError);
        }
예제 #3
0
        protected void btnFacturar_Click(object sender, EventArgs e)
        {
            float Total;

            if (TxtTotal.Value == string.Empty)
            {
                Response.Write("<script>window.alert('Primero debe totalizar para poder facturar');</script>");
            }



            else
            {
                Total                      = Convert.ToSingle(TxtTotal.Value);
                Obj_Ingreso_DAL            = new Cls_Ingreso_DAL();
                Obj_Ingreso_DAL.sIdPersona = txtCedula.Value;
                Obj_Ingreso_DAL.fCosto     = Convert.ToSingle(TxtTotal.Value.Trim());
                Obj_Ingreso_BLL.Insertar_Ingreso_Factura(ref Obj_Ingreso_DAL);
                foreach (GridViewRow row in GridViewInvitados.Rows)
                {
                    Obj_Ingreso_DAL            = new Cls_Ingreso_DAL();
                    Obj_Ingreso_DAL.sIdPersona = txtCedula.Value;
                    Obj_Ingreso_DAL.fCosto     = Convert.ToSingle(row.Cells[3].Text);
                    Obj_Ingreso_DAL.fTotal     = Convert.ToSingle(row.Cells[3].Text);
                    Obj_Ingreso_BLL.Insertar_Detalle_Factura(ref Obj_Ingreso_DAL);
                }

                foreach (GridViewRow row in ServiciosGridView.Rows)
                {
                    if (row.RowType == DataControlRowType.DataRow)
                    {
                        CheckBox chkRow = (row.Cells[0].FindControl("chkRow") as CheckBox);
                        if (chkRow.Checked)
                        {
                            Obj_Ingreso_DAL                 = new Cls_Ingreso_DAL();
                            Obj_Ingreso_DAL.sIdPersona      = txtCedula.Value;
                            Obj_Ingreso_DAL.fCosto          = Convert.ToSingle(row.Cells[2].Text);
                            Obj_Ingreso_DAL.bIdTipoServicio = Convert.ToByte(row.Cells[0].Text);
                            Obj_Ingreso_DAL.fTotal          = Convert.ToSingle(row.Cells[2].Text);
                            Obj_Ingreso_BLL.Insertar_Detalle_Factura(ref Obj_Ingreso_DAL);
                        }
                    }
                }


                if (Total == 0)
                {
                    Response.Write("<script>window.alert('Ingreso realizado de forma correcto');</script>");
                }
                else
                {
                    Response.Write("<script>window.alert('Factura ingresada de forma correcta');</script>");
                }
            }
        }
예제 #4
0
        protected void btnagregarInvitado_Click(object sender, EventArgs e)
        {
            Obj_Ingreso_DAL            = new Cls_Ingreso_DAL();
            Obj_Ingreso_DAL.sIdPersona = txtInvitado.Value;
            Obj_Ingreso_BLL.Invitado_Beneficiario(ref Obj_Ingreso_DAL);
            if (Obj_Ingreso_DAL.DI.Tables.Count == 0)
            {
                Response.Write("<script>window.alert('La cedula ingresada no existe, por favor corroboré el dato o registrelo primero en el mantenimiento de personas');</script>");
            }
            else
            {
                DataTable  dI       = new DataTable();
                DataColumn dcCedula = new DataColumn(@"IdPersona", typeof(string));
                DataColumn dcNombre = new DataColumn(@"Nombre", typeof(string));
                DataColumn dcTipo   = new DataColumn(@"Tipo", typeof(string));
                DataColumn dcCosto  = new DataColumn(@"Costo", typeof(string));

                dI.Columns.Add(dcCedula);
                dI.Columns.Add(dcNombre);
                dI.Columns.Add(dcTipo);
                dI.Columns.Add(dcCosto);


                foreach (GridViewRow row in GridViewInvitados.Rows)
                {
                    dI.Rows.Add(row.Cells[0].Text.ToString(), row.Cells[1].Text.ToString(),
                                row.Cells[2].Text.ToString(), row.Cells[3].Text.ToString());
                }

                DataTable dt = Obj_Ingreso_DAL.DI.Tables[0];

                if (dt.Rows.Count == 0)
                {
                    Response.Write("<script>window.alert('La cedula ingresada no existe, por favor corroboré el dato o registrelo primero en el mantenimiento de personas');</script>");
                }

                else
                {
                    dI.Rows.Add(Obj_Ingreso_DAL.DI.Tables[0].Rows[0][0].ToString(), Obj_Ingreso_DAL.DI.Tables[0].Rows[0][1].ToString(),
                                Obj_Ingreso_DAL.DI.Tables[0].Rows[0][2].ToString(), Obj_Ingreso_DAL.DI.Tables[0].Rows[0][3].ToString());
                    foreach (DataRow row in dI.Rows)
                    {
                        GridViewInvitados.DataSource = dI;
                        GridViewInvitados.DataBind();
                        this.txtInvitado.Value = string.Empty;
                    }
                }
            }
        }
예제 #5
0
 public void Cargar(ref Cls_Ingreso_DAL Obj_Ingreso_DAL)
 {
     try
     {
         // Se instancia el Objeto de CatalogosMantenimientosClient (WCF)
         CatalogosMantenimientosClient Obj_Ingresos_Client = new CatalogosMantenimientosClient();
         // Se cargan trae el DataTable y se carga al Obj_Estado_DAL
         string sMsjError = string.Empty;
         Obj_Ingreso_DAL.DS.Tables.Add(Obj_Ingresos_Client.Cargar(Obj_Ingreso_DAL.sIdPersona, ref sMsjError));
         Obj_Ingresos_Client.Close();
         Obj_Ingreso_DAL.sMsj_error = sMsjError;
     }
     catch (Exception ex)
     {
         Obj_Ingreso_DAL.sMsj_error = ex.Message.ToString();
     }
 }