Example #1
0
        protected void saveToConsulta(object sender, EventArgs e)
        {
            var oneConsulta = new Tabla_Catalogo_ConceptoPagoDTO();

            oneConsulta.Id_ConceptoPago = Convert.ToInt32(ddlConsulta.SelectedValue);
            oneConsulta = ConseptoPagoDAO.GetOne(oneConsulta);

            var oneTemp = new Tabla_Catalogo_Ticket();

            oneTemp.Id_Medicamento    = oneConsulta.Id_ConceptoPago;
            oneTemp.RazonSocial       = "";
            oneTemp.Costo             = Convert.ToInt32(oneConsulta.PrecioUnitario);
            oneTemp.NombreMedicamento = oneConsulta.NombreCorto_ConceptoPago;
            string  query = "insert into Tabla_Catalogo_TicketTemp  (Id_Medicamento, RazonSocial, Costo, NombreMedicamento) values (@Id_Medicamento, @RazonSocial, @Costo, @NombreMedicamento)";
            Helpers h     = new Helpers();

            h.ExecuteNonQueryParam(query, oneTemp);
            //txtDos.Value = "";
            //txtNot.Value = "";
            txtSearch.Text = "";
            //string script = "AlertaGuardar();";
            // ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", script, true);
            Page.Response.Redirect(Page.Request.Url.ToString(), true);
            //loadTemporal();
            return;
        }
        public void InsertarConcepto(Tabla_Catalogo_ConceptoPagoDTO oneConcepto)
        {
            string  query = @"
            INSERT INTO [dbo].[Tabla_Catalogo_ConceptoPago]
           ([Descripcion_ConceptoPago]
           ,[NombreCorto_ConceptoPago]
           ,[Estatus_ConceptoPago])
                VALUES
           (@Descripcion_ConceptoPago,
           @NombreCorto_ConceptoPago,
           @Estatus_ConceptoPago)
            ";
            Helpers h     = new Helpers();

            h.GetAllParametized(query, oneConcepto);
        }
Example #3
0
        protected void ddlConceptos_Selected(object sender, EventArgs e)
        {
            string  query       = "SELECT * FROM Tabla_Catalogo_ConceptoPago WHERE (Id_ConceptoPago=@Id_ConceptoPago)";
            var     oneConcepto = new Tabla_Catalogo_ConceptoPagoDTO();
            Helpers h           = new Helpers();

            oneConcepto.Id_ConceptoPago = Convert.ToInt32(ddlConceptos.SelectedValue);
            var lConceptos = h.GetAllParametized(query, oneConcepto);

            foreach (var y in lConceptos)
            {
                txtCantidad.Text  = "1";
                txtPrecio.Text    = y.PrecioUnitario.Trim();
                txtDescuento.Text = "0.0";
            }
            mpeThePopup.Show();
        }
Example #4
0
        private void loadData()
        {
            string  query       = "Select * from Tabla_Catalogo_ConceptoPago";
            string  queryFichas = "Select * from Tabla_Catalogo_FichaIdentificacion";
            var     oneFicha    = new Tabla_Catalogo_FichaIdentificacionDTO();
            var     oneConcepto = new Tabla_Catalogo_ConceptoPagoDTO();
            Helpers h           = new Helpers();
            var     lFichas     = h.GetAllParametized(queryFichas, oneFicha);

            foreach (var y in lFichas)
            {
                y._NombreCompleto = y.Nombre_FichaIdentificacion + " " + y.ApPaterno_FichaIdentificacion + " " + y.ApMaterno_FichaIdentificacion;
            }
            var lConceptos = h.GetAllParametized(query, oneConcepto);

            ddlFichas.DataSource = lFichas;
            ddlFichas.DataBind();
            ddlConceptos.DataSource = lConceptos;
            ddlConceptos.DataBind();
        }
Example #5
0
        protected void addConcepto(object sender, EventArgs e)
        {
            try
            {
                Helpers h     = new Helpers();
                string  query = "insert into Tabla_Catalogo_ConceptoPago (Descripcion_ConceptoPago, NombreCorto_ConceptoPago, Estatus_ConceptoPago, PrecioUnitario) VALUES (@Descripcion_ConceptoPago, @NombreCorto_ConceptoPago, @Estatus_ConceptoPago, @PrecioUnitario)";
                //string query = "insert into Tabla_Catalogo_ConceptoPago (Descripcion_ConceptoPago, NombreCorto_ConceptoPago, Estatus_ConceptoPago, PrecioUnitario) VALUES (1, 1, 1, 1)";
                var PagoUp = new Tabla_Catalogo_ConceptoPagoDTO();
                PagoUp.Descripcion_ConceptoPago = txtDescripcion.Text;
                PagoUp.NombreCorto_ConceptoPago = txtNombreCorto.Text;
                PagoUp.Estatus_ConceptoPago     = checkEstatus.Checked;
                PagoUp.PrecioUnitario           = txtPrecioPredef.Text;

                h.ExecuteNonQueryParam(query, PagoUp);
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Alert", "alert('ERROR,'" + ex + "')", true);
            }
            ViewState.Clear();
            Response.Redirect(Request.RawUrl);
        }