private void DeleteForm(int ID, string page) { if (page == "/Views/Punetoret/Index.aspx") { Punetori obj = new Punetori(); obj.PunetoriID = ID; PunetoriMapper objm = new PunetoriMapper(obj); objm.Delete(); } }
private void placeShenimet() { Index form = (Index)Context.Handler; int ID = form.SelectedID; ViewState["SelectedID"] = ID; PunetoriiDLL(); Punetori ex = new Punetori(); PunetoriMapper em = new PunetoriMapper(ex); em.SelectedID(ID); }
protected void SaveButton_Click(object sender, EventArgs e) { if (EmriTextBox.Text.Length == 0) { lblError.Visible = true; EmriTextBox.Focus(); return; } else if (MbiemriTextBox.Text.Length == 0) { lblError.Visible = true; MbiemriTextBox.Focus(); return; } else if (GjiniaTextBox.Text.Length == 0) { lblError.Visible = true; GjiniaTextBox.Focus(); return; } else { int ID = Convert.ToInt32(ViewState["SelectedID"].ToString()); Punetori obj = new Punetori(); PunetoriMapper objm = new PunetoriMapper(obj); objm.SelectedID(ID); obj.Emri = EmriTextBox.Text; obj.Mbiemri = MbiemriTextBox.Text; obj.Gjinia = GjiniaTextBox.Text; obj.RoliID = Int32.Parse(RoliDropDownList.SelectedItem.Value); objm.Update(); Response.Redirect("Index.aspx"); } }