Ejemplo n.º 1
0
		private void btnSubmit_Click(object sender, EventArgs e)
		{
			BPHub BPHub = new BPHub();
			DSHub = BPHub.SelectAll();
			BEHub.tbl_HubRow Hub;
			bool blnNew = true;

			if (DSHub.tbl_Hub.Rows.Count > 0)
			{
				// Edit a Home
				Hub = DSHub.tbl_Hub[0];	
				blnNew = false;
			}
			else
			{
				// Add a Home
				Hub = DSHub.tbl_Hub.Newtbl_HubRow();
			}

			Hub.HubPageHeading = txtHubPageHeading.Text;

			Hub.HubContentHeading1 = txtHubContentHeading1.Text;
			Hub.HubContent1 = Request.Form[edtHubContent1.Editor_HiddenField].ToString();
			ImageWizard ddlHubContentImage1 = Page.FindControl("ddlHubContentImage1") as ImageWizard;
			if (ddlHubContentImage1.SelectedImage > 0)
			{
				Hub.HubContentImage1 = Convert.ToInt32(ddlHubContentImage1.SelectedImage);
			}
			else
			{
				Hub.SetHubContentImage1Null();
			}
			Hub.HubContentImageAlignment1 = Convert.ToInt32(ddlHubContentImageAlignment1.SelectedValue);

			Hub.HubContentHeading2 = txtHubContentHeading2.Text;
			Hub.HubContent2 = Request.Form[edtHubContent2.Editor_HiddenField].ToString();
			ImageWizard ddlHubContentImage2 = Page.FindControl("ddlHubContentImage2") as ImageWizard;
			if (ddlHubContentImage2.SelectedImage > 0)
			{
				Hub.HubContentImage2 = Convert.ToInt32(ddlHubContentImage2.SelectedImage);
			}
			else
			{
				Hub.SetHubContentImage2Null();
			}
			Hub.HubContentImageAlignment2 = Convert.ToInt32(ddlHubContentImageAlignment2.SelectedValue);

			Hub.HubContentHeading3 = txtHubContentHeading3.Text;
			Hub.HubContent3 = Request.Form[edtHubContent3.Editor_HiddenField].ToString();
			ImageWizard ddlHubContentImage3 = Page.FindControl("ddlHubContentImage3") as ImageWizard;
			if (ddlHubContentImage3.SelectedImage > 0)
			{
				Hub.HubContentImage3 = Convert.ToInt32(ddlHubContentImage3.SelectedImage);
			}
			else
			{
				Hub.SetHubContentImage3Null();
			}
			Hub.HubContentImageAlignment3 = Convert.ToInt32(ddlHubContentImageAlignment3.SelectedValue);

			Hub.DateModified = DateTime.Now;
			Hub.ModifiedByAdminID = Convert.ToInt32(OryxUser.OryxIdentity.MemberID);

			if (blnNew)
			{
				Hub.DateCreated = DateTime.Now;
				DSHub.tbl_Hub.Addtbl_HubRow(Hub);
			}

			BPHub.Update(DSHub);

			if (!Hub.IsHubContentImage1Null())
			{
				MWUtility.CreateResizedImage(Hub.HubContentImage1, "h", "", imageSize, thumbSize, this);
			}

			if (!Hub.IsHubContentImage2Null())
			{
				MWUtility.CreateResizedImage(Hub.HubContentImage2, "h", "", imageSize, thumbSize, this);
			}

			if (!Hub.IsHubContentImage3Null())
			{
				MWUtility.CreateResizedImage(Hub.HubContentImage3, "h", "", imageSize, thumbSize, this);
			}
		}
Ejemplo n.º 2
0
		private void GetHubInfo()
		{
			BPHub BPHub = new BPHub();
			DSHub = BPHub.SelectAll();
			BEHub.tbl_HubRow Hub;

			if (DSHub.tbl_Hub.Rows.Count > 0)
			{
				Hub = DSHub.tbl_Hub[0];

				txtHubPageHeading.Text = Hub.HubPageHeading;

				if (!Hub.IsHubContentHeading1Null())
				{
					txtHubContentHeading1.Text = Hub.HubContentHeading1;
				}
				if (!Hub.IsHubContent1Null())
				{
					edtHubContent1.TextBoxText = Hub.HubContent1;
				}
				if(!Hub.IsHubContentImage1Null() && Hub.HubContentImage1 != 0)
				{
					ddlHubContentImage1.SelectedImage = Hub.HubContentImage1;
					ddlHubContentImageAlignment1.SelectedValue = Hub.HubContentImageAlignment1.ToString();
				}

				if (!Hub.IsHubContentHeading2Null())
				{
					txtHubContentHeading2.Text = Hub.HubContentHeading2;
				}
				if (!Hub.IsHubContent2Null())
				{
					edtHubContent2.TextBoxText = Hub.HubContent2;
				}
				if(!Hub.IsHubContentImage2Null() && Hub.HubContentImage2 != 0)
				{
					ddlHubContentImage2.SelectedImage = Hub.HubContentImage2;
					ddlHubContentImageAlignment2.SelectedValue = Hub.HubContentImageAlignment2.ToString();
				}

				if (!Hub.IsHubContentHeading3Null())
				{
					txtHubContentHeading3.Text = Hub.HubContentHeading3;
				}
				if (!Hub.IsHubContent3Null())
				{
					edtHubContent3.TextBoxText = Hub.HubContent3;
				}
				if(!Hub.IsHubContentImage3Null() && Hub.HubContentImage3 != 0)
				{
					ddlHubContentImage3.SelectedImage = Hub.HubContentImage3;
					ddlHubContentImageAlignment3.SelectedValue = Hub.HubContentImageAlignment3.ToString();
				}
			}
			else
			{
				//add home Group
			}
		}