Beispiel #1
0
        public static void Decoding(BackgroundWorker bw, DoWorkEventArgs e, object userData)
        {
            var data = new List<DataItem>();

            // zaciname od riadku 1 kvoli nadpisom
            for (int i = 1; i < toDecode.Length; i++)
            {
                if (bw.CancellationPending == true)
                {
                    e.Cancel = true;
                    break;
                }
                bw.ReportProgress((int)(((double)(i + 1) / toDecode.Length) * 100.0));

                try
                {
                    if (toDecode[i].Trim().Length == 0)
                        continue;

                    var l = toDecode[i];
                    if (!l.EndsWith("\t"))
                        l += "\t";
                    var line = l.Split('\t');

                    DataItem newItem = new DataItem();
                    newItem.Country = line[0];
                    newItem.Name = line[1];
                    newItem.Length = line[2];
                    newItem.Width = line[3];
                    newItem.Color = line[4];
                    newItem.Material = line[5];
                    newItem.Supplier = line[6];
                    newItem.Comment = line[7];
                    newItem.QmPrice = line[8];
                    newItem.SupplierNr = line[9];
                    newItem.Invoice = line[10];
                    newItem.EkNetto = line[11];
                    newItem.EuroStuck = line[12];
                    if (line.Length > 13)
                        newItem.Info = line[13];

                    data.Add(newItem);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(null, "Error while decoding in line " + i + Environment.NewLine + ex, "Error while decoding!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    decodedDS = new BindingList<DataItem>();
                    return;
                }
            }

            decodedDS = new BindingList<DataItem>(data);
        }
Beispiel #2
0
        public DataItem GetItem(string code)
        {
            var row = ExecuteQuery(TableNames[0], " where code = " + code, "").Tables[0].Rows[0];
            DataItem ret = new DataItem();

            ret.SupplierNr = row["supplier_nr"].ToString();
            ret.Code = row["code"].ToString();
            ret.Name = row["itemname"].ToString();
            ret.Country = row["country"].ToString();
            ret.Supplier = row["supplier"].ToString();
            ret.Length = row["length"].ToString();
            ret.Width = row["width"].ToString();
            ret.EkNetto = row["ek_netto"].ToString();
            ret.Quantity = row["quantity"].ToString();
            ret.VkNetto = row["vk_netto"].ToString();
            ret.Date = row["date"].ToString();
            ret.Paid = row["paid"].ToString();
            ret.MvDate = row["mvdate"].ToString();
            ret.Invoice = row["invoice"].ToString();
            ret.Color = row["color"].ToString();
            ret.Material = row["material"].ToString();
            ret.Comment = row["comment"].ToString();
            ret.Info = row["info"].ToString();
            ret.QmPrice = row["qm_price"].ToString();

            return ret;
        }
Beispiel #3
0
 public PrintDoc(DataItem item)
 {
     this.Item = item;
 }