예제 #1
0
        /// <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);
            }
        }
예제 #2
0
        /// <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);
            }
        }