Exemple #1
0
        public static ListView getWODetailListView(workorderheader woh)
        {
            ListView lv = new ListView();

            try
            {
                lv.View               = View.Details;
                lv.LabelEdit          = true;
                lv.AllowColumnReorder = true;
                lv.CheckBoxes         = true;
                lv.FullRowSelect      = true;
                lv.GridLines          = true;
                lv.Sorting            = System.Windows.Forms.SortOrder.Ascending;
                workorderheader        wohMain   = WorkOrderDB.getTempNoAndDateOfWO(woh);
                List <workorderdetail> WODetList = WorkOrderDB.getWorkOrderDetails(wohMain);
                ////int index = 0;
                lv.Columns.Add("Select", -2, HorizontalAlignment.Left);
                lv.Columns.Add("RefNo", -2, HorizontalAlignment.Left);
                lv.Columns.Add("Item ID", -2, HorizontalAlignment.Left);
                lv.Columns.Add("Item Name", -2, HorizontalAlignment.Center);
                lv.Columns.Add("Tax Code", -2, HorizontalAlignment.Left);
                lv.Columns.Add("Work Desc", -2, HorizontalAlignment.Left);
                lv.Columns.Add("Work Loc", -2, HorizontalAlignment.Center);
                lv.Columns.Add("Quantity", -2, HorizontalAlignment.Left);
                lv.Columns.Add("Price", -2, HorizontalAlignment.Center);
                lv.Columns.Add("Billed Quantity", -2, HorizontalAlignment.Left);
                foreach (workorderdetail wod in WODetList)
                {
                    ListViewItem item1 = new ListViewItem();
                    item1.Checked = false;
                    item1.SubItems.Add(wod.RowID.ToString());
                    item1.SubItems.Add(wod.StockItemID);
                    item1.SubItems.Add(wod.Description);
                    item1.SubItems.Add(wod.TaxCode);
                    item1.SubItems.Add(wod.WorkDescription);
                    item1.SubItems.Add(wod.WorkLocation);
                    item1.SubItems.Add(wod.Quantity.ToString());
                    item1.SubItems.Add(wod.Price.ToString());
                    item1.SubItems.Add(InvoiceInHeaderDB.getItemWiseTotalQuantOFWOIssuedInvoiceIn(wod.RowID).ToString());
                    lv.Items.Add(item1);
                }
            }
            catch (Exception)
            {
            }
            return(lv);
        }
Exemple #2
0
        public static ListView getWOHeaderListView()
        {
            ListView lv = new ListView();

            try
            {
                lv.View               = View.Details;
                lv.LabelEdit          = true;
                lv.AllowColumnReorder = true;
                lv.CheckBoxes         = true;
                lv.FullRowSelect      = true;
                lv.GridLines          = true;
                lv.Sorting            = System.Windows.Forms.SortOrder.Ascending;
                WorkOrderDB            wodb      = new WorkOrderDB();
                List <workorderheader> WOHeaders = wodb.getWorkOrderHeadersList();
                ////int index = 0;
                lv.Columns.Add("Select", -2, HorizontalAlignment.Left);
                lv.Columns.Add("WO No", -2, HorizontalAlignment.Left);
                lv.Columns.Add("WO Date", -2, HorizontalAlignment.Left);
                lv.Columns.Add("Customer Name", -2, HorizontalAlignment.Center);

                foreach (workorderheader woh in WOHeaders)
                {
                    ListViewItem item1 = new ListViewItem();
                    item1.Checked = false;
                    item1.SubItems.Add(woh.WONo.ToString());
                    item1.SubItems.Add(woh.WODate.ToShortDateString());
                    item1.SubItems.Add(woh.CustomerName);
                    lv.Items.Add(item1);
                }
            }
            catch (Exception)
            {
            }
            return(lv);
        }