protected void btnGuardar_Click(object sender, EventArgs e) { if (PC == null) { PC = new Struct_PrintConfiguration(UserId, cmbPuerto.SelectedItem.Text, cmbPrintersModels.SelectedItem.Text, int.Parse(txtBaudios.Text)); } else { PC.Baudios = int.Parse(txtBaudios.Text); PC.Modelo = cmbPrintersModels.SelectedItem.Text; PC.Puerto = cmbPuerto.SelectedItem.Text; } PC.Guardar(); }
protected void Page_Load(object sender, EventArgs e) { try { string hostname = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + ResolveUrl("~/"); hostn.Value = hostname; Data2.Connection.D_StaticWebService SWS = new Data2.Connection.D_StaticWebService(); KEY.Value = SWS.GetPrivateKeyByIdUser(UserId); PC = Data2.Class.Struct_PrintConfiguration.GetPrintConfiguration(UserId); if (!IsPostBack) { if (Request["EdcVen"] != null && Request["NV"] != null && Request["PR"] != null) { EdcVen(); } if (Request["DelVen"] != null) { BorrarVendedor(Request["DelVen"]); } if (Request["EdtVen"] != null) { int idVen = int.Parse(Request["EdtVen"]); List <Data2.Class.Struct_Vendedores> LV = Data2.Class.Struct_Vendedores.GetAllVendedores(UserId); if (LV != null) { foreach (Data2.Class.Struct_Vendedores V in LV) { if (V.Id == idVen) { txt_EdcNombre.Attributes.Add("placeholder", V.NombreVendedor); txt_EdcPorcentaje.Attributes.Add("placeholder", V.Porcentaje.ToString("#.##")); idEdition.Value = idVen.ToString(); } } } } else { idEdition.Value = "0"; } LlenarCamposPrinter(); LlenarCamposUserConfig(); } LlenarIMGLogo(); LlenarCamposVendedores(); } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }