Example #1
0
        private void mnuPrint_Click(object sender, EventArgs e)
        {
            try
            {
                if (DGrid.RowCount <= 0 || DGrid.CurrentRow == null)
                {
                    return;
                }
                var guid  = (Guid)DGrid[dgGuid.Index, DGrid.CurrentRow.Index].Value;
                var order = OrderBussines.Get(guid);
                if (order == null)
                {
                    return;
                }

                var reportList = new List <OrderReportBussines>();

                foreach (var item in order.DetList)
                {
                    reportList.Add(new OrderReportBussines()
                    {
                        CompanyName          = "گروه فنی و مهندسی آراد",
                        CompanyTell          = "09382420272",
                        ContractCode         = order.ContractCode,
                        CustomerAddress      = order.Customer?.Address,
                        CustomerName         = order.CustomerName,
                        CustomerSerialNumber = order.Customer?.AppSerial,
                        CustomerTell         = order.Customer?.Tell1,
                        DateSh          = order.DateSh,
                        OdrerDiscount   = order.Discount,
                        OrderSum        = order.Sum,
                        OrderTotal      = order.Total,
                        OrderUserName   = order.UserName,
                        ProductCount    = item.Count,
                        ProductDiscount = item.Discount,
                        ProductName     = item.ProductName,
                        ProductPrice    = item.Price,
                        ProductTotal    = item.Total,
                        Time            = order.Date.ToShortTimeString(),
                        OrderTotalName  = $"{NumberToString.Num2Str(order.Total.ToString().ParseToDouble().ToString())} ریال"
                    });
                }

                var cls = new ReportGenerator(StiType.DepartmentOrder, EnPrintType.Pdf_A4)
                {
                    Lst = new List <object>(reportList?.OrderBy(q => q.ProductName))
                };
                cls.PrintNew();
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }
        }
Example #2
0
 public frmOrderMain(Guid guid)
 {
     InitializeComponent();
     _cls = OrderBussines.Get(guid);
 }