Exemplo n.º 1
0
 private void DeleteForm(int ID, string page)
 {
     if (page == "/Views/Grupet/Index.aspx")
     {
         Grupi obj = new Grupi();
         obj.GrupiID = ID;
         GrupiMapper objm = new GrupiMapper(obj);
         objm.Delete();
     }
 }
Exemplo n.º 2
0
        public void placeShenimet()
        {
            Index form = (Index)Context.Handler;
            int   ID   = form.SelectedID;

            ViewState["SelectedID"] = ID;

            Grupi       ex = new Grupi();
            GrupiMapper em = new GrupiMapper(ex);

            em.SelectedID(ID);

            GrupiTextBox.Text = ex.emriGrupit;
            KategoriaDropDownList.SelectedValue = ex.KategoriaID.ToString();
        }
Exemplo n.º 3
0
        protected void SaveButton_Click(object sender, EventArgs e)
        {
            if (GrupiTextBox.Text.Length == 0)
            {
                lblError.Visible = true;

                GrupiTextBox.Focus();
                return;
            }
            else
            {
                Grupi obj = new Grupi();
                obj.emriGrupit = GrupiTextBox.Text;
                obj.KategoriaID = Int32.Parse(KategoriaDropDownList.SelectedItem.Value);

                GrupiMapper objm = new GrupiMapper(obj);
                objm.Insert();
                Response.Redirect("Index.aspx");
            }
        }
Exemplo n.º 4
0
        protected void SaveButton_Click(object sender, EventArgs e)
        {
            if (GrupiTextBox.Text.Length == 0)
            {
                lblError.Visible = true;

                GrupiTextBox.Focus();
                return;
            }
            else
            {
                int         ID = Convert.ToInt32(ViewState["SelectedID"].ToString());
                Grupi       ex = new Grupi();
                GrupiMapper em = new GrupiMapper(ex);
                em.SelectedID(ID);
                ex.emriGrupit  = GrupiTextBox.Text;
                ex.KategoriaID = Int32.Parse(KategoriaDropDownList.DataValueField);

                em.Update();
                Response.Redirect("Index.aspx");
            }
        }