Ejemplo n.º 1
0
        protected void btnAddShelf_Click(object sender, EventArgs e)
        {
            Raflar r = new Raflar();

            r.Ad = Request.Params["rafAd"] != null ? Request.Params["rafAd"].ToString() : String.Empty;
            r.AltKategoriId.Id = Convert.ToInt16(DropDownList_SubCategorySelect.SelectedItem.Value);
            if (RadioButton_Circle.Checked)
            {
                r.Sekil = "Circle";
            }
            if (RadioButton_Square.Checked)
            {
                r.Sekil = "Square";
            }
            if (RadioButton_Triangle.Checked)
            {
                r.Sekil = "Triangle";
            }
            RaflarDb db = new RaflarDb();

            try
            {
                db.Insert(r);
            }
            catch (Exception hata)
            {
                Response.Write("<script LANGUAGE='JavaScript' >alert('" + hata.Message.ToString() + "')</script>");
            }
            ShowShapes();
        }
Ejemplo n.º 2
0
        public override void Delete(IEntity entity)
        {
            Raflar r = (Raflar)entity;

            Connect();
            command = new SqlCommand("DELETE FROM tbl_Raflar WHERE Raf_ID=" + r.Id + "", connection);
            command.ExecuteNonQuery();
            connection.Dispose();
            connection.Close();
        }
Ejemplo n.º 3
0
 public Urun()
 {
     this.Id            = 0;
     this.Ad            = "";
     this.AltKategoriId = new AltKategori();
     this.Barkod        = "";
     this.Fiyat         = 0;
     this.Stok          = 0;
     this.Ozellikler    = "";
     this.PersonelId    = new Personel();
     this.RafId         = new Raflar();
 }
Ejemplo n.º 4
0
        public override void Insert(IEntity entity)
        {
            Raflar r = (Raflar)entity;

            Connect();
            command             = new SqlCommand("sp_RafEkle", connection);
            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.AddWithValue("@rafAdi", r.Ad);
            command.Parameters.AddWithValue("@rafSekli", r.Sekil);
            command.Parameters.AddWithValue("@altKategori", r.AltKategoriId.Id);
            try
            {
                command.ExecuteNonQuery();
            }
            catch (SqlException hata)
            {
                throw new Exception(hata.Message);
            }
            connection.Close();
            connection.Dispose();
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string operation = Request.Params["operation"] != null ? Request.Params["operation"].ToString() : String.Empty;

            if (operation.ToLower() == "save")
            {
                Harita h = new Harita();
                h.Harita1 = Request.Params["html"] != null ? Request.Params["html"].ToString() : String.Empty;
                HaritaDb db = new HaritaDb();
                try
                {
                    db.Insert(h);
                }
                catch (Exception hata)
                {
                    Response.Write("<script LANGUAGE='JavaScript' >alert('" + hata.Message.ToString() + "')</script>");
                }
            }

            rafDeleteID = Request.Params["Delete"] != null?Convert.ToInt16(Request.Params["Delete"]) : 0;

            if (rafDeleteID != 0)
            {
                Raflar r = new Raflar();
                r.Id = rafDeleteID;
                RaflarDb db = new RaflarDb();
                try
                {
                    db.Delete(r);
                }
                catch (Exception hata)
                {
                    Response.Write("<script LANGUAGE='JavaScript' >alert('" + hata.Message.ToString() + "')</script>");
                }
            }
            SubCategoryListShow();
            ShowShapes();
        }