public static listCollection Item(string id)
 {
     listCollection list = new listCollection();
     try
     {
         DataRow[] result = dt.Select("id = " + id);
         foreach (DataRow l in result)
         {
             fieldCollections f = new fieldCollections();
             f.Lid = l["id"].ToString();
             f.Litem_id = l["item_id"].ToString();
             f.Linvoice_no = l["invoice_no"].ToString();
             f.Llotno = l["lot_no"].ToString();
             f.Lqty = l["qty"].ToString();
             f.Lremarks = l["remarks"].ToString();
             f.Lunit = l["unit"].ToString();
             list.Add(f);
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     return list;
 }
 public static listCollection Now()
 {
     listCollection list = new listCollection();
     try
     {
         DataRow[] result = config.get(api.GetDetails(config.Barcode, config.Type)).Select();
         foreach (DataRow l in result)
         {
             fieldCollections f = new fieldCollections();
             f.Mid = l["mid"].ToString();
             f.Code = l["code"].ToString();
             f.Type = l["type"].ToString();
             f.Classification = l["classification"].ToString();
             f.Description = l["description"].ToString();
             f.Model = l["model"].ToString();
             f.Pic = l["pic"].ToString();
             f.Unit = l["unit"].ToString();
             f.Defect_rate = l["defect_rate"].ToString();
             f.Sorting_percentage = l["sorting_percentage"].ToString();
             decimal MSqty = Convert.ToDecimal(l["msq"].ToString());
             f.Msq = config.format_currency(MSqty);
             f.Status = l["status"].ToString();
             f.Total_qty = Totl_Qty();
             list.Add(f);
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     return list;
 }
 public static listCollection Item(int id)
 {
     listCollection list = new listCollection();
     try
     {
         DataRow[] result = dt.Select("delivery_id = '" + id + "'");
         foreach (DataRow l in result)
         {
           fieldCollections f = new fieldCollections();
           delivery_id = Convert.ToInt32(l["delivery_id"].ToString());
           f.PO_No =  l["po_number"].ToString();
           f.Delivery_Date =  l["delivery_date"].ToString();
           f.Supplier_Name = l["supplier_name"].ToString();
           list.Add(f);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     return list;
 }