/* * public void SetActivityInformation() * { * if (EditMode) * { * var dr = new ProviderDAC().RetrieveActivityExplorer(ActivityID); * ddlCategorylvl2.Visible = true; * if (dr.CategoryLevel1ParentID != 0) * { * ddlCategorylvl1.SelectedValue = dr.CategoryLevel1ParentID.ToString(); * CheckCategorylvl1(); * ddlCategorylvl2.SelectedValue = dr.CategoryID.ToString(); * } * else * ddlCategorylvl1.SelectedValue = dr.CategoryID.ToString(); * * ddlFeesCategory.SelectedValue = dr.ActivityType.ToString(); * SetEligibilityView(); * txtEligibility.Text = dr.eligibilityDescription; * txtFee.Text = dr.Price; * if (dr.isMembershipRequired == null) * dr.isMembershipRequired = false; * radIsMemberReqYes.Checked = dr.isMembershipRequired; * radIsMemberReqNo.Checked = !dr.isMembershipRequired; * * if (dr.isMembershipRequired == null) * dr.isMembershipRequired = true; * radCommenceYes.Checked = dr.isCommenceAnytime; * radCommenceNo.Checked = !dr.isCommenceAnytime; * } * } */ private void setActivityDescription() { var dr = new ProviderDAC().RetrieveActivity(ActivityID); txtFullDesc.Text = dr.FullDescription; List <ListItem> SelectedCat = new List <ListItem>(); if (dr.CategoryID != 0) { var Cat = new ProviderDAC().RetrieveCategory(dr.CategoryID); ListItem cat1 = new ListItem(Cat.Name, Cat.ID.ToString()); SelectedCat.Add(cat1); } if (dr.SecondaryCategoryID1 != 0) { var Cat = new ProviderDAC().RetrieveCategory(dr.SecondaryCategoryID1); ListItem cat2 = new ListItem(Cat.Name, Cat.ID.ToString()); SelectedCat.Add(cat2); } if (dr.SecondaryCategoryID2 != 0) { var Cat = new ProviderDAC().RetrieveCategory(dr.SecondaryCategoryID2); ListItem cat3 = new ListItem(Cat.Name, Cat.ID.ToString()); SelectedCat.Add(cat3); } if (dr.SecondaryCategoryID3 != 0) { var Cat = new ProviderDAC().RetrieveCategory(dr.SecondaryCategoryID3); ListItem cat4 = new ListItem(Cat.Name, Cat.ID.ToString()); SelectedCat.Add(cat4); } if (dr.SecondaryCategoryID4 != 0) { var Cat = new ProviderDAC().RetrieveCategory(dr.SecondaryCategoryID4); ListItem cat5 = new ListItem(Cat.Name, Cat.ID.ToString()); SelectedCat.Add(cat5); } ActivityRegistrationCategory1.setSelectedCategory(SelectedCat); //set fees category ddlFeesCategory.SelectedValue = dr.ActivityType.ToString(); SetEligibilityView(); if (dr.ActivityType == (int)SystemConstants.ActivityFeeCategory.Private_Paid || dr.ActivityType == (int)SystemConstants.ActivityFeeCategory.Public_Paid) { txtFee.Text = dr.Price; } if (dr.ActivityType == (int)SystemConstants.ActivityFeeCategory.Private_Paid || dr.ActivityType == (int)SystemConstants.ActivityFeeCategory.Private_Free) { txtEligibility.Text = dr.eligibilityDescription; } radCommenceYes.Checked = dr.isCommenceAnytime; radCommenceNo.Checked = !dr.isCommenceAnytime; radIsMemberReqYes.Checked = dr.isMembershipRequired; radIsMemberReqNo.Checked = !dr.isMembershipRequired; }
/* * public void SetActivityInformation() * { * if (EditMode) * { * var dr = new AdministrationDAC().RetrieveActivityExplorer(ActivityID); * ddlCategorylvl2.Visible = true; * if (dr.CategoryLevel1ParentID != 0) * { * ddlCategorylvl1.SelectedValue = dr.CategoryLevel1ParentID.ToString(); * CheckCategorylvl1(); * ddlCategorylvl2.SelectedValue = dr.CategoryID.ToString(); * } * else * ddlCategorylvl1.SelectedValue = dr.CategoryID.ToString(); * * ddlFeesCategory.SelectedValue = dr.ActivityType.ToString(); * SetEligibilityView(); * txtEligibility.Text = dr.eligibilityDescription; * txtFee.Text = dr.Price; * if (dr.isMembershipRequired == null) * dr.isMembershipRequired = false; * radIsMemberReqYes.Checked = dr.isMembershipRequired; * radIsMemberReqNo.Checked = !dr.isMembershipRequired; * * if (dr.isMembershipRequired == null) * dr.isMembershipRequired = true; * radCommenceYes.Checked = dr.isCommenceAnytime; * radCommenceNo.Checked = !dr.isCommenceAnytime; * } * } */ private void setActivityDescription() { var dr = new AdministrationDAC().RetrieveActivity(ActivityID); txtFullDesc.Text = dr.FullDescription; List <ListItem> SelectedCat = new List <ListItem>(); if (dr.CategoryID != 0) { var Cat = new AdministrationDAC().RetrieveCategory(dr.CategoryID); ListItem cat1 = new ListItem(Cat.Name, Cat.ID.ToString()); SelectedCat.Add(cat1); } if (dr.SecondaryCategoryID1 != 0) { var Cat = new AdministrationDAC().RetrieveCategory(dr.SecondaryCategoryID1); ListItem cat2 = new ListItem(Cat.Name, Cat.ID.ToString()); SelectedCat.Add(cat2); } if (dr.SecondaryCategoryID2 != 0) { var Cat = new AdministrationDAC().RetrieveCategory(dr.SecondaryCategoryID2); ListItem cat3 = new ListItem(Cat.Name, Cat.ID.ToString()); SelectedCat.Add(cat3); } if (dr.SecondaryCategoryID3 != 0) { var Cat = new AdministrationDAC().RetrieveCategory(dr.SecondaryCategoryID3); ListItem cat4 = new ListItem(Cat.Name, Cat.ID.ToString()); SelectedCat.Add(cat4); } if (dr.SecondaryCategoryID4 != 0) { var Cat = new AdministrationDAC().RetrieveCategory(dr.SecondaryCategoryID4); ListItem cat5 = new ListItem(Cat.Name, Cat.ID.ToString()); SelectedCat.Add(cat5); } ActivityRegistrationCategory1.setSelectedCategory(SelectedCat); //set fees category ddlFeesCategory.SelectedValue = dr.ActivityType.ToString(); SetEligibilityView(); if (dr.ActivityType == (int)SystemConstants.ActivityFeeCategory.Private_Paid || dr.ActivityType == (int)SystemConstants.ActivityFeeCategory.Public_Paid) { txtFee.Text = dr.Price; } if (dr.ActivityType == (int)SystemConstants.ActivityFeeCategory.Private_Paid || dr.ActivityType == (int)SystemConstants.ActivityFeeCategory.Private_Free) { txtEligibility.Text = dr.eligibilityDescription; } }