protected void btnBuscarUsuario_Click(object sender, EventArgs e) { if (Session["Usuario"] == null) { ScriptManager.RegisterStartupScript(Page, this.GetType(), "mykey", "CancelEdit();", true); } ComisionWCFClient objComisionWCF = new ComisionWCFClient(); Personal_BuscarResult objUsuario; try { decimal numero; objUsuario = objComisionWCF.Personal_Buscar(int.Parse(cboEmpresa.SelectedValue), ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, cboEmpresa.SelectedValue, cboCargo.SelectedValue, acbUsuario.Text.Split('-')[0]).Single(); txtNroDocumento.Text = objUsuario.NroDocumento; txtNombre.Text = objUsuario.Nombres; txtApellidos.Text = objUsuario.ApPaterno + " " + objUsuario.ApMaterno; cboEstado.SelectedValue = Convert.ToInt32(objUsuario.Comision).ToString(); numero = Convert.ToDecimal(objUsuario.porcentaje); numero = numero * 100; txtComision.Text = numero.ToString(); btnGuardar.Enabled = true; } catch (Exception ex) { lblMensaje.Text = ex.Message; lblMensaje.CssClass = "mensajeError"; } }
protected void btnGuardar_Click(object sender, EventArgs e) { if (Session["Usuario"] == null) { ScriptManager.RegisterStartupScript(Page, this.GetType(), "mykey", "CancelEdit();", true); } ComisionWCFClient objComison = new ComisionWCFClient(); int idEmpresa = 0; string nroDocumento = null; try { nroDocumento = cboPersonal.SelectedValue; idEmpresa = int.Parse(cboEmpresa.SelectedValue); decimal porcentaje; porcentaje = Convert.ToDecimal(txtComision.Text); porcentaje = (porcentaje / 100); objComison.Zona_Registrar(idEmpresa, int.Parse(cboZonas.SelectedValue), nroDocumento, ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, cboCargo.SelectedValue, porcentaje, int.Parse(cboEstado.SelectedValue)); ScriptManager.RegisterStartupScript(Page, this.GetType(), "mykey", "CloseAndRebind(" + nroDocumento + ");", true); } catch (Exception ex) { lblMensaje.Text = "ERROR: " + ex.Message; lblMensaje.CssClass = "mensajeError"; } }
public static AutoCompleteBoxData Item_BuscarUsuario(object context) { string idempresa; string idCargo; AutoCompleteBoxData res = new AutoCompleteBoxData(); string searchString = ((Dictionary <string, object>)context)["Text"].ToString(); if (!string.IsNullOrEmpty(searchString) && searchString.Length >= 4) { ComisionWCFClient objUsuarioWCF = new ComisionWCFClient(); idempresa = HttpContext.Current.Session["idempresa"].ToString(); idCargo = HttpContext.Current.Session["idCargo"].ToString(); List <Personal_BuscarResult> lst = objUsuarioWCF.Personal_Buscar(int.Parse(idempresa), ((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).codigoUsuario, idempresa, idCargo, searchString).ToList(); List <AutoCompleteBoxItemData> result = new List <AutoCompleteBoxItemData>(); foreach (Personal_BuscarResult usuario in lst) { if (result.FindAll(x => x.Text == usuario.NroDocumento + "-" + usuario.Nombres).Count == 0) { AutoCompleteBoxItemData childNode = new AutoCompleteBoxItemData(); childNode.Text = usuario.NroDocumento + "-" + usuario.Nombres + " " + usuario.ApPaterno; childNode.Value = usuario.NroDocumento; result.Add(childNode); } } res.Items = result.ToArray(); } return(res); }
private void button1_Click(object sender, EventArgs e) { ComisionWCFClient objComisionWCF = new ComisionWCFClient(); var idEmpresa = int.Parse(cboEmpresa.SelectedValue.ToString()); int idUsuario = 100; var list = objComisionWCF.gsReporteCanceladosVentasLista(idEmpresa, idUsuario); }
private void PromotoresZona_Detalle(int reporte, string NroDocumento, int id_zona, string texto) { ComisionWCFClient objComision = new ComisionWCFClient(); List <Personal_ListarTotalResult> lstdetalle; try { lstdetalle = objComision.Personal_ListarTotal(int.Parse(cboEmpresa.SelectedValue), ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, cboEmpresa.SelectedValue, null, texto, reporte, id_zona).ToList(); grdPromotores.DataSource = lstdetalle; grdPromotores.DataBind(); ViewState["lstdetalle"] = JsonHelper.JsonSerializer(lstdetalle); } catch (Exception ex) { throw ex; } }
private void Zona_Listar() { ComisionWCFClient objZonaWCF = new ComisionWCFClient(); try { List <gsZonasComision_ListarResult> lstZona = objZonaWCF.ZonasComision_Listar(((Usuario_LoginResult)Session["Usuario"]).idEmpresa, ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario).ToList(); grdZona.DataSource = lstZona; grdZona.DataBind(); ViewState["lstZona"] = JsonHelper.JsonSerializer(lstZona); } catch (Exception ex) { throw ex; } }
private void Zona_Cargar(string NroDocumento) { ComisionWCFClient objPersonalWCF = new ComisionWCFClient(); try { List <gsZonas_ListarResult> lstPersonal = objPersonalWCF.Zonas_Listar(int.Parse(cboEmpresa.SelectedValue), ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, NroDocumento, 0).ToList(); cboZonas.DataSource = lstPersonal; cboZonas.DataBind(); } catch (Exception ex) { throw ex; } }
private void Cargo_Cargar(string IdEmpresa) { ComisionWCFClient objComision = new ComisionWCFClient(); try { cboCargo.DataSource = objComision.CargoRH_Listar(IdEmpresa); cboCargo.DataBind(); cboCargo.Items.Insert(0, new RadComboBoxItem("SELECCIONAR", "0")); cboCargo.SelectedIndex = 0; } catch (Exception ex) { throw ex; } }
private void Reporte_Cargar(string IdEmpresa) { ComisionWCFClient objComision = new ComisionWCFClient(); try { cboReporte.DataSource = objComision.combo_Reporte(); cboReporte.DataBind(); cboReporte.Items.Insert(0, new RadComboBoxItem("SELECCIONAR", "0")); cboReporte.SelectedIndex = 0; } catch (Exception ex) { throw ex; } }
private void Personal_Cargar() { ComisionWCFClient objPersonalWCF = new ComisionWCFClient(); try { List <Personal_ListarTotalResult> lstPersonal = objPersonalWCF.Personal_ListarTotal(int.Parse(cboEmpresa.SelectedValue), ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, cboEmpresa.SelectedValue, cboCargo.SelectedValue, "", 0, 0).ToList(); cboPersonal.DataSource = lstPersonal; cboPersonal.DataBind(); cboPersonal.Items.Insert(0, new RadComboBoxItem("SELECCIONAR", "0")); cboPersonal.SelectedIndex = 0; } catch (Exception ex) { throw ex; } }
private void Reporte_Cargar(string IdEmpresa) { ComisionWCFClient objComision = new ComisionWCFClient(); try { cboReporte.DataSource = objComision.combo_Reporte(); cboReporte.DataBind(); cboReporte.Items.Insert(0, new RadComboBoxItem("SELECCIONAR", "0")); cboReporte.SelectedIndex = 0; } catch (Exception ex) { lblMensaje.Text = ex.Message; lblMensaje.CssClass = "mensajeError"; } }
private void ZonaPersonal_Detalle(string NroDocumento, int id_zona, string texto) { ComisionWCFClient objComision = new ComisionWCFClient(); List <ZonaPersonal_ListarResult> lstdetalle; try { lstdetalle = objComision.ZonaPersonal_Listar(int.Parse(cboEmpresa.SelectedValue), ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, NroDocumento, id_zona, texto).ToList(); grdZonas.DataSource = lstdetalle; grdZonas.DataBind(); ViewState["lstdetalle"] = JsonHelper.JsonSerializer(lstdetalle); } catch (Exception ex) { lblMensaje.Text = "ERROR: " + ex.Message; lblMensaje.CssClass = "mensajeError"; } }
private void Zona_Cargar() { ComisionWCFClient objZonaWCF = new ComisionWCFClient(); try { List <gsZonasComision_ListarResult> lstZona = objZonaWCF.ZonasComision_Listar(((Usuario_LoginResult)Session["Usuario"]).idEmpresa, ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario).ToList(); cboZonas.DataSource = lstZona; cboZonas.DataBind(); cboZonas.Items.Insert(0, new RadComboBoxItem("SELECCIONAR", "0")); cboZonas.SelectedIndex = 0; } catch (Exception ex) { throw ex; } }
private void Personal_Listar(int idEmpresa, int idUsario, string codigoEmpresa, string codigoCargo, string descripcion, int reporte) { ComisionWCFClient objPersonalWCF = new ComisionWCFClient(); try { List <Personal_ListarTotalResult> lstPersonal = objPersonalWCF.Personal_ListarTotal(idEmpresa, idUsario, codigoEmpresa, codigoCargo, descripcion, reporte, 0).ToList(); grdPersonal.DataSource = lstPersonal; grdPersonal.DataBind(); lblCorrida.Text = "1"; ViewState["lstPersonal"] = JsonHelper.JsonSerializer(lstPersonal); } catch (Exception ex) { throw ex; } }
private void Zona_Listar(int idEmpresa, int idUsario, string codigoEmpresa, string codigoCargo, string descripcion, int reporte) { ComisionWCFClient objZonaWCF = new ComisionWCFClient(); try { List <gsZonasComision_ListarResult> lstZona = objZonaWCF.ZonasComision_Listar(((Usuario_LoginResult)Session["Usuario"]).idEmpresa, ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario).ToList(); grdZona.DataSource = lstZona; grdZona.DataBind(); lblCorrida.Text = "1"; ViewState["lstZona"] = JsonHelper.JsonSerializer(lstZona); } catch (Exception ex) { throw ex; } }
protected void btnGuardar_Click(object sender, EventArgs e) { if (Session["Usuario"] == null) { ScriptManager.RegisterStartupScript(Page, this.GetType(), "mykey", "CancelEdit();", true); } ComisionWCFClient objComsion = new ComisionWCFClient(); decimal numero; bool estado = false; try { numero = Convert.ToDecimal(txtProcentaje.Text); numero = (numero / 100); if (cboEstado.SelectedValue == "1") { estado = true; } else { estado = false; } objComsion.ZonasComision_Insert(int.Parse(cboEmpresa.SelectedValue), int.Parse(txtCodigoZona.Text), ((Usuario_LoginResult)Session["Usuario"]).idUsuario, numero, estado); ScriptManager.RegisterStartupScript(Page, this.GetType(), "mykey", "CloseAndRebind(" + txtCodigoZona.Text + ");", true); } catch (Exception ex) { lblMensaje.Text = "ERROR: " + ex.Message; lblMensaje.CssClass = "mensajeError"; } }