protected void btnSearchByName_Click(object sender, ImageClickEventArgs e) { try { PaymentsSL payments = new PaymentsSL(); DataTable aux = payments.GetFirstPaymentByName(txtNombre.Text.Trim()); if (aux.Rows.Count > 0) { Session["Information"] = aux; Session["StartTime"] = DateTime.Now; FillTextBoxes(); SetDataToGrids(); ClearBalances(); } else { lblMessageScreen1.Text = String.Format("El cliente con el nombre {0} no fue encontrado", txtNombre.Text.Trim()); lblMessageScreen1.CssClass = "error"; lblMessageScreen1.Visible = true; ClearAllData(); } } catch (Exception ex) { throw ex; } }
/// <summary> /// It catch when user clicks enter on Num Cliente's textbox /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnNumCliente_Click(object sender, EventArgs e) { try { PaymentsSL payments = new PaymentsSL(); DataTable aux = payments.GetFirstPayment(txtNumCliente.Text.Trim()); if (aux.Rows.Count > 0) { Session["Information"] = aux; Session["StartTime"] = DateTime.Now; FillTextBoxes(); SetDataToGrids(); ClearBalances(); } else { lblMessageScreen1.Text = String.Format("El cliente con el código {0} no fue encontrado", txtNumCliente.Text.Trim()); lblMessageScreen1.CssClass = "error"; lblMessageScreen1.Visible = true; ClearAllData(); } //pnlMainScreen.Enabled = false; } catch (Exception ex) { } }
private void SetPaymentFree() { PaymentsSL payments = new PaymentsSL(); DataTable data = Session["Information"] as DataTable; if (data.Rows.Count > 0) { payments.CustomerID = data.Rows[0]["PKCliente"].ToString().Trim(); payments.SetPaymentFree(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["UserName"] == null) { Response.Redirect("LogIn.aspx"); } else if (Session["UserName"].ToString() == "administrator" || Session["UserName"].ToString().ToLower() == "gtecobranza") { hrefSettings.Visible = true; } ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page); scriptManager.RegisterPostBackControl(this.btnCalificarLlamada); scriptManager.RegisterPostBackControl(this.btnAddTelefonoTit); scriptManager.RegisterPostBackControl(this.btnAddDomicilioTit); scriptManager.RegisterPostBackControl(this.btnAddTelefonoAval); scriptManager.RegisterPostBackControl(this.btnAddDomicilioAval); scriptManager.RegisterPostBackControl(this.btnBitacora); scriptManager.RegisterPostBackControl(this.ddlBitStatus); scriptManager.RegisterPostBackControl(this.btnNumCliente); scriptManager.RegisterPostBackControl(this.rblType); scriptManager.RegisterPostBackControl(this.btnObtenerSaldos); scriptManager.RegisterPostBackControl(this.btnSearchByName); if (IsPostBack) { TabName.Value = Request.Form[TabName.UniqueID]; lblMessageScreen1.Visible = false; } else { PaymentsSL payments = new PaymentsSL(); Session["Information"] = payments.GetFirstPaymentByUser(Session["IDUser"].ToString()); Session["StartTime"] = DateTime.Now; DataTable data = Session["Information"] as DataTable; if (data.Rows.Count > 0) { payments.CustomerID = data.Rows[0]["PKCliente"].ToString().Trim(); payments.SetPaymentBusy(); SetInitialData(); btnBitacora.Enabled = true; } else //there aren't elements in queue { DisableFields(); FillDropDowns(); btnBitacora.Enabled = false; } } }
protected void hrefSettings_ServerClick(object sender, EventArgs e) { try { PaymentsSL payments = new PaymentsSL(txtNumCliente.Text.Trim()); payments.SetPaymentFree(); Response.Redirect("Settings.aspx"); } catch (Exception ex) { throw ex; } }
protected void rblType_SelectedIndexChanged(object sender, EventArgs e) { try { PaymentsSL payments = new PaymentsSL(txtNumCliente.Text.Trim()); payments.SetPaymentFree(); ClearAllData(); if (rblType.SelectedItem.Value == "Automatico") { //queue Session["Information"] = payments.GetFirstPaymentByUser(Session["IDUser"].ToString()); Session["StartTime"] = DateTime.Now; DataTable data = Session["Information"] as DataTable; if (data.Rows.Count > 0) { payments.CustomerID = data.Rows[0]["PKCliente"].ToString().Trim(); payments.SetPaymentBusy(); SetInitialData(); btnBitacora.Enabled = true; } btnSearchByName.Visible = false; pnlMainScreen.Enabled = false; } else { pnlMainScreen.Enabled = true; DisableFieldsManual(false); //txtNombre.Enabled = true; txtNombre.Focus(); //txtNumCliente.Enabled = true; btnSearchByName.Visible = true; } } catch (Exception ex) { throw ex; } }
private void FillTextBoxes() { DataTable information = Session["Information"] as DataTable; if (information.Rows.Count > 0) // it has information... { //first tab txtNombre.Text = information.Rows[0]["NombreTitular"].ToString().Trim(); txtNumCliente.Text = information.Rows[0]["PKCliente"].ToString().Trim(); txtMovil.Text = information.Rows[0]["CelularTitular"].ToString().Trim(); txtCasa.Text = information.Rows[0]["TelefonoCasa"].ToString().Trim(); txtEmpleo.Text = information.Rows[0]["TelefonoEmpleo"].ToString().Trim(); txtOtros1.Text = information.Rows[0]["Nextel"].ToString().Trim(); txtOtros2.Text = information.Rows[0]["LargaDistanciaLocal"].ToString().Trim(); txtCorreoElectronico.Text = information.Rows[0]["CorreoElectronico"].ToString().Trim(); txtFechaMaxVencimiento.Text = information.Rows[0]["FechaMaximoVencimiento"].ToString().Trim(); txtMontoFinanciado.Text = String.Format("{0:C}", information.Rows[0]["MontoFinanciado"]); txtMontoActual.Text = String.Format("{0:C}", information.Rows[0]["MontoActual"]); txtFechaUltimaPago.Text = information.Rows[0]["FechaUltimoPago"].ToString().Trim(); txtMontoUltimoPago.Text = String.Format("{0:C}", information.Rows[0]["MontoUltimoPago"]); txtNumRefPago1.Text = information.Rows[0]["NumReferencia1"].ToString().Trim() != String.Empty && information.Rows[0]["NumReferencia1"] != DBNull.Value ? information.Rows[0]["NumReferencia1"].ToString().Trim() : information.Rows[0]["NumReferencia2"].ToString().Trim(); txtSerieDoctoCurso.Text = information.Rows[0]["DocumentoCurso"].ToString().Trim(); txtUnidadFinanciada.Text = information.Rows[0]["UnidadEquipoFinanciado"].ToString().Trim(); txtDoctosVencidos.Text = information.Rows[0]["DocumentosVencidos"].ToString().Trim(); txtDiasDcoMaximoVencidos.Text = information.Rows[0]["DiasVencidosDocumento"].ToString().Trim(); txtTipoCredito.Text = information.Rows[0]["TipoCredito"].ToString().Trim(); txtHistoricoDeMora.Text = information.Rows[0]["HistorialMora"].ToString().Trim(); //contracts DataTable aux = new PaymentsSL().GetContracts(txtNumCliente.Text); if (aux.Rows.Count > 0) { txtNumContrato1.Text = aux.Rows[0]["Contrato"].ToString(); txtNumContrato2.Text = aux.Rows.Count > 1 ? aux.Rows[1]["Contrato"].ToString() : String.Empty; txtNumContrato3.Text = aux.Rows.Count > 2 ? aux.Rows[2]["Contrato"].ToString() : String.Empty; } //second tab txtTitNombre.Text = information.Rows[0]["NombreTitular"].ToString().Trim(); txtTitNumCliente.Text = information.Rows[0]["PKCliente"].ToString().Trim(); txtTitEmail.Text = information.Rows[0]["CorreoElectronico"].ToString().Trim(); txtTitNumRef1.Text = information.Rows[0]["NumReferencia1"].ToString().Trim(); txtTitNumRef2.Text = information.Rows[0]["NumReferencia2"].ToString().Trim(); //thrid tab txtAvalNombre.Text = information.Rows[0]["NombreAval"].ToString().Trim(); txtAvalNumCliente.Text = information.Rows[0]["PKCliente"].ToString().Trim(); if (txtAvalNombre.Text == String.Empty) { btnAddDomicilioAval.Enabled = false; btnAddTelefonoAval.Enabled = false; } //fourth tab txtBitNombre.Text = information.Rows[0]["NombreTitular"].ToString().Trim(); txtBitNumCliente.Text = information.Rows[0]["PKCliente"].ToString().Trim(); txtBitNumRef1.Text = information.Rows[0]["NumReferencia1"].ToString().Trim(); txtBitNumRef2.Text = information.Rows[0]["NumReferencia2"].ToString().Trim(); } }