예제 #1
0
        public override void Insert(IEntity entity)
        {
            Harita h = (Harita)entity;

            Connect();
            command = new SqlCommand("INSERT INTO tbl_Harita (Harita_Tasarim) VALUES (@html)", connection);
            command.Parameters.AddWithValue("@html", h.Harita1);
            try
            {
                command.ExecuteNonQuery();
            }
            catch (SqlException hata)
            {
                throw new Exception(hata.Message);
            }
            connection.Close();
            connection.Dispose();
        }
예제 #2
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();
        }