/// <summary> /// Carga la encuesta de satisfacción. /// </summary> public void LoadPoll() { try { PollManager pollManager = new PollManager(); Poll poll = pollManager.GetInstantPoll(); SessionUtilHelper.KeepInSession(poll.Id.ToString(), Session); if (poll != null && poll.Questions.Count > 0) { txtPollTitle.InnerText = poll.Name; pollRepeater.DataSource = poll.Questions; pollRepeater.DataBind(); divPoll.Visible = true; } else { // No es prolijo porque se mezcla la parte visual con los datos, pero sirve divPoll.Visible = false; } } catch (Exception exception) { //TODO - aplicar contorl e errores //((front)Master).Alert.Show("Excepción", exception.Message); } }
/// <summary> /// Muestra el formulario para realizar responder la pregunta. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected override void PerformGenericAction(object sender, UbiquicityEventArg e) { int id = Convert.ToInt32(e.TheObject.ToString()); ItemCommentManager itemCommentManager = new ItemCommentManager(); ItemComment itemComment = itemCommentManager.Get(id); if (itemComment == null && itemCommentManager.HasErrors) { Alert.ShowUP("Error", itemCommentManager.ErrorDescription); } else { //Si existe la referencia, entonces a sido respondida if (itemComment.SentenceReference == null) { UCFormInquiry.CleanForm(); UCFormInquiry.FillForm(itemComment); SessionUtilHelper.KeepInSession(id.ToString(), Session); ScriptManager.RegisterStartupScript(upUCModalForm, upUCModalForm.GetType(), "openModalCreate", "$('#modalInquiry').modal('show');", true); upUCModalForm.Update(); } else { Alert.ShowUP("Respuesta", "Esta pregunta ya ha sido respondida; no hay acciones disponibles."); } } }
/// <summary> /// Ejecuta el pago contemplando los distintos métodos de pago. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void PerformCheckout(object sender, EventArgs e) { try { InvoiceManager invoiceManager = new InvoiceManager(); List <PaymentMethod> paymenMethods = new List <PaymentMethod>(); //Modelo la factura Invoice invoice = new Invoice(); invoice.User = SessionHelper.GetUser(); invoice.BillingAddress = GetBillingAddress(); invoice.CreditCard = GetCreditCard(); invoice.CreditNotes = GetCreditNotes(); invoice.InvoiceItems = GetInvoiceItems(); // Procesamiento del pago y creación de la facturación bool success = invoiceManager.ProcessPayment(invoice); if (!success && invoiceManager.HasErrors) { ((front)Master).Alert.Show("Error", invoiceManager.ErrorDescription); } else { SessionUtilHelper.KeepInSession(invoice.Id.ToString(), Session); Response.Redirect("/invoice_finish.aspx"); } } catch (Exception exception) { ((front)Master).Alert.Show("Exception", exception.Message); } }
/// <summary> /// Muestra en pantalla el mensaje; si los labels fueron asignados, se muestran los botones. /// </summary> /// <param name="title"></param> /// <param name="message"></param> /// <param name="button1Label"></param> /// <param name="button2Label"></param> public void Show(Map map) { SessionUtilHelper.KeepInSession(map.Id.ToString(), Session); LoadComments(map.Id); //super turbio: almaceno el id para saber, al momento de comentar, a qué producto le pertenece. btnComentar.CommandArgument = map.Id.ToString(); //this.message = map.Description; PopulateItemDetail(map); //Page.ClientScript.RegisterStartupScript(this.GetType(), "openModalItemShop", "window.onload = function() { $('#ucModalItemShop').modal('show'); }", true); ScriptManager.RegisterStartupScript(upItemShop, upItemShop.GetType(), "openModalItemShop", "$('#ucModalItemShop').modal('show');", true); upItemShop.Update(); }
/// <summary> /// Muestra el formulario para realizar responder la pregunta. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected override void PerformGenericAction(object sender, UbiquicityEventArg e) { try { int id = Convert.ToInt32(e.TheObject.ToString()); //UCFormInquiry.CleanForm(); //UCFormInquiry.FillForm(itemComment); SessionUtilHelper.KeepInSession(id.ToString(), Session); //ScriptManager.RegisterStartupScript(upUCModalForm, upUCModalForm.GetType(), "openModalCreate", "$('#modalInquiry').modal('show');", true); //upUCModalForm.Update(); //SessionUtilHelper.KeepInSession(e.CommandArgument.ToString(), Session); //Page.ClientScript.RegisterStartupScript(this.GetType(), "openModal", "window.onload = function() { $('#modalInvoiceItemSupport').modal('show'); }", true); UCModalInvoiceItemSupport.LoadCommentsSupport(id); ScriptManager.RegisterStartupScript(upUCModalInvoiceItemSupport, upUCModalInvoiceItemSupport.GetType(), "openModalCreate", "$('#modalInvoiceItemSupport').modal('show');", true); upUCModalInvoiceItemSupport.Update(); } catch (Exception exception) { Alert.Show("Excepción", exception.Message); } }
/// <summary> /// Atiende la ejecución de las acciones generadas según el estado del tracking. /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void PerformTrackingAction(object source, RepeaterCommandEventArgs e) { try { if (e.CommandName == PERFORM_CLAIM) { int invoiceItemId = Convert.ToInt32(e.CommandArgument); CreditNoteManager creditNoteManager = new CreditNoteManager(); bool success = creditNoteManager.ClaimCreditNote(invoiceItemId); if (!success && creditNoteManager.HasErrors) { ((front)Master).Alert.Show("Error", creditNoteManager.ErrorDescription); } else { LoadProductTracking(); ((front)Master).Alert.Show("Nota de crédito", "Se ha generado una nota de crédito, pendiente de aprobación"); } } else if (e.CommandName == PERFORM_RANKING) { SessionUtilHelper.KeepInSession(e.CommandArgument.ToString(), Session); Page.ClientScript.RegisterStartupScript(this.GetType(), "openModal", "window.onload = function() { $('#modalRanking').modal('show'); }", true); } else if (e.CommandName == PERFORM_SUPPORT) { SessionUtilHelper.KeepInSession(e.CommandArgument.ToString(), Session); Page.ClientScript.RegisterStartupScript(this.GetType(), "openModal", "window.onload = function() { $('#modalInvoiceItemSupport').modal('show'); }", true); UCModalInvoiceItemSupport.LoadCommentsSupport(Convert.ToInt32(e.CommandArgument.ToString())); } } catch (Exception exception) { ((front)Master).Alert.Show("Exception", exception.Message); } }