Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void Page_Load(object sender, EventArgs e)
- {
- tadbDataContext tadb = new tadbDataContext();
- Dictionary<string, string> hexColors = tadb.msp_silentAuctionColors.ToDictionary(t => t.colorDescription, t => t.colorValue);
- tbTextColor.Text = hexColors["textColor"];
- tbAltColor.Text = hexColors["altColor"];
- tbBackgroundColor.Text = hexColors["backgroundColor"];
- }
- using (tadbDataContext tadb = new tadbDataContext())
- {
- var textColor = tadb.msp_silentAuctionColors.Single(x => x.colorDescription == "textColor");
- var altColor = tadb.msp_silentAuctionColors.Single(x => x.colorDescription == "altColor");
- var backgroundColor = tadb.msp_silentAuctionColors.Single(x => x.colorDescription == "backgroundColor");
- textColor.colorValue = tbTextColor.Text;
- altColor.colorValue = tbAltColor.Text;
- backgroundColor.colorValue = tbBackgroundColor.Text;
- tadb.SubmitChanges();
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- if(!Page.IsPostBack)
- {
- tadbDataContext tadb = new tadbDataContext();
- Dictionary<string, string> hexColors = tadb.msp_silentAuctionColors.ToDictionary(t => t.colorDescription, t => t.colorValue);
- tbTextColor.Text = hexColors["textColor"];
- tbAltColor.Text = hexColors["altColor"];
- tbBackgroundColor.Text = hexColors["backgroundColor"];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement