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"); } }
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"); } }