コード例 #1
0
    /*public int autogenera()
    {
        Conexion cn = new Conexion();
        SqlCommand cmd = new SqlCommand("Select count(*) from tb_detapedido", cn.getcn);
        cn.getcn.Open();
        int i = (int)cmd.ExecuteScalar() + 1;
        cn.getcn.Close();
        return (i);
    }*/
    protected void btnAgregar_Click(object sender, EventArgs e)
    {
        DetalleBL tabla =new DetalleBL((DataTable)Session["carrito"]);

        string message = tabla.Agregar(lblCodigo.Text,lblNombre.Text,decimal.Parse(lblPrecio.Text), decimal.Parse(txtCantidad.Text));

        //DatosDetallePedido dp = new DatosDetallePedido();
           // DatoSanguche ds = new DatoSanguche();
          /*  dp.Codigoped = dp.Codigoped;
        ds.Codigo = lblCodigo.Text;
        dp.Precio = decimal.Parse(lblPrecio.Text);
        dp.Cant = int.Parse(txtCantidad.Text);*/

        ClientScript.RegisterStartupScript(typeof(Page), "alert",
        "<script language=JavaScript>alert('" + (message) + "');</script>");

        Session["carrito"] = tabla.getregistro;
    }
コード例 #2
0
ファイル: wsDetalle.asmx.cs プロジェクト: diegoyurin/Grupo-2
        public string[] Agregar(string NroBoleta, string CodProducto, string cantidad)
        {
            Detalle detalle = new Detalle();

            detalle.NroBoleta   = NroBoleta;
            detalle.CodProducto = CodProducto;
            detalle.Cantidad    = int.Parse(cantidad);
            DetalleBL detalleBL = new DetalleBL();

            string[] respuesta = new string[2];
            bool     CodError  = detalleBL.Agregar(detalle);

            if (CodError == true)
            {
                respuesta[0] = "true";
            }
            else
            {
                respuesta[0] = "false";
            }
            respuesta[1] = detalleBL.Mensaje;
            return(respuesta);
        }
コード例 #3
0
 public JsonResult Agregar(DetalleInscripcion pDetalle)
 {
     return(Json(bl.Agregar(pDetalle), JsonRequestBehavior.AllowGet));
 }