Example #1
0
        public Cliente()
        {
            m_invoiceItem = new OrdenItem();

            InitializeComponent();
            llenarcombos();
            Folioo.Focus();
        }
Example #2
0
        void myDialog_UpdateRequested(object sender, EventArgs e)
        {
            OrdenItem item = (e as FieldsUpdateEventArgs).UpdatedFields;

            AddItem(item, false);
            UpdateTotal();
            agreItem(item);
            m_fieldsPopup.Close();
        }
Example #3
0
        private void agreItem(OrdenItem item)
        {
            m_cliente  = new Cliente();
            item.Marca = m_cliente.Marci;

            item.Numero_De_Documento = GlobalId.Identificador;

            item.Renglon = estrella;
            // item.Renglon = tabla.Rows.Count;
            tabla.Rows.Add(item.Numero_De_Documento, item.Renglon, item.Codigo, item.Descripcion, item.Cantidad, item.Preciolista, item.Nivel, item.Rate, item.Total);
            estrella = estrella + 1;
        }
Example #4
0
        public OrdenDialog(OrdenItem newItem, string title)
        {
            InitializeComponent();


            dataGrid1.ShowGroupPanel = false;
            llenargrid();

            if (newItem == null)
            {
                rate.Value = 0.00;
                //prueba usando datacontext
                //InvoiceItem newItem;
                newItem = new OrdenItem();
            }

            item.Text = newItem.Codigo;

            item_Copy.Text = newItem.Descripcion;
            // newItem.Cantidad = GetQuantityAsInt();
            //newItem.Cantidad = 2;
            // rate.Value = 80.00;
            //llenarcombobox(item.Text);
            rate.Value     = 00.00;
            m_invoiceItem  = newItem;
            Cantidad.Value = newItem.Cantidad;
            Empleado.Value = newItem.Empleado;



            if (newItem.Cantidad == 0)
            {
                newItem.Cantidad    = GetQuantityAsInt();
                this.Cantidad.Value = 1;
                CalculateTax();
                UpdateTotalAmount();
            }


            if (newItem.Empleado == 0)
            {
                this.Empleado.Value = 1;
            }
            //newItem.Codigo = item.Text;
            //
            // newItem.Descripcion = item_Copy.Text;

            // newItem.Rate = (double)rate.Value;
            // m_invoiceItem = newItem;
            this.DataContext = m_invoiceItem;
            //// llenargrid();
        }
Example #5
0
        public async Task <bool> Clan(string codigo, int renglon)
        {
            var client = new HttpClient();
            var model  = new OrdenItem
            {
                Numero_De_Documento = codigo,
                Renglon             = renglon
            };

            var         json    = JsonConvert.SerializeObject(model);
            HttpContent content = new StringContent(json);

            content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");

            var response = await client.PostAsync("https://funcionggsolution.azurewebsites.net/api/SaveData", content);

            return(response.IsSuccessStatusCode);
        }
Example #6
0
        private void InvoiceGrid_DoubleTapped(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            FrameworkElement element = null;

            if ((element = e.OriginalSource as FrameworkElement) != null)
            {
                m_selectedIndex = Grid.GetRow(element);
            }
            OrdenItem invoiceItem = m_items[m_selectedIndex];

            //esta no estaba comentada int selectedProductIndex = m_productList.IndexOf(m_productList[invoiceItem.Descripcion]);
            m_fieldsPopup = new OrdenDialog(invoiceItem, "Edit the Fields");
            m_fieldsPopup.UpdateRequested += EditDialog_UpdateRequested;
            m_fieldsPopup.CloseRequested  += EditDialog_CloseRequested;
            m_fieldsPopup.lblTitle.Content = "Editar Articulos";
            RootGrid.Opacity      = 0.2;
            m_fieldsPopup.Opacity = 1;
            m_fieldsPopup.ShowDialog();
            RootGrid.Opacity = 1;
        }
Example #7
0
        public void AddItem(OrdenItem item, bool addToGridAlone)
        {
            int rowIndex = m_currentRowIndex;

            if (!addToGridAlone)
            {
                m_items.Add(item);
            }

            if (!(InvoiceGrid.RowDefinitions.Count > m_currentRowIndex))
            {
                InvoiceGrid.RowDefinitions.Add(CreateRowDefinition(m_rowHeight));
            }
            DrawBorder(rowIndex);


            SetCell(rowIndex, 0, item.Codigo.ToString());
            SetCell(rowIndex, 1, item.Descripcion.ToString());
            SetCell(rowIndex, 2, item.Cantidad.ToString());
            SetCell(rowIndex, 3, item.Preciolista.ToString("#,###.00", CultureInfo.InvariantCulture));
            SetCell(rowIndex, 4, item.Nivel.ToString());
            SetCell(rowIndex, 5, "$" + item.Rate.ToString("#,###.00", CultureInfo.InvariantCulture));
            SetCell(rowIndex, 6, "$" + item.Total.ToString("#,###.00", CultureInfo.InvariantCulture));
            //SetCell(rowIndex, 7, "$" + item.Total.ToString("#,###.00", CultureInfo.InvariantCulture));
            //SetCell(rowIndex, 8, "$" + item.Iva.ToString("#,###.00", CultureInfo.InvariantCulture));

            //<Rectangle Grid.Row="0" Height="1" StrokeThickness="0.75" VerticalAlignment="Bottom" Grid.ColumnSpan="5"
            //StrokeDashArray="4,4" Stroke="#FFCECECE"></Rectangle>

            m_totalDue  += Convert.ToDouble(item.Total);
            m_totalCant += Convert.ToDouble(item.Cantidad);
            m_currentRowIndex++;
            m_selectedIndex = m_items.Count;
            UpdateTotal();
            UpdateCantidad();
        }