コード例 #1
0
        protected void btnAdministrator_Click(object sender, EventArgs e)
        {
            bool boolDuplicate = false;
            int  intUser       = 0;

            if (Int32.TryParse(Request.Form[hdnAdministrator.UniqueID], out intUser) && intUser > 0)
            {
                DataSet ds = oPlatform.GetUsers(intPlatform);
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    if (Int32.Parse(dr["userid"].ToString()) == intUser)
                    {
                        boolDuplicate = true;
                        break;
                    }
                }
                if (boolDuplicate == false)
                {
                    oPlatform.AddUser(intPlatform, intUser, 1);
                }
            }
            Response.Redirect(oPage.GetFullLink(intPage) + "?id=" + intPlatform.ToString() + "&U=true");
        }
コード例 #2
0
 protected void btnAdd_Click(Object Sender, EventArgs e)
 {
     oPlatform.AddUser(intID, Int32.Parse(Request.Form[hdnUser.UniqueID]), Int32.Parse(ddlLevel.SelectedItem.Value));
     Response.Redirect(Request.Path + "?id=" + intID.ToString() + "&save=true");
 }