Пример #1
0
 protected void new_object_Click(object sender, EventArgs e)
 {
     try
     {
         Session["created_flag"] = true;
         System.Web.UI.WebControls.ObjectDataSource ods = current_ods();
         if (null == ods)
         {
             return;
         }
         System.Web.UI.WebControls.GridView gv = current_grid();
         if (null == gv)
         {
             return;
         }
         if (null == ods)
         {
             return;
         }
         ods.SelectMethod = "GetData";
         ods.SelectParameters.Clear();
         int i = ods.Insert();
         gv.EditIndex = gv.Rows.Count;
         this.DataBind();
     }
     catch (System.Exception ee)
     {
         errorText.Text    = ee.InnerException != null?ee.InnerException.Message:ee.Message;
         errorText.Visible = true;
     }
 }
Пример #2
0
        protected void new_object_Click(object sender, EventArgs e)
        {
            Session["created_flag"] = true;
            System.Web.UI.WebControls.ObjectDataSource ods = current_ods();
            System.Web.UI.WebControls.GridView         gv  = current_grid();
            ods.SelectMethod = "GetData";
            ods.SelectParameters.Clear();
            int i = ods.Insert();

            gv.EditIndex = gv.Rows.Count;
            this.DataBind();
        }