Exemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            int      userId        = ResourcesHelper.CurrentUser.UserId;
            DateTime startDateTime = DateTime.Now.Date;
            DateTime endDateTime   = DateTime.Now.Date.AddDays(1);
            int      maxTodayId    = _saleOrderRepository.Query()
                                     .Count(x => x.DateOriginated >= startDateTime && x.DateOriginated < endDateTime) + 1;
            string saleOrderNo = string.Format("{0}{1}{2}",
                                               DateTime.Now.ToString("yyyyMMddHH"),
                                               userId,
                                               maxTodayId.ToString().PadLeft(4, '0'));

            var saleOrderForm = new SaleOrderForm(this, new DataModel.Model.SaleOrder
            {
                DateOriginated = DateTime.Now,
                SaleOrderNo    = saleOrderNo,
                OriginUserId   = userId
            });

            saleOrderForm.ShowDialog();
        }
Exemplo n.º 2
0
        private void ButEditSaleOrder_Click(object sender, RoutedEventArgs e)
        {
            var saleOrderForm = new SaleOrderForm(this, (DataModel.Model.SaleOrder)GridSaleOrders.SelectedItem);

            saleOrderForm.ShowDialog();
        }