void LoadCari() { try { IList <Cari> liste = mngCari.GetBySUBE_KODU(UserInfo.Sube.Id); LoadAllCari(liste); } catch (Exception exc) { MessageBox.Show(exc.Message); LogWrite.Write(exc); } }
void LoadAllCari() { try { IList <Cari> liste = mngCari.GetBySUBE_KODU(UserInfo.Sube.Id); //listView1.Items.Clear(); dataGridViewCari.DataSource = null; dataGridViewCari.Rows.Clear(); foreach (Cari cari in liste) { //ListViewItem item = new ListViewItem(cari.Id); //item.SubItems.Add(cari.CariIsim); //item.SubItems.Add(cari.CariTel); //item.SubItems.Add(cari.CariAdres); //item.SubItems.Add(cari.CariEmail); //item.SubItems.Add(cari.VergiDairesi); //item.SubItems.Add(cari.VergiNumarasi); //item.SubItems.Add(cari.Fax); //item.SubItems.Add(cari.WebAdresi); //item.SubItems.Add(cari.Il); //item.SubItems.Add(cari.Ilce); //item.SubItems.Add(cari.Grup1.ProperyToStringOrEmpty(x => x.Id)); //item.SubItems.Add(cari.Grup2.ProperyToStringOrEmpty(x => x.Id)); //item.SubItems.Add(cari.CariTip); //listView1.Items.Add(item); List <string> listeRow = new List <string>(); listeRow.Add(cari.Id); listeRow.Add(cari.CariIsim); listeRow.Add(cari.CariTel); listeRow.Add(cari.Fax); listeRow.Add(cari.CepTel); listeRow.Add(cari.CariAdres); listeRow.Add(cari.Il); listeRow.Add(cari.Ilce); listeRow.Add(cari.VergiDairesi); listeRow.Add(cari.VergiNumarasi); listeRow.Add(cari.CariEmail); listeRow.Add(cari.WebAdresi); listeRow.Add(cari.YetkiliKisi); listeRow.Add(cari.AlisFiyatKod); listeRow.Add(cari.SatisFiyatKod); listeRow.Add(cari.Grup1.ProperyToStringOrEmpty(x => x.Id)); listeRow.Add(cari.Grup2.ProperyToStringOrEmpty(x => x.Id)); listeRow.Add(cari.Grup3.ProperyToStringOrEmpty(x => x.Id)); listeRow.Add(cari.Grup4.ProperyToStringOrEmpty(x => x.Id)); listeRow.Add(cari.CariTip); dataGridViewCari.Rows.Add(listeRow.ToArray()); } } catch (Exception exc) { LogWrite.Write(exc); MessageBox.Show(exc.Message); } }
void InitializeData() { mngFct = new ManagerFactory(Engine.GetConString(), Engine.GetSqlServerType()); mngCari = mngFct.GetCariManager(); mngCariCat = mngFct.GetCariCategoryManager(); // LoadAllCari(); IList <Cari> listef = mngCari.GetBySUBE_KODU(UserInfo.Sube.Id); filterDataGridView1.grd.DataSource = listef; ManagerIl mngIl = new ManagerIl(); //txtIl.DataSource = () => // { // try // { // System.Globalization.CultureInfo dil; // dil = new System.Globalization.CultureInfo("tr-TR"); // //txtIl.SelectionStart = txtIl.Text.Length; // string str = txtIl.Text.ToUpper(dil); // return mngIl.IlListe(str) ; // } // catch (Exception exc) // { // MessageBox.Show(exc.Message); // LogWrite.Write(exc); // } // return null; // }; //txtIlce.DataSource = () => //{ // try // { // if (string.IsNullOrEmpty(txtIl.Text)) // return null; // System.Globalization.CultureInfo dil; // dil = new System.Globalization.CultureInfo("tr-TR"); // //txtIl.SelectionStart = txtIl.Text.Length; // string str = txtIl.Text.ToUpper(dil); // int il = mngIl.SehirId(str); // string ilce = txtIlce.Text.ToUpper(dil); // return mngIl.IlceListe(ilce,il); // } // catch (Exception exc) // { // MessageBox.Show(exc.Message); // LogWrite.Write(exc); // } // return null; //}; txtCariKodu.DataSource = () => { try { return(mngCari.GetCariKodsBySubeKodu(UserInfo.Sube.Id, txtCariKodu.Text).ToStringList(15, txtCariKodu.Ayirac)); } catch (Exception exc) { MessageBox.Show(exc.Message); LogWrite.Write(exc); } return(null); }; txtCariGrup1.DataSource = () => { try { List <string> liste = mngCariCat.GetListRootCategoriesKodAndName(txtCariGrup1.Text).ToStringList(30, ""); return(liste); } catch (Exception exc) { LogWrite.Write(exc); MessageBox.Show(exc.Message); } return(null); }; txtCariGrup2.DataSource = () => { try { CariCategory parent = mngCariCat.GetById(txtCariGrup1.Text, false); if (parent == null) { return(null); } else { List <string> liste = mngCariCat.GetListParentSubCategoryKodAndName(parent.Id, txtCariGrup2.Text).ToStringList(30, ""); return(liste); } } catch (Exception exc) { LogWrite.Write(exc); MessageBox.Show(exc.Message); } return(null); }; txtCariGrup3.DataSource = () => { try { CariCategory parent = mngCariCat.GetById(txtCariGrup2.Text, false); if (parent == null) { return(null); } else { List <string> liste = mngCariCat.GetListParentSubCategoryKodAndName(parent.Id, txtCariGrup3.Text).ToStringList(30, ""); return(liste); } } catch (Exception exc) { LogWrite.Write(exc); MessageBox.Show(exc.Message); } return(null); }; txtCariGrup4.DataSource = () => { try { CariCategory parent = mngCariCat.GetById(txtCariGrup3.Text, false); if (parent == null) { return(null); } else { List <string> liste = mngCariCat.GetListParentSubCategoryKodAndName(parent.Id, txtCariGrup4.Text).ToStringList(30, ""); return(liste); } } catch (Exception exc) { LogWrite.Write(exc); MessageBox.Show(exc.Message); } return(null); }; }