protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { RealTypeManager mgr = new RealTypeManager(); RealType obj = new RealType(); obj.RealType_ID = (GridView1.SelectedDataKey.Value).ToString(); obj = mgr.selectRealType(obj); AddEditTypeControl1.populateControls(obj); MultiView1.ActiveViewIndex = 1; }
protected void btnDelete_Click(object sender, EventArgs e) { try { RealTypeManager mgr = new RealTypeManager(); RealType obj = new RealType(); obj.RealType_ID = txtID.Text.Trim(); lblError.Text = CustomErrors.CHANGES_ACCEDTED_STATUS + mgr.deleteRealType(obj); ClearControls(); } catch (Exception ex) { lblError.Text = ex.Message; } }
protected void btnOpt_Click(object sender, EventArgs e) { try { RealType obj = CaptureData(); RealTypeManager mgr = new RealTypeManager(); if ((string)Session["Flag"] == "New") { lblError.Text = CustomErrors.CHANGES_ACCEDTED_STATUS + mgr.insertRealType(obj); ClearControls(); } else { lblError.Text = CustomErrors.CHANGES_ACCEDTED_STATUS + mgr.updateRealType(obj); } } catch (Exception ex) { lblError.Text = ex.Message; } }