private void cISS_Load(object sender, EventArgs e) { fillSifrarnik(); mm.GetMainCmpInfoByID(Properties.Settings.Default.CmpID); cmpM = mm.MainCmpToCompany(); partList = qc.ListPartsByRegionStateP(WorkingUser.RegionID, "sng"); List <Part> goodParts = new List <Part>(); goodParts = qc.ListPartsByRegionStateP(WorkingUser.RegionID, "g"); allParts = qc.GetPartsAllSifrarnik(); listView1.View = View.Details; listView1.Columns.Add("RB"); listView1.Columns.Add("ID"); listView1.Columns.Add("Date"); listView1.Columns.Add("UserID"); listView1.Columns.Add("CustomerID"); listView1.Columns.Add("PartID"); listView1.Columns.Add("Closed"); listView1.Columns.Add("TotalTime"); listView2.View = View.Details; listView2.Columns.Add("RB"); listView2.Columns.Add("Name"); listView2.Columns.Add("CodeO"); listView2.Columns.Add("SNO"); listView2.Columns.Add("CNO"); listView2.Columns.Add("CodeN"); listView2.Columns.Add("SNN"); listView2.Columns.Add("CNN"); listView2.Columns.Add("Date"); listView2.Columns.Add("Time"); listView2.Columns.Add("Work done"); listView2.Columns.Add("Comment"); customerID = qc.GetAllISScustomerID(1); if (customerID[0] != -1) { for (int i = 0; i < customerID.Count(); i++) { this.comboBox2.Items.Add(customerID[i]); } } dateCreated = qc.GetAllISSdateCreated(1); if (!dateCreated[0].Equals("nok")) { for (int i = 0; i < dateCreated.Count(); i++) { this.comboBox3.Items.Add(dateCreated[i]); } } Company temCmp = new Company(); cmpList = temCmp.GetAllCompanyInfoSortByName(); if (cmpList.Count != 0) { for (int i = 0; i < temCmp.Count; i++) { this.comboBox4.Items.Add(cmpList[i].Name); } } ISSids = qc.GetAllISSOpenClose(1); for (int i = 0; i < ISSids.Count; i++) { ISSSelectorCb.Items.Add(ISSids[i]); } for (int i = 0; i < 12; i++) { listView2.AutoResizeColumn(i, ColumnHeaderAutoResizeStyle.ColumnContent); listView2.AutoResizeColumn(i, ColumnHeaderAutoResizeStyle.HeaderSize); } Program.LoadStop(); this.Focus(); }
private void Ponuda_Load(object sender, EventArgs e) { offer.Naplaceno = 0; offer.Operater = WorkingUser.UserID.ToString(); offer.RacunID = 0; offer.Storno = 0; offer.Konverzija = 1; if (radioButtonENG.Checked) { offer.NacinPlacanja = Properties.Settings.Default.PaymentForm; vat = Properties.Settings.Default.TAX2 / 100; } else { offer.NacinPlacanja = Properties.Settings.Default.NacinPlacanja; vat = Properties.Settings.Default.TAX1 / 100; } offer.Id = ponudaID = offer.GetNewOfferNumber(); InvNbrLB.Text = offer.IDLongtoString(ponudaID); obrJedLB.Text = Properties.Settings.Default.ObracunskaJedinica.ToString(); QuantityTB.Text = "1"; backgroundWorker1.WorkerReportsProgress = true; backgroundWorker1.WorkerSupportsCancellation = true; mainCmp.GetMainCmpInfoByID(Properties.Settings.Default.CmpID); exchng = qc.CurrentExchangeRate(); ech = double.Parse(exchng[3]); offer.Eur = (decimal)ech; echDate = exchng[1]; ExchangeLB.Text = String.Format("{0,000:N3}", ech); offer.DanTecaja = EchDateLB.Text = echDate; offer.DatumIzdano = DateTime.Now.ToString("dd.MM.yy."); offer.DatumNaplaceno = "01.01.01."; DateTime dt = DateTime.Today.AddDays(valuta); ValutaLB.Text = valuta.ToString() + " (" + dt.ToString("dd.MM.yy.") + ")"; offer.Valuta = valuta; if (backgroundWorker1.IsBusy != true) { backgroundWorker1.RunWorkerAsync(); } listView1.View = View.Details; listView1.Columns.Add("RB"); listView1.Columns.Add("PART NAME"); listView1.Columns.Add("PART CODE"); listView1.Columns.Add("PRICE"); listView1.Columns.Add("WORK TIME"); listView1.Columns.Add("REBATE"); listView1.Columns.Add("AMOUNT"); listView1.Columns.Add("REBATE PRICE"); listView1.Columns.Add("TOTAL"); for (int i = 0; i < listView1.Columns.Count; i++) { listView1.AutoResizeColumn(i, ColumnHeaderAutoResizeStyle.ColumnContent); listView1.AutoResizeColumn(i, ColumnHeaderAutoResizeStyle.HeaderSize); } try { Company tempCmp = new Company(); cmpList = tempCmp.GetAllCompanyInfoSortByName(); if (cmpList.Count > 0) { foreach (Company cmp in cmpList) { CustomerCB.Items.Add(cmp.Name); } } PartSifrarnik tempSifPart = new PartSifrarnik(); sifrarnikList = tempSifPart.GetPartsAllSifrarnikSortByFullName(); if (sifrarnikList.Count > 0) { foreach (PartSifrarnik sif in sifrarnikList) { PartNameCB.Items.Add(sif.FullName); } } } catch (Exception e1) { new LogWriter(e1); Program.LoadStop(); this.Focus(); } Program.LoadStop(); this.Focus(); }