コード例 #1
0
ファイル: EditSetup.aspx.cs プロジェクト: alexan1/marketweb
		private void btnSubmit_ServerClick(object sender,EventArgs e)
		{
			BPSetup bp = new BPSetup();
			BESetup.tbl_SetupRow category;
			dsSetup = new BESetup();

			// Edit a Product Category
			dsSetup = bp.SelectAll();
			if(SetupID == 0)
			{
				category = dsSetup.tbl_Setup.Newtbl_SetupRow();
			}
			else
			{
				category = dsSetup.tbl_Setup.FindBySetupID(SetupID);				
			}
			//all content to be updated/inserted between here
			category.SetupEmailAddress1 = txtEmail1.Text;
			category.SetupEmailAddress2 = txtEmail2.Text;
			category.SetupEmailServer = txtEmailServer.Text;

			category.DateModified = DateTime.Now;
			category.ModifiedByAdminID = Convert.ToInt32(OryxUser.OryxIdentity.MemberID);
			//all content to be updated/inserted between here			
			if(SetupID == 0)
			{
				category.DateCreated = DateTime.Now;
				dsSetup.tbl_Setup.Addtbl_SetupRow(category);
			}
			bp.Update(dsSetup);

			Response.Redirect("Index.aspx");
		}
コード例 #2
0
ファイル: EditSetup.aspx.cs プロジェクト: alexan1/marketweb
		private void LoadSetup()
		{
			BPSetup bpCat = new BPSetup();
			BESetup ds = bpCat.SelectAll();
			if(ds.tbl_Setup.Rows.Count>0)
			{
				BESetup.tbl_SetupRow category = ds.tbl_Setup[0];
				if (!category.IsSetupEmailAddress1Null())
				{
					txtEmail1.Text = category.SetupEmailAddress1;
				}
				if (!category.IsSetupEmailAddress2Null())
				{
					txtEmail2.Text = category.SetupEmailAddress2;
				}
				if (!category.IsSetupEmailServerNull())
				{
					txtEmailServer.Text = category.SetupEmailServer;
				}
				mSetupID = category.SetupID;
				ViewState["SetupID"] = mSetupID;
				lblTitle.Text = "Edit Setup Options";
			}
			else
			{
				txtEmail1.Text = "";
				txtEmail2.Text = "";
				txtEmailServer.Text = "";
				mSetupID = 0;
				lblTitle.Text = "Add Setup Options";
			}
		}