private void stokHareketDokumuToolStripMenuItem_Click(object sender, EventArgs e) { frmStokHareketKriter frm = new frmStokHareketKriter(); frm.Name = "STOK HAREKET"; AddPropertiesForm(frm); ShowInTab(frm); //frm.Show(); }
void Sec() { try { Stok stok = managerStk.GetById(listView1.SelectedItems[0].SubItems[clStokKodu.DisplayIndex].Text, false); if (this.Owner is frmDirektSatis) { frmDirektSatis frmD = (frmDirektSatis)this.Owner; if (stok != null) { if (!string.IsNullOrEmpty(stok.Barkod1)) { frmD.txtBarkod.Text = stok.Barkod1; } else { frmD.txtBarkod.Text = stok.Id; } frmD.txtSatisFiyat.Text = stok.SatisFiyat1.GetValueOrDefault().ToString(); frmD.labSecilenUrun.Text = string.Format("{0} {1}", stok.Id, stok.StokAdi); frmD.txtSatisFiyat.Focus(); } this.Close(); } if (this.Owner is frmStok) { frmStok frmStk = (frmStok)this.Owner; if (stok != null) { frmStk.txtStokKodu.Text = stok.Id; frmStk.txtStokIsmi.Text = stok.StokAdi; frmStk.txtAlisKdvOrani.Text = stok.AlisKdvOrani.ToString(); frmStk.txtSatisKdvOrani.Text = stok.SatisKdvOrani.ToString(); frmStk.txtAnaBirim.Text = stok.AnaBirim; frmStk.txtAltBirim1.Text = stok.AltBirim1; frmStk.txtCarpan1.Text = stok.Carpan1.FromNullableToString(); frmStk.labAltBirim1.Text = frmStk.labAltBirim2.Text = frmStk.labAltBirim3.Text = stok.AnaBirim; frmStk.txtAltBirim2.Text = stok.AltBirim2; frmStk.txtCarpan2.Text = stok.Carpan2.FromNullableToString(); frmStk.txtAltBirim3.Text = stok.AltBirim3; frmStk.txtCarpan3.Text = stok.Carpan3.FromNullableToString(); frmStk.txtAsgariMiktar.Text = stok.AsgariMiktar.FromNullableToString(); frmStk.txtAzamiMiktar.Text = stok.AzamiMiktar.FromNullableToString(); frmStk.txtAlisFyt1.Text = stok.AlisFiyat1.FromNullableToString(); frmStk.txtAlisFyt2.Text = stok.AlisFiyat2.FromNullableToString(); frmStk.txtAlisFyt3.Text = stok.AlisFiyat3.FromNullableToString(); //frmStk.cmbAlisFytKur.Text = item.SubItems[7].Text; frmStk.txtSatisFyt1.Text = stok.SatisFiyat1.FromNullableToString(); frmStk.txtSatisFyt2.Text = stok.SatisFiyat2.FromNullableToString(); frmStk.txtSatisFyt3.Text = stok.SatisFiyat3.FromNullableToString(); //frmStk.cmbSatisFyt.Text = item.SubItems[9].Text; frmStk.txtStGrup1.Text = stok.Grup1.ProperyToStringOrEmpty(x => x.Id); frmStk.txtStGrup2.Text = stok.Grup2.ProperyToStringOrEmpty(x => x.Id); frmStk.txtStGrup3.Text = stok.Grup3.ProperyToStringOrEmpty(x => x.Id); frmStk.txtStGrup4.Text = stok.Grup4.ProperyToStringOrEmpty(x => x.Id); frmStk.txtStGrup5.Text = stok.Grup5.ProperyToStringOrEmpty(x => x.Id); frmStk.txtBarkod1.Text = stok.Barkod1; frmStk.txtBarkod2.Text = stok.Barkod2; frmStk.txtBarkod3.Text = stok.Barkod3; frmStk.chkSubelerdeOrtak.Checked = stok.SubelerdeOrtak.HasValue ? stok.SubelerdeOrtak.Value : false; } this.Close(); } else if (this.Owner is frmStokAlisSatisRaporKriter) { frmStokAlisSatisRaporKriter frmStk2 = (frmStokAlisSatisRaporKriter)this.Owner; ListViewItem item = listView1.SelectedItems[0]; frmStk2.txtStokKodu.Text = item.SubItems[clStokKodu.DisplayIndex].Text; this.Close(); } else if (this.Owner is frmFatura) { frmFatura frm = (frmFatura)this.Owner; ListViewItem item = listView1.SelectedItems[0]; if (stok != null) { frm.txtBarkod.Text = stok.Barkod1; //item.SubItems[13].Text; frm.txtStokKodu.Text = stok.Id; //item.SubItems[0].Text; frm.txtStokIsmi.Text = stok.StokAdi; //item.SubItems[1].Text; } if (FTIRSIP.AlisFat == _ftirsip || FTIRSIP.AlisIrs == _ftirsip) { frm.txtFyt.Text = stok.AlisFiyat1.FromNullableToString();//item.SubItems[6].Text; } else if (FTIRSIP.SatisFat == _ftirsip || FTIRSIP.SatisIrs == _ftirsip) { frm.txtFyt.Text = stok.SatisFiyat1.FromNullableToString();//item.SubItems[7].Text; } frm.txtStokKodu.Focus(); this.Close(); } else if (this.Owner is frmSiparis) { frmSiparis frm = (frmSiparis)this.Owner; ListViewItem item = listView1.SelectedItems[0]; if (stok != null) { frm.txtBarkod.Text = stok.Barkod1; //item.SubItems[13].Text; frm.txtStokKodu.Text = stok.Id; //item.SubItems[0].Text; frm.txtStokIsmi.Text = stok.StokAdi; //item.SubItems[1].Text; } if (FTIRSIP.SaticiSip == _ftirsip) { frm.txtFyt.Text = stok.AlisFiyat1.FromNullableToString();//item.SubItems[6].Text; } else if (FTIRSIP.MusSip == _ftirsip) { frm.txtFyt.Text = stok.SatisFiyat1.FromNullableToString();//item.SubItems[7].Text; } frm.txtStokKodu.Focus(); this.Close(); } else if (this.Owner is frmStokHareketKriter) { frmStokHareketKriter frmStk = (frmStokHareketKriter)this.Owner; ListViewItem item = listView1.SelectedItems[0]; frmStk.txtStokKodu.Text = item.SubItems[clStokKodu.DisplayIndex].Text; this.Close(); } else if (this.Owner is frmStokMaliyetRaporu) { frmStokMaliyetRaporu frmStk = (frmStokMaliyetRaporu)this.Owner; ListViewItem item = listView1.SelectedItems[0]; frmStk.txtStokKodu.Text = item.SubItems[clStokKodu.DisplayIndex].Text; this.Close(); } else if (this.Owner is frmStokAlisSatisRaporKriter) { frmStokAlisSatisRaporKriter frmStk = (frmStokAlisSatisRaporKriter)this.Owner; ListViewItem item = listView1.SelectedItems[0]; frmStk.txtStokKodu.Text = item.SubItems[clStokKodu.DisplayIndex].Text; this.Close(); } else if (this.Owner is frmStokDurumRaporu) { frmStokDurumRaporu frmStk = (frmStokDurumRaporu)this.Owner; ListViewItem item = listView1.SelectedItems[0]; frmStk.txtStokKodu.Text = item.SubItems[clStokKodu.DisplayIndex].Text; this.Close(); } } catch { } }