public Form1() { InitializeComponent(); using (var contex = new MGsTOKContex()) { contex.Database.CreateIfNotExists();//veritabanı varsa oluşturma yoksa oluştur. } }
private void Form1_Load(object sender, EventArgs e) { MGsTOKContex contex = new MGsTOKContex(); CariDal cd = new CariDal(); Cari entity = new Cari() { CariKodu = "123456", CariAdi = "Deneme", YetkiliKisi = "Erhan", FaturaUnvani = "deneem" }; cd.AddOrUpdate(contex, entity); cd.save(contex); }
public rptStokDurumu() { InitializeComponent(); MGsTOKContex conetext = new MGsTOKContex(); StokDal stokdal = new StokDal(); ObjectDataSource stokDatasource = new ObjectDataSource { DataSource = stokdal.GetAlljoin(conetext) }; this.DataSource = stokDatasource; // colStokGrubu.DataBindings.Add("Text", this.DataSource, "StokKodu"); colBarkod.DataBindings.Add("Text", this.DataSource, "Barkod"); colStokAdi.DataBindings.Add("Text", this.DataSource, "StokAdi"); colBirimi.DataBindings.Add("Text", this.DataSource, "StokBirimi"); colStokGrubu.DataBindings.Add("Text", this.DataSource, "StokGrubu"); colSatisKdv.DataBindings.Add("Text", this.DataSource, "SatisKdv"); colStokGiris.DataBindings.Add("Text", this.DataSource, "StokGiris"); colStokCikis.DataBindings.Add("Text", this.DataSource, "StokCikis"); }
public rptFatura(string fiskodu) { InitializeComponent(); MGsTOKContex conetext = new MGsTOKContex(); StokDal stokdal = new StokDal(); FisDal fisdal = new FisDal(); ObjectDataSource fisDatasource = new ObjectDataSource { DataSource = fisdal.GetAll(conetext, c => c.FisKodu == fiskodu) }; ObjectDataSource stokDatasource = new ObjectDataSource { DataSource = stokdal.GetAlljoin(conetext) }; this.DataSource = stokDatasource; lblCariAdi.DataBindings.Add("Text", fisDatasource, "CariAdi"); lblAdres.DataBindings.Add("Text", fisDatasource, "Adres"); colStokAdi.DataBindings.Add("Text", this.DataSource, "StokAdi"); colMiktar.DataBindings.Add("Text", this.DataSource, "Miktar"); colBirimFiyat.DataBindings.Add("Text", this.DataSource, "BirimFiyat"); }
private void listele() { context = new MGsTOKContex(); gridControl1.DataSource = fisdal.GetAll(context); }
private void listele() { MGsTOKContex context = new MGsTOKContex(); gridControl1.DataSource = indirimdal.GetAll(context); }