Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SiparisDurum siparisDurum = db.SiparisDurum.Find(id);

            db.SiparisDurum.Remove(siparisDurum);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 private void SiparisKapat(SiparisDurum siparisDurum, decimal odenenTutar = 0)
 {
     siparis.OdenenTutar   = odenenTutar;
     siparis.KapanisZamani = DateTime.Now;
     siparis.Durum         = siparisDurum;
     db.AktifSiparisler.Remove(siparis);
     db.GecmisSiparisler.Add(siparis);
     DialogResult = DialogResult.OK;
     Close();
 }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "SiparisDurumID,SiparisDurumAdi")] SiparisDurum siparisDurum)
 {
     if (ModelState.IsValid)
     {
         db.Entry(siparisDurum).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(siparisDurum));
 }
Ejemplo n.º 4
0
        public ActionResult Create([Bind(Include = "SiparisDurumID,SiparisDurumAdi")] SiparisDurum siparisDurum)
        {
            if (ModelState.IsValid)
            {
                db.SiparisDurum.Add(siparisDurum);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(siparisDurum));
        }
Ejemplo n.º 5
0
 private void SiparisKapat(SiparisDurum durum)
 {
     if (durum == SiparisDurum.Odendi)
     {
         siparis.OdenenTutar = siparis.ToplamTutar();
     }
     siparis.KapanisZamani = DateTime.Now;
     siparis.Durum         = durum;
     db.AktifSiparisler.Remove(siparis);
     db.GecmisSiparisler.Add(siparis);
     DialogResult = DialogResult.OK; // bu formda işim bitti demek.
 }
Ejemplo n.º 6
0
        SiparisDurum SecilenSiparisDurumlari()
        {
            SiparisDurum durum = new SiparisDurum();

            durum.MusteriSiparis = cbMusteriSip.Checked;
            durum.SaticiSiparis  = cbSaticiSip.Checked;
            if (!cbSaticiSip.Checked & !cbMusteriSip.Checked)
            {
                durum.SaticiSiparis  = true;
                durum.MusteriSiparis = true;
            }
            return(durum);
        }
Ejemplo n.º 7
0
        public void MasayiKapat(int masaNo, SiparisDurum durum)
        {
            Siparis siparis = SiparisBul(masaNo);

            siparis.Durum         = durum;
            siparis.KapanisZamani = DateTime.Now;
            AktifSiparisler.Remove(siparis);
            GecmisSiparisler.Add(siparis);

            if (durum == SiparisDurum.Odendi)
            {
                siparis.OdenenTutar = siparis.ToplamTutar();
            }
        }
Ejemplo n.º 8
0
        // GET: SiparisDurum/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SiparisDurum siparisDurum = db.SiparisDurum.Find(id);

            if (siparisDurum == null)
            {
                return(HttpNotFound());
            }
            return(View(siparisDurum));
        }
        public DataTable SiparisRapor(string subeKodu, SiparisDurum siparisDurum, string cariKodu
                                      , DateTime?tarBas, DateTime?tarBit, DateTime?tesBas, DateTime?tesBit)
        {
            StringBuilder query = new StringBuilder(
                @" select su.FATIRSNO SiparisNo,su.FTIRSIP SiprasTip,
  su.CARI_KODU CariKodu,su.KdvTutar,su.BrutTutar,
  su.SatirIsk Iskanto,su.GenelToplam Tutar,su.TARIH Tarih,
  su.TESLIM_TARIH TeslimTarih 
  from SiparisUst su ");

            string and  = "and";
            string and2 = "and";
            string or   = "";
            //      public enum FTIRSIP : byte
            //{
            //  SatisFat = 1, AlisFat, SatisIrs, AlisIrs, MusSip, SaticiSip,DirektSatis
            //}
            //public enum FatTipi : byte
            //{
            //  KapaliFat = 1, AcikFat, MuhtelifFat, IadeFat,KrediKarti, ZayiIadeFat
            //}
            string beginParentez = "(";

            query.AppendFormat(" where su.SUBE_KODU='{0}' ", subeKodu);
            query.ConditionAppend(!string.IsNullOrEmpty(cariKodu), "{0} su.CARI_KODU='{1}' ".With(and, cariKodu),
                                  () => { and = "and"; });
            query.ConditionAppend(siparisDurum.MusteriSiparis, " {0} {1} su.FTIRSIP=5 ".With(and2, beginParentez),
                                  () => { or = "or"; beginParentez = ""; and2 = ""; });
            query.ConditionAppend(siparisDurum.SaticiSiparis, " {0} {1} {2} su.FTIRSIP=6 ".With(and2, beginParentez, or),
                                  () => { beginParentez = ""; });

            query.ConditionAppend((beginParentez == ""), " ) ");


            if (tarBas.HasValue && tarBit.HasValue)
            {
                query.Append(" {0} {1}=between '{2}' and '{3}' ".With(and, SqlTypeHelper.GetDate("f.TARIH"), tarBas.Value.JustDate().ToString("yyyy-MM-dd"), tarBit.Value.JustDate().ToString("yyyy-MM-dd")));
                and = "and";
            }
            if (tesBas.HasValue && tesBit.HasValue)
            {
                query.Append(" {0} {1}=between '{2}' and '{3}' ".With(and, SqlTypeHelper.GetDate("f.VadeTarih"), tesBas.Value.JustDate().ToString("yyyy-MM-dd"), tesBit.Value.JustDate().ToString("yyyy-MM-dd")));
                and = "and";
            }

            IDbConnection con = Session.Connection;
            IDbCommand    cmd = con.CreateCommand();

            cmd.CommandText = query.ToString();

            IDataReader dr = null;

            DataTable dt = new DataTable();

            dt.Columns.AddRange(
                new DataColumn[]
            {
                new DataColumn("SiparisNo"),
                new DataColumn("SiprasTip"),
                new DataColumn("CariKodu", typeof(string)),
                new DataColumn("KdvTutar", typeof(double)),
                new DataColumn("BrutTutar", typeof(double)),
                new DataColumn("Iskanto", typeof(double)),
                new DataColumn("Tutar", typeof(double)),
                new DataColumn("Tarih", typeof(DateTime)),
                new DataColumn("TeslimTarih")
            });
            try {
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    DataRow dar = dt.NewRow();
                    dar["SiparisNo"] = dr["SiparisNo"].ToStringOrEmpty();
                    dar["SiprasTip"] = dr["SiprasTip"].ToStringOrEmpty();

                    dar["CariKodu"]    = dr["CariKodu"].ToStringOrEmpty();
                    dar["KdvTutar"]    = dr["KdvTutar"].ToDouble();
                    dar["BrutTutar"]   = dr["BrutTutar"].ToDouble();
                    dar["Iskanto"]     = dr["Iskanto"].ToDouble();
                    dar["Tutar"]       = dr["Tutar"].ToDouble();
                    dar["Tarih"]       = dr["Tarih"].ToStringOrEmpty("");
                    dar["TeslimTarih"] = dr["TeslimTarih"].ToDate();

                    dt.Rows.Add(dar);
                }
            } catch (Exception exc) { throw exc; } finally {
                if (dr != null && !dr.IsClosed)
                {
                    dr.Close();
                }
            }

            return(dt);
        }
 public void Update(SiparisDurum entity)
 {
     _siparisdurumManagement.Update(entity);
 }
 public void Delete(SiparisDurum entity)
 {
     _siparisdurumManagement.Delete(entity);
 }
 public void Add(SiparisDurum entity)
 {
     _siparisdurumManagement.Add(entity);
 }
Ejemplo n.º 13
0
 public bool Update(SiparisDurum entity)
 {
     return(_siparisDurumDAL.Update(entity) > 0);
 }
Ejemplo n.º 14
0
        public bool Delete(int entityID)
        {
            SiparisDurum deleted = _siparisDurumDAL.Get(a => a.SiparisId == entityID);

            return(_siparisDurumDAL.Delete(deleted) > 0);
        }
Ejemplo n.º 15
0
 public bool Add(SiparisDurum entity)
 {
     return(_siparisDurumDAL.Add(entity) > 0);
 }