Exemplo n.º 1
0
        public Gider Add(Gider entity)
        {
            try
            {
                SqlCommand komut = new SqlCommand("insert into Tbl_Gider(AY,YIL,ELEKTRIK,SU,DOGALGAZ,INTERNET,MAASLAR,EKSTRA,NOTLAR) values(@p1,@p2,@p3,@p4,@p5,@p6,@p7,@p8,@p9)", baglanti.BaglantiDondur());

                komut.Parameters.AddWithValue("@p1", entity.AY);
                komut.Parameters.AddWithValue("@p2", entity.YIL);
                komut.Parameters.AddWithValue("@p3", entity.ELEKTRIK);
                komut.Parameters.AddWithValue("@p4", entity.SU);
                komut.Parameters.AddWithValue("@p5", entity.DOGALGAZ);
                komut.Parameters.AddWithValue("@p6", entity.INTERNET);
                komut.Parameters.AddWithValue("@p7", entity.MAASLAR);
                komut.Parameters.AddWithValue("@p8", entity.EKSTRA);
                komut.Parameters.AddWithValue("@p9", entity.NOTLAR);

                komut.ExecuteNonQuery();
                baglanti.BaglantiDondur().Close();

                return(entity);
            }
            catch (Exception)
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        public Gider Update(Gider entity)
        {
            try
            {
                SqlCommand komut = new SqlCommand("update Tbl_Gider set AY=@p1,YIL=@p2,ELEKTRIK=@p3,SU=@p4,DOGALGAZ=@p5,INTERNET=@p6,MAASLAR=@p7,EKSTRA=@p8,NOTLAR=@p9 where ID=@p10", baglanti.BaglantiDondur());

                komut.Parameters.AddWithValue("@p1", entity.AY);
                komut.Parameters.AddWithValue("@p2", entity.YIL);
                komut.Parameters.AddWithValue("@p3", entity.ELEKTRIK);
                komut.Parameters.AddWithValue("@p4", entity.SU);
                komut.Parameters.AddWithValue("@p5", entity.DOGALGAZ);
                komut.Parameters.AddWithValue("@p6", entity.INTERNET);
                komut.Parameters.AddWithValue("@p7", entity.MAASLAR);
                komut.Parameters.AddWithValue("@p8", entity.EKSTRA);
                komut.Parameters.AddWithValue("@p9", entity.NOTLAR);
                komut.Parameters.AddWithValue("@p10", entity.ID);

                komut.ExecuteNonQuery();
                baglanti.BaglantiDondur().Close();

                return(entity);
            }
            catch (Exception)
            {
                return(null);
            }
        }
        public void InsertGider(Gider newGider)
        {
            SqlParameter p1 = new SqlParameter("MasrafTuru", newGider.MasrafTuru);
            SqlParameter p2 = new SqlParameter("tutar", newGider.Tutar);
            SqlParameter p3 = new SqlParameter("tarih", newGider.Tarih);

            Program.SqlHelper.ExecuteProc("InsertGider", p1, p2, p3);
        }
Exemplo n.º 4
0
        public static void GiderEkle(Gider yeniGider)
        {
            SqlParameter p1 = new SqlParameter("Tutar", yeniGider.Tutar);
            SqlParameter p2 = new SqlParameter("Tarih", yeniGider.Tarih);
            SqlParameter p3 = new SqlParameter("GiderTuru", yeniGider.GiderTurleri);

            Program.SqlHelper.ExecuteProc("sp_GiderEkle", p1, p2, p3);
        }
Exemplo n.º 5
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     Helper.Hata(() =>
     {
         Gider gider = CreateGiderFromForm();
         _giderService.Add(gider);
         Listele();
     });
 }
Exemplo n.º 6
0
        public void InsertGider(Gider yeniGider)
        {
            SqlParameter p1 = new SqlParameter("Tarih", yeniGider.Tarih);
            SqlParameter p2 = new SqlParameter("Tutar", yeniGider.Tutar);
            SqlParameter p3 = new SqlParameter("GiderTuru", SqlDbType.NVarChar, 50);

            p3.Value = yeniGider.GiderTuru;
            Program.SqlHelper.ExecutePro("InsertGider", p1, p2, p3);
        }
Exemplo n.º 7
0
        internal void Update(string kategori, string altKategori, DateTime tarih, decimal tutar, string aciklama, int ıd)
        {
            Gider gider = new Gider();

            gider.Aciklama       = aciklama;
            gider.AltKategoriAdi = altKategori;
            gider.Id             = ıd;
            gider.KategoriAdi    = kategori;
            gider.KayitTarihi    = tarih;
            gider.Tutar          = tutar;
            int ReturnValue = giderDal.Update(gider);
        }
Exemplo n.º 8
0
        internal void Delete(int id)
        {
            Gider _gider = new Gider();

            _gider.Id   = id;
            ReturnValue = giderDal.Delete(_gider);
            if (ReturnValue > 0)
            {
                Helper.Message.Information("Kayıt Silindi.");
            }
            else
            {
                Helper.Message.Error("Silme işleminiz başarısız.");
            }
        }
Exemplo n.º 9
0
        public List <Gider> FillList()
        {
            List <Gider> lstgd = new List <Gider>();
            DataTable    dt    = Program.sqlHelper.FillDataTable("select * from Giderler");

            foreach (DataRow dataRow in dt.Rows)
            {
                Gider gd = new Gider();
                gd.Total     = (decimal)dataRow["GiderlerTotal"];
                gd.DateTimes = Convert.ToDateTime(dataRow["GiderlerDate"]);
                gd.Giders    = dataRow["GiderlerEnum"].ToString();
                lstgd.Add(gd);
            }
            return(lstgd);
        }
Exemplo n.º 10
0
        public static List <Gider> GiderListesiniGetir()
        {
            List <Gider> list = new List <Gider>();
            DataTable    dt   = Program.SqlHelper.GetTable("SELECT * FROM tbl_Giderler");

            foreach (DataRow row in dt.Rows)
            {
                Gider b = new Gider();
                b.Tarih        = (DateTime)row["Tarih"];
                b.Tutar        = (decimal)row["Tutar"];
                b.GiderTurleri = (string)row["GiderTuru"];
                list.Add(b);
            }
            return(list);
        }
Exemplo n.º 11
0
        public List <Gider> GetGider()
        {
            List <Gider> list = new List <Gider>();
            DataTable    dt   = Program.SqlHelper.GetTable("select * from Gider");

            foreach (DataRow row in dt.Rows)
            {
                Gider g = new Gider();
                g.ID        = (int)row["GiderID"];
                g.Tarih     = (DateTime)row["Tarih"];
                g.Tutar     = (decimal)row["Tutar"];
                g.GiderTuru = (GiderTuru)Enum.Parse(typeof(GiderTuru), row["GiderTuru"].ToString());
                list.Add(g);
            }
            return(list);
        }
Exemplo n.º 12
0
        public List <Gider> GiderGetir()
        {
            List <Gider> list = new List <Gider>();
            DataTable    dt   = Program.SqlHelper.GetTable("SELECT* FROM Giderler");

            foreach (DataRow item in dt.Rows)
            {
                Gider gid = new Gider();
                gid.ID         = (int)item["ID"];
                gid.MasrafTuru = item["Masraf Türü"].ToString();
                gid.Tarih      = (DateTime)item["Tarih"];
                gid.Tutar      = (decimal)item["Tutar"];
                list.Add(gid);
            }
            return(list);
        }
Exemplo n.º 13
0
        public Gider Delete(Gider entity)
        {
            try
            {
                SqlCommand komut = new SqlCommand("delete from Tbl_Gider where ID=@p1", baglanti.BaglantiDondur());

                komut.Parameters.AddWithValue("@p1", entity.ID);
                komut.ExecuteNonQuery();
                baglanti.BaglantiDondur().Close();

                return(entity);
            }
            catch (Exception)
            {
                return(null);
            }
        }
Exemplo n.º 14
0
        internal void Add(string kategori, string altKategori, DateTime tarih, decimal tutar, string aciklama)
        {
            ReturnValue = 0;
            Gider _gider = new Gider();

            _gider.Aciklama       = aciklama;
            _gider.AltKategoriAdi = altKategori;
            _gider.KategoriAdi    = kategori;
            _gider.KayitTarihi    = tarih;
            _gider.Tutar          = tutar;
            ReturnValue           = giderDal.Add(_gider);
            if (ReturnValue > 0)
            {
                Helper.Message.Information("Kayıt Ekleme İşleminiz başarılı.");
            }
            else
            {
                Helper.Message.Error("Kayıt işleminiz başarısız.");
            }
        }
Exemplo n.º 15
0
        Gider CreateGiderFromForm()
        {
            Gider __gider = new Gider();

            __gider.GiderAdi      = textBoxGiderAdi.Text;
            __gider.Hesap_Kart_Id = ((Hesap_Kart)comboBoxHesap.SelectedItem).Id;
            try
            {
                __gider.Miktar = Convert.ToDecimal(textBoxMiktar.Text);
            }
            catch (Exception)
            {
                throw new Exception("Tutar kısmını kontrol ediniz.");
            }

            __gider.Tarih      = monthCalendar.SelectionStart;
            __gider.KategoriId = ((Kategori)comboBoxKategori.SelectedItem).Id;

            return(__gider);
        }
Exemplo n.º 16
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int id    = (int)dataGridView1.CurrentRow.Cells["Id"].Value;
            var _item = _giderService.GetAll().Where(I => I.Id == id).SingleOrDefault();

            _gider = _item;
            textBoxGiderAdi.Text = _item.GiderAdi;
            textBoxMiktar.Text   = _item.Miktar.ToString();
            monthCalendar.SetDate(_item.Tarih);
            var hesap = _hesapKartService.GetAll().Where(I => I.Id == _gider.Hesap_Kart_Id).SingleOrDefault();

            if (hesap != null)
            {
                comboBoxHesap.Text = hesap.Kart_Hesap_Adi;
            }
            var kategoriItem = _kategoriService.GetAll().Where(I => I.Id == _gider.KategoriId).SingleOrDefault();

            if (kategoriItem != null)
            {
                comboBoxKategori.Text = kategoriItem.KategoriAdi;
            }
        }
Exemplo n.º 17
0
        private void button1_Click(object sender, EventArgs e)
        {
            string works = "";

            foreach (Control item in this.groupBox1.Controls)
            {
                if (item is CheckBox)
                {
                    CheckBox chk = item as CheckBox;

                    if (chk.Checked == true)
                    {
                        works += item.Text.ToString() + ",";
                    }
                }
            }
            Gider gd = new Gider();

            gd.DateTimes = dateTimePicker1.Value;
            gd.Giders    = works.ToString();
            gd.Total     = Convert.ToDecimal(textBox1.Text);
            _uw.giderlerRepo.InsertGiderler(gd);
            MessageBox.Show("Veri başarıyla eklendi ...");
        }
 public void Update(Gider entity)
 {
     ValidationTool.Validate(validator, entity);
     dal.Update(entity);
 }
 public void Delete(Gider entity)
 {
     dal.Delete(entity);
 }
Exemplo n.º 20
0
 public Gider Delete(Gider gider)
 {
     _giderDal.Delete(gider);
     return(gider);
 }
Exemplo n.º 21
0
 public Gider Update(Gider gider)
 {
     return(_giderDal.Update(gider));
 }
Exemplo n.º 22
0
 public IResult Update(Gider gider)
 {
     _giderDal.Update(gider);
     return(new SuccessResult());
 }
Exemplo n.º 23
0
 public Gider Add(Gider gider)
 {
     return(_giderDal.Add(gider));
 }
Exemplo n.º 24
0
 public IResult Add(Gider gider)
 {
     _giderDal.Add(gider);
     return(new SuccessResult(Messages.GiderAdded));
 }
Exemplo n.º 25
0
 public IResult Delete(Gider gider)
 {
     _giderDal.Delete(gider);
     return(new SuccessResult(Messages.GiderDeleted));
 }
Exemplo n.º 26
0
 public Gider Add(Gider entity)
 {
     return(dal.Add(entity));
 }
Exemplo n.º 27
0
 public Gider Get(Gider entity)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 28
0
 public Gider Delete(Gider entity)
 {
     return(dal.Delete(entity));
 }
Exemplo n.º 29
0
 public Gider Get(Gider entity)
 {
     return(dal.Get(entity));
 }
Exemplo n.º 30
0
 public Gider Update(Gider entity)
 {
     return(dal.Update(entity));
 }