示例#1
0
        /// <summary>
        /// Ejecuta la valración
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void PerformRanking(object sender, EventArgs e)
        {
            try
            {
                int             invoiceItemId   = Convert.ToInt32(SessionUtilHelper.GetIdFromSession(Session));
                TrackingManager trackingManager = new TrackingManager();

                //TODO - AGREGAR CONTROL DE ERROR
                Tracking tracking = trackingManager.Get(invoiceItemId);

                tracking.Ranking = UCFormRanking.Ranking;
                tracking.Status  = Tracking.StatusType.Valorado;

                bool success = trackingManager.Edit(tracking);

                if (!success && trackingManager.HasErrors)
                {
                    ((front)Master).Alert.Show("Error", trackingManager.ErrorDescription);
                }
                else
                {
                    LoadProductTracking();
                }
                //}
            }
            catch (Exception exception)
            {
                ((front)Master).Alert.Show("Exception", exception.Message);
            }
        }
示例#2
0
        /// <summary>
        /// Carga la información sobre la trazabilidad de los productos adquiridos.
        /// </summary>
        private void LoadProductTracking()
        {
            try
            {
                TrackingManager trackingManager = new TrackingManager();
                List <Tracking> accountsDetail  = trackingManager.Get(SessionHelper.GetUser());

                if (trackingManager.HasErrors)
                {
                    ((front)Master).Alert.Show("Error", trackingManager.ErrorDescription);
                }
                else
                {
                    productRepeater.DataSource = accountsDetail;
                    productRepeater.DataBind();
                }
            }
            catch (Exception exception)
            {
                ((front)Master).Alert.Show("Exception", exception.Message);
            }
        }