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!";
     }
 }
 private void BtnEdit_Click(object sender, EventArgs e)
 {
     SQLTrans.LoginData         ldata  = ((SQLTrans.LoginData)Session["userdata"]);
     SQLTrans.CrudServiceClient client = new SQLTrans.CrudServiceClient();
     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)));
         }
         string id = Request["id"].ToString();
         if (ldata.isAdmin)
         {
             client.sp_AlterUsuario(ldata, id, img, txtNombre.Text, txtApellido.Text, txtCorreo.Text, txtBirth.Text, chkAdmin.Checked, null);
         }
         else
         {
             client.sp_AlterUsuario(ldata, id, img, txtNombre.Text, txtApellido.Text, txtCorreo.Text, txtBirth.Text, ldata.isAdmin, null);
         }
         output.Text = "Transaccion realizada!";
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         output.Text = "Ocurrio un error!";
     }
 }
 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_AlterRestaurant(ldata, id, img, -1, txtNombre.Text, txtReferencia.Text);
         output.Text = "Transaccion realizada!";
     }
     catch (Exception)
     {
         output.Text = "Ocurrio un error!";
     }
 }