protected void UpdateLink_Click(object sender, EventArgs e)
    {
        ProjectGroup oProjectGroup = new ProjectGroup();

        if (0 == iProjectGroupID)
        {
            oProjectGroup.AddNew();
        }
        else
        {
            oProjectGroup.LoadByPrimaryKey(iProjectGroupID);
        }
        oProjectGroup.Name        = tbName.Text;
        oProjectGroup.Description = tbDescription.Text;
        oProjectGroup.Save();

        if (0 == iProjectGroupID)
        {
            DL_WEB.DAL.Client.ActivityLog.Instance.RegisterActivity(ActivityTypes.ProjectGroupCreated, "ProjectGroup " + oProjectGroup.Name + " created", ActivityObject.ProjectGroup, oProjectGroup.ProjectGroupID, this.UserGUID, Context.User.Identity.Name);
        }
        else
        {
            DL_WEB.DAL.Client.ActivityLog.Instance.RegisterActivity(ActivityTypes.ProjectGroupUpdated, "ProjectGroup " + oProjectGroup.Name + " updated", ActivityObject.ProjectGroup, oProjectGroup.ProjectGroupID, this.UserGUID, Context.User.Identity.Name);
        }

        Response.Redirect("~/ProjectGroups.aspx");
    }
 protected void ProjectGroupList_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName.ToLower().CompareTo("delete") == 0)
     {
         ProjectGroup oProjectGroup = new ProjectGroup();
         oProjectGroup.LoadByPrimaryKey(Micajah.Common.Helper.Convert.o2i(e.CommandArgument));
         m_Name = oProjectGroup.Name;
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (null != Request["id"])
        {
            iProjectGroupID = Convert.ToInt32(Request["id"]);
        }
        if (!IsPostBack && iProjectGroupID > 0)
        {
            ProjectGroup oProjectGroup = new ProjectGroup();
            oProjectGroup.LoadByPrimaryKey(iProjectGroupID);

            this.tbName.Text        = oProjectGroup.Name;
            this.tbDescription.Text = oProjectGroup.Description;
        }
        else
        {
            UpdateLink.Text = "Insert";
        }
    }