コード例 #1
0
 private void BtnEdit_Click(object sender, EventArgs e)
 {
     SQLTrans.LoginData ldata = ((SQLTrans.LoginData)Session["userdata"]);
     try
     {
         int    img  = -1;
         string name = "";
         string url  = "";
         if (upload.HasFile)
         {
             name = clases.Tools.ImgName(upload.FileName, Server.MapPath("~/images/"));
             url  = "/images/" + name;
             img  = client.sp_AgregarImagen(ldata, url);
             upload.SaveAs(Server.MapPath(Path.Combine("~/images/", name)));
         }
         int id = int.Parse(Request["id"]);
         client.sp_AlterPlatillo(ldata, id, Convert.ToInt32(ddRestaurantes.SelectedValue), img, Convert.ToInt32(ddTipos.SelectedValue), txtNombre.Text, float.Parse(txtPrecio.Text), txtDescripcion.Text);
         output.Text = "Transaccion realizada!";
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         output.Text = "Ocurrio un error!";
     }
 }