void KisiGridGetir()
        {
            SiteDBEntities2 db   = new SiteDBEntities2();
            var             list = db.S_Kisiler(-1).Where(c => c.IsDeleted == false).ToList();

            gridControl1.DataSource = list;
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            RibbonMenuGridAyarlari uc_gridAyarlari = new RibbonMenuGridAyarlari(ribbonPage.Text);

            if (navigationFrame.SelectedPageIndex == 0)
            {
                uc_gridAyarlari.GrdView = gridView1;
            }

            ribbonControl.MergeRibbon(uc_gridAyarlari.ribbonControl1);

            SiteDBEntities2 db      = new SiteDBEntities2();
            var             bloklar = db.S_Bloklar().ToList();

            repositoryItemLookUpEdit1.DataSource = bloklar;
            var daireler = db.S_Daireler().ToList();

            repositoryItemLookUpEdit2.DataSource = daireler;
            var odemeTipi = db.S_OdemeTipi().ToList();

            repositoryItemLookUpEdit3.DataSource = odemeTipi;

            KisiGridGetir();
            CariGridGetir();
        }
        private void btnBorclandir_ItemClick(object sender, ItemClickEventArgs e)
        {
            SiteDBEntities2 db = new SiteDBEntities2();

            gridControl1.DataSource = null;
            dsAktivite_OdemePlaniSenet.Tables.Clear();
            dsAktivite_OdemePlaniSenet.Tables.Add(DataControls.ListToDt(db.S_Odemeler(-1).ToList()));
            if (dsAktivite_OdemePlaniSenet.Tables[0].Rows.Count != 0)
            {
                dsAktivite_OdemePlaniSenet.Tables[0].Rows.Clear();
            }
            int vadeSayisi = Convert.ToInt32(textEdit1.EditValue);

            if (vadeSayisi > 0)
            {
                for (int i = 0; i < vadeSayisi; i++)
                {
                    TaksitEkle(VadeGridMaxTarihBul(), (decimal)(txtTutar.EditValue));
                }
            }
            else
            {
                TaksitEkle(dateEdit1.DateTime.Date, (decimal)(txtTutar.EditValue));
            }

            gridControl1.DataSource = dsAktivite_OdemePlaniSenet.Tables[0];
        }
Beispiel #4
0
 private void btnKaydetYeni_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         SiteDBEntities2 db = new SiteDBEntities2();
         db.UDI_Kisi(1, kisiid,
                     txtAdSoyad.EditValue.ToString(),
                     (int)cmbBlokAdi.EditValue,
                     (int)cmbDaireNo.EditValue,
                     rbKiraci.Checked,
                     DateTime.Now.Date,
                     (DateTime)dtGirisTarihi.EditValue,
                     ((dtCikisTarihi.EditValue == null) ? (DateTime)System.Data.SqlTypes.SqlDateTime.Null : (DateTime)dtCikisTarihi.EditValue),
                     rbOturuyor.Checked,
                     ((txtNotlar.EditValue == null) ? "" : txtNotlar.EditValue.ToString()));
         Mesaj.MesajVer("Kayıt eklenmiştir.", Mesaj.MesajTipi.Onay, this);
         txtAdSoyad.EditValue = "";
         cmbBlokAdi.ResetText();
         cmbDaireNo.ResetText();
         rbKiraci.Checked   = false;
         rbEvSahibi.Checked = false;
         dtGirisTarihi.ResetText();
         dtCikisTarihi.ResetText();
         rbOturuyor.Checked  = false;
         rbAyrildi.Checked   = false;
         txtNotlar.EditValue = "";
         txtAdSoyad.Focus();
     }
     catch (Exception hata)
     {
         throw;
     }
 }
        private void gridView1_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
        {
            try
            {
                SiteDBEntities2 db = new SiteDBEntities2();

                if (!(gridView1.PostEditor() && gridView1.UpdateCurrentRow()))
                {
                    return;
                }

                GridView view = sender as GridView;
                Object   obj  = view.GetRow(view.FocusedRowHandle);

                if (obj == null)
                {
                    return;
                }

                int kayitid = (gridView1.GetFocusedRowCellValue("ID") == DBNull.Value) ? -1 : (int)gridView1.GetFocusedRowCellValue("ID");
                db.UDI_OdemeTipiTanimlari(1, kayitid, gridView1.GetFocusedRowCellValue("OdemeAdi").ToString());

                var list = db.S_OdemeTipi().Where(c => c.IsDeleted == false).ToList();
                dt = DataControls.ListToDt(list);
                gridControl1.DataSource = dt;
            }
            catch (Exception hata)
            {
                throw;
            }
        }
        private void OdemeTipiTanimlari_Load(object sender, EventArgs e)
        {
            SiteDBEntities2 db   = new SiteDBEntities2();
            var             list = db.S_OdemeTipi().Where(c => c.IsDeleted == false).ToList();

            dt = DataControls.ListToDt(list);
            gridControl1.DataSource = dt;
        }
        void CariGridGetir()
        {
            SiteDBEntities2 db   = new SiteDBEntities2();
            var             cari = db.S_CariIslemler().ToList();

            pivotGridControl1.DataSource = cari;
            //pivotGridControl1.ActiveFilter.
        }
        private void Borclandir_Load(object sender, EventArgs e)
        {
            lblAdiSoyadi.Text = ad;
            SiteDBEntities2 db        = new SiteDBEntities2();
            var             odemeTipi = db.S_OdemeTipi().Where(c => c.IsDeleted == false).ToList();

            lookUpEdit1.Properties.DataSource = odemeTipi;
        }
        private void btnKaydetVeKapat_ItemClick(object sender, ItemClickEventArgs e)
        {
            try
            {
                SiteDBEntities2 db         = new SiteDBEntities2();
                int             vadeSayisi = Convert.ToInt32(textEdit1.EditValue);
                if (vadeSayisi > 0)
                {
                    DateTime OncekiTarih = new DateTime();
                    for (int i = 0; i < vadeSayisi; i++)
                    {
                        DateTime dtmMaxTarih = new DateTime();
                        dtmMaxTarih = dateEdit1.DateTime.Date;
                        if (i == 0)
                        {
                            db.UDI_Borclandir(kisiid, (int)lookUpEdit1.EditValue, (decimal)txtTutar.EditValue, dtmMaxTarih,
                                              1, null, -1, null);
                            OncekiTarih = dtmMaxTarih;
                        }
                        else
                        {
                            int iYear  = OncekiTarih.AddMonths(1).Year;  //ParseDateTime(OncekiTarih.Month).AddMonths(1).Year;
                            int iMonth = OncekiTarih.AddMonths(1).Month; //ParseDateTime(OncekiTarih.Month +1).Month;
                            int iDay   = dateEdit1.DateTime.Day;

                            DateTime dtmTemp = DateTime.Now;
                            try
                            {
                                dtmTemp = new DateTime(iYear, iMonth, iDay);
                            }
                            catch (Exception exc)
                            {
                                int lastDayOfMonth = DateTime.DaysInMonth(iYear, iMonth);
                                dtmTemp = new DateTime(iYear, iMonth, lastDayOfMonth);
                            }

                            db.UDI_Borclandir(kisiid, (int)lookUpEdit1.EditValue, (decimal)txtTutar.EditValue,
                                              dtmTemp, 1, null, -1, null);

                            OncekiTarih = dtmTemp;
                        }
                    }
                }
                else
                {
                    db.UDI_Borclandir(kisiid, (int)lookUpEdit1.EditValue, (decimal)txtTutar.EditValue, dateEdit1.DateTime.Date,
                                      1, null, -1, null);
                }

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception hata)
            {
                throw;
            }
        }
Beispiel #10
0
        private void navBarOdemeEkle_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            int       rowhandle = gridView1.FocusedRowHandle;
            OdemeEkle frm       = new OdemeEkle(kisiid, lblAdSoyad.Text, -1);

            frm.ShowDialog();
            if (frm.DialogResult == DialogResult.OK)
            {
                SiteDBEntities2 db    = new SiteDBEntities2();
                var             odeme = db.S_Odemeler(kisiid).OrderByDescending(c => c.VadeTarihi).ThenByDescending(m => m.ID).Where(c => c.IsDeleted == false).ToList();
                gridControl2.DataSource = odeme;
            }
            gridView1.FocusedRowHandle = rowhandle;
        }
Beispiel #11
0
 private void btnKaydet_ItemClick(object sender, ItemClickEventArgs e)
 {
     try
     {
         SiteDBEntities2 db = new SiteDBEntities2();
         db.UDI_OdemeEkle(1, _id, -1, (DateTime)dtTarih.EditValue, (int)lookUpEdit1.EditValue,
                          (decimal)textEdit1.EditValue, memoEdit1.EditValue.ToString());
         Mesaj.MesajVer("Kayıt eklenmiştir.", Mesaj.MesajTipi.Onay, this);
     }
     catch (Exception hata)
     {
         throw;
     }
 }
Beispiel #12
0
 private void BlokTanimlari_Load(object sender, EventArgs e)
 {
     try
     {
         SiteDBEntities2 db = new SiteDBEntities2();
         //gridControl1.DataSource = db.S_Bloklar().ToList();
         var list = db.S_Bloklar().Where(c => c.IsDeleted == false).ToList();
         dt = DataControls.ListToDt(list);
         gridControl1.DataSource = dt;
     }
     catch (Exception hata)
     {
         throw;
     }
 }
Beispiel #13
0
 private void btnSil_ItemClick(object sender, ItemClickEventArgs e)
 {
     try
     {
         SiteDBEntities2 db = new SiteDBEntities2();
         db.UDI_OdemeEkle(2, _id, _kayitid, (DateTime)dtTarih.EditValue, (int)lookUpEdit1.EditValue,
                          (decimal)textEdit1.EditValue, memoEdit1.EditValue.ToString());
         Mesaj.MesajVer("Kayıt silinmiştir.", Mesaj.MesajTipi.Onay, this);
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
     catch (Exception hata)
     {
         throw;
     }
 }
Beispiel #14
0
        private void gridView1_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
        {
            try
            {
                SiteDBEntities2 db = new SiteDBEntities2();


                if (!(gridView1.PostEditor() && gridView1.UpdateCurrentRow()))
                {
                    return;
                }

                GridView view = sender as GridView;
                Object   obj  = view.GetRow(view.FocusedRowHandle);

                if (obj == null)
                {
                    return;
                }

                //int product_id_grid = Convert.ToInt32(view.GetDataRow(view.FocusedRowHandle)["ID"].ToString());

                int kayitid = (gridView1.GetFocusedRowCellValue("ID") == DBNull.Value) ? -1 : (int)gridView1.GetFocusedRowCellValue("ID");
                db.UDI_BlokTanimlari(1, kayitid, gridView1.GetFocusedRowCellValue("BlokAdi").ToString());

                //if (view.IsNewItemRow(e.RowHandle))
                //{
                //    //INSERT TSQL
                //    db.UDI_BlokTanimlari(1, kayitid,
                //        gridView1.GetFocusedRowCellValue("BlokAdi").ToString());
                //}
                //else
                //{
                //    //UPDATE TSQL
                //    db.UDI_BlokTanimlari(1, kayitid,
                //        gridView1.GetFocusedRowCellValue("BlokAdi").ToString());
                //}

                var list = db.S_Bloklar().Where(c => c.IsDeleted == false).ToList();
                dt = DataControls.ListToDt(list);
                gridControl1.DataSource = dt;
            }
            catch (Exception hata)
            {
                throw;
            }
        }
Beispiel #15
0
        private void YeniKisiEkle_Load(object sender, EventArgs e)
        {
            SiteDBEntities2 db      = new SiteDBEntities2();
            var             bloklar = db.S_Bloklar().Where(c => c.IsDeleted == false).ToList();

            cmbBlokAdi.Properties.DataSource = bloklar;
            var daireler = db.S_Daireler().Where(c => c.IsDeleted == false).ToList();

            cmbDaireNo.Properties.DataSource = daireler;
            if (kisiid > 0)
            {
                var list = db.S_Kisiler(kisiid).Where(c => c.IsDeleted == false).ToList();
                listkisiler             = list;
                txtAdSoyad.EditValue    = list.FirstOrDefault().AdiSoyadi;
                cmbBlokAdi.EditValue    = list.FirstOrDefault().BlokAdiID;
                cmbDaireNo.EditValue    = list.FirstOrDefault().DaireAdiID;
                dtGirisTarihi.EditValue = list.FirstOrDefault().DaireGirisTarihi;
                dtCikisTarihi.EditValue = list.FirstOrDefault().DaireCikisTarihi;
                bool kiraciEvSahibi = (bool)list.FirstOrDefault().KiraciEvsahibi;
                if (kiraciEvSahibi)
                {
                    rbKiraci.Checked   = true;
                    rbEvSahibi.Checked = false;
                }
                else
                {
                    rbKiraci.Checked   = false;
                    rbEvSahibi.Checked = true;
                }
                bool oturuyorAyrildi = (bool)list.FirstOrDefault().OturuyorAyrildi;
                if (oturuyorAyrildi)
                {
                    rbOturuyor.Checked = true;
                    rbAyrildi.Checked  = false;
                }
                else
                {
                    rbOturuyor.Checked = false;
                    rbAyrildi.Checked  = true;
                }
                txtNotlar.EditValue = list.FirstOrDefault().Notlar;
            }
        }
Beispiel #16
0
        private void gridView2_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
        {
            try
            {
                SiteDBEntities2 db = new SiteDBEntities2();

                db.UDI_Borclandir(-1, -1, 0, (DateTime)System.Data.SqlTypes.SqlDateTime.Null, 2,
                                  (gridView2.GetFocusedRowCellValue("OdemeTarihi") == null) ? (DateTime)System.Data.SqlTypes.SqlDateTime.Null : (DateTime)gridView2.GetFocusedRowCellValue("OdemeTarihi"),
                                  (int)gridView2.GetFocusedRowCellValue("ID"),
                                  (gridView2.GetFocusedRowCellValue("Aciklama") == null) ? "" : gridView2.GetFocusedRowCellValue("Aciklama").ToString());

                Mesaj.MesajVer("Kayıt güncellenmiştir.", Mesaj.MesajTipi.Onay, this);
                CariGridGetir();
            }
            catch (Exception hata)
            {
                throw;
            }
        }
Beispiel #17
0
        private void navBarKisilerListesi_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            SiteDBEntities2 db   = new SiteDBEntities2();
            XtraReport1     rpt  = new XtraReport1();
            var             list = db.S_KisilerListesi().ToList();

            rpt.DataSource = list;
            using (ReportPrintTool printTool = new ReportPrintTool(rpt))
            {
                // Invoke the Print Preview form modally,
                // and load the report document into it.
                printTool.ShowPreviewDialog();
                Cursor.Current = Cursors.Default;
                // Invoke the Print Preview form
                // with the specified look and feel setting.
                //printTool.ShowPreviewDialog(UserLookAndFeel.Default);
            }
        }
Beispiel #18
0
 private void btnSil_ItemClick(object sender, ItemClickEventArgs e)
 {
     try
     {
         if (XtraMessageBox.Show("Kayıdı silmek istediğinizden eminmisiniz?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
         {
             SiteDBEntities2 db      = new SiteDBEntities2();
             int             kayitid = (gridView1.GetFocusedRowCellValue("ID") == DBNull.Value) ? -1 : (int)gridView1.GetFocusedRowCellValue("ID");
             db.UDI_BlokTanimlari(2, kayitid, "");
             var list = db.S_Bloklar().Where(c => c.IsDeleted == false).ToList();
             dt = DataControls.ListToDt(list);
             gridControl1.DataSource = dt;
         }
     }
     catch (Exception hata)
     {
         throw;
     }
 }
Beispiel #19
0
        private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            int    i  = e.FocusedRowHandle;
            string id = gridView1.GetRowCellValue(i, "ID").ToString();

            if (id != "" || id != null)
            {
                lblAdSoyad.Text = gridView1.GetRowCellValue(i, "AdiSoyadi").ToString();

                lblBlok.Text = string.Format("{0} Blok, Daire {1}", repositoryItemLookUpEdit1.GetDisplayText(gridView1.GetRowCellValue(i, "BlokAdiID")).Trim(),
                                             repositoryItemLookUpEdit2.GetDisplayText(gridView1.GetFocusedRowCellValue("DaireAdiID")).Trim());

                string Kiraci, Oturuyor = "";
                bool   kiraciEvSahibi = Convert.ToBoolean(gridView1.GetRowCellValue(i, "KiraciEvsahibi"));
                if (kiraciEvSahibi)
                {
                    Kiraci = "Kiracı";
                }
                else
                {
                    Kiraci = "Ev Sahibi";
                }

                bool oturuyorAyrildi = Convert.ToBoolean(gridView1.GetRowCellValue(i, "OturuyorAyrildi"));
                if (oturuyorAyrildi)
                {
                    Oturuyor = "Oturuyor";
                }
                else
                {
                    Oturuyor = "Ayrıldı";
                }

                lblKiraci.Text = string.Format("{0}, {1}", Kiraci, Oturuyor);

                SiteDBEntities2 db    = new SiteDBEntities2();
                var             odeme = db.S_Odemeler(Convert.ToInt32(id)).Where(c => c.IsDeleted == false).OrderByDescending(c => c.VadeTarihi).ToList();
                gridControl2.DataSource = odeme;
                kisiid = Convert.ToInt32(id);
            }
        }
Beispiel #20
0
 private void btnSil_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         if (kisiid > 0)
         {
             if (XtraMessageBox.Show("Kayıdı silmek istediğinizden eminmisiniz?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
             {
                 SiteDBEntities2 db = new SiteDBEntities2();
                 db.UDI_Kisi(2, kisiid, "", -1, -1, false, null, null, null, false, "");
                 Mesaj.MesajVer("Kayıt silinmiştir.", Mesaj.MesajTipi.Onay, this);
                 this.DialogResult = DialogResult.OK;
                 this.Close();
             }
         }
     }
     catch (Exception hata)
     {
         throw;
     }
 }
Beispiel #21
0
 private void btnKaydetKapat_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         SiteDBEntities2 db = new SiteDBEntities2();
         db.UDI_Kisi(1, kisiid,
                     txtAdSoyad.EditValue.ToString(),
                     (int)cmbBlokAdi.EditValue,
                     (int)cmbDaireNo.EditValue,
                     rbKiraci.Checked,
                     DateTime.Now.Date,
                     (DateTime)dtGirisTarihi.EditValue,
                     ((dtCikisTarihi.EditValue == null) ? (DateTime)System.Data.SqlTypes.SqlDateTime.Null : (DateTime)dtCikisTarihi.EditValue),
                     rbOturuyor.Checked,
                     ((txtNotlar.EditValue == null) ? "" : txtNotlar.EditValue.ToString()));
         this.DialogResult = DialogResult.OK;
         Mesaj.MesajVer("Kayıt eklenmiştir.", Mesaj.MesajTipi.Onay, this);
         this.Close();
     }
     catch (Exception hata)
     {
         throw;
     }
 }