示例#1
0
        protected void btnUpdateClubMemberType_Click(object sender, EventArgs e)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "UpdateSuccessfully();", true);

            clsClubMemberType           ccm  = new clsClubMemberType();
            clsClubMemberTypeController ccmc = new clsClubMemberTypeController();

            ccm.ClubMemberTypeId    = Convert.ToInt16(currentId);
            ccm.SportID             = Convert.ToInt32(ddlSport.SelectedValue);
            ccm.ClubMemberTypeValue = txtClubMemberTypeValue.Text.Trim();
            ccm.ClubMemberTypeDesc  = txtClubMemberTypeDesc.Text.Trim();

            if (ChkIsActive.Checked == true)
            {
                ccm.ActiveFlagId = 1;
            }
            else
            {
                ccm.ActiveFlagId = 0;
            }

            if (ChkIsShow.Checked == true)
            {
                ccm.ShowFlagId = 1;
            }
            else
            {
                ccm.ShowFlagId = 0;
            }
            ccm.PortalID     = PortalId;
            ccm.ModifiedById = currentUser.Username;

            // Call Update Method
            ccmc.UpdateClubMemberType(ccm);

            btnAddClubMemberType.Visible    = true;
            pnlClubMemberTypeGrid.Visible   = true;
            btnSaveClubMemberType.Visible   = true;
            btnUpdateClubMemberType.Visible = false;
            LoadDocumentsGrid();
            ClearData();
            //Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmClubMember", "ClubID=" + ClubID));
        }
示例#2
0
        protected void ddlAction_SelectedIndexChanged(object sender, EventArgs e)
        {
            string str = ((Label)((DropDownList)sender).Parent.FindControl("lblddlActionClubMemberTypeId")).Text;

            string ddlSelectedValue = ((DropDownList)sender).SelectedValue;

            if (ddlSelectedValue == "Edit")
            {
                int editid = 0;
                int.TryParse(str, out editid);
                ViewState["currentId"] = Convert.ToInt16(str);

                clsClubMemberType           ccm  = new clsClubMemberType();
                clsClubMemberTypeController ccmc = new clsClubMemberTypeController();

                ClearData();
                FillSport();
                DataTable dt1 = new clsClubMemberTypeController().GetClubMemberTypeDetailByClubMemberTypeID(editid);

                if (dt1.Rows.Count > 0)
                {
                    txtClubMemberTypeValue.Text = dt1.Rows[0]["ClubMemberTypeValue"].ToString();
                    txtClubMemberTypeDesc.Text  = dt1.Rows[0]["ClubMemberTypeDesc"].ToString();

                    if (dt1.Rows[0]["ActiveFlagId"].ToString() == "1")
                    {
                        ChkIsActive.Checked = true;
                    }
                    else
                    {
                        ChkIsActive.Checked = false;
                    }

                    if (dt1.Rows[0]["ShowFlagId"].ToString() == "1")
                    {
                        ChkIsShow.Checked = true;
                    }
                    else
                    {
                        ChkIsShow.Checked = false;
                    }

                    ddlSport.SelectedValue = dt1.Rows[0]["SportID"].ToString();
                }



                btnUpdateClubMemberType.Visible = true;
                btnSaveClubMemberType.Visible   = false;
                pnlClubMemberTypeEntry.Visible  = true;
                pnlClubMemberTypeGrid.Visible   = false;
            }
            else if (ddlSelectedValue == "Delete")
            {
                //Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "DeleteSuccessfully();", true);
                //int documentid = 0;
                //int.TryParse(str, out documentid);
                //new CompetitionSponsorController().DeleteCompeSpon(documentid);
                //LoadDocumentsGrid(CompetitionID);
            }
        }