Exemplo n.º 1
0
		protected void Page_Load(object sender, System.EventArgs e)
		{
			// Put user code to initialize the page here
			try
			{

				if(Page.IsPostBack==false)
				{
					Bip.Components.GroupEnt entity = new Bip.Components.GroupEnt();
					if (Request.Params["Id"] != null) 
					{
						int id = Int32.Parse(Request.Params["Id"]);
						entity.Load(id);
						ViewState["id"]=id;
						PanCreateNew.Visible = false;
					}
					else
					{
						PanEditExisting.Visible=false;
						entity.New();
					}

					txtName.Text = entity.Name;
					entity.Dispose();
					if(Request.UrlReferrer != null)
							ViewState["UrlReferrer"] = Request.UrlReferrer.ToString();
					else	ViewState["UrlReferrer"] = "~/Security/GroupList.aspx";
				}
			}
			catch(Exception ex)
			{
				ProcessException(ex);
			}
		}
 protected void btnDelete_Click(object sender, System.EventArgs e)
 {
     try
     {
         Bip.Components.GroupEnt entity = new Bip.Components.GroupEnt();
         entity.Load((int)ViewState["id"]);
         entity.Delete();
         entity.Dispose();
         Response.Redirect((String)ViewState["UrlReferrer"]);
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }
 protected void btnCreate_Click(object sender, System.EventArgs e)
 {
     try
     {
         Bip.Components.GroupEnt entity = new Bip.Components.GroupEnt();
         entity.New();
         entity.Name = txtName.Text;
         entity.Create();
         entity.Dispose();
         Response.Redirect((String)ViewState["UrlReferrer"], true);
     }
     catch (Exception ex)
     {
         ProcessException(ex);
         return;
     }
 }
Exemplo n.º 4
0
		protected void btnCreate_Click(object sender, System.EventArgs e)
		{
			try
			{

				Bip.Components.GroupEnt entity = new Bip.Components.GroupEnt();	
				entity.New();
				entity.Name = txtName.Text;
				entity.Create();
				entity.Dispose();
				Response.Redirect((String) ViewState["UrlReferrer"],true);
			}
			catch(Exception ex)
			{
				ProcessException(ex);
				return;
			}



		}
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            try
            {
                if (Page.IsPostBack == false)
                {
                    Bip.Components.GroupEnt entity = new Bip.Components.GroupEnt();
                    if (Request.Params["Id"] != null)
                    {
                        int id = Int32.Parse(Request.Params["Id"]);
                        entity.Load(id);
                        ViewState["id"]      = id;
                        PanCreateNew.Visible = false;
                    }
                    else
                    {
                        PanEditExisting.Visible = false;
                        entity.New();
                    }

                    txtName.Text = entity.Name;
                    entity.Dispose();
                    if (Request.UrlReferrer != null)
                    {
                        ViewState["UrlReferrer"] = Request.UrlReferrer.ToString();
                    }
                    else
                    {
                        ViewState["UrlReferrer"] = "~/Security/GroupList.aspx";
                    }
                }
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }
Exemplo n.º 6
0
		protected void btnDelete_Click(object sender, System.EventArgs e)
		{
			try
			{
				Bip.Components.GroupEnt entity = new Bip.Components.GroupEnt();	
				entity.Load( (int)ViewState["id"] );
				entity.Delete();
				entity.Dispose();
				Response.Redirect((String) ViewState["UrlReferrer"]);
			}
			catch(Exception ex)
			{
				ProcessException(ex);
			}
		}