This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try { | |
| DbUtils.StartTransaction(); | |
| if (!this.IsPageRefresh) { | |
| this.SaveData(); | |
| } | |
| this.CommitTransaction(sender); | |
| } catch (Exception ex) { | |
| // Upon error, rollback the transaction | |
| this.RollBackTransaction(sender); | |
| this.ErrorOnPage = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public partial class EditProductsTable | |
| : BaseApplicationPage | |
| // Code-behind class for the EditProductsTable page. | |
| // Place your customizations in Section 1. Do not modify Section 2. | |
| { | |
| #region "Section 1: Place your customizations here." | |
| HashSet<string> AutoSaveCtrlIDs = new HashSet<string>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public partial class EditProductsTable2 | |
| : BaseApplicationPage | |
| // Code-behind class for the EditProductsTable2 page. | |
| // Place your customizations in Section 1. Do not modify Section 2. | |
| { | |
| #region "Section 1: Place your customizations here." | |
| public EditProductsTable2() { | |
| this.Initialize(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void SaveButton_Click(object sender, EventArgs args) { | |
| bool shouldRedirect = true; | |
| string TargetKey = null; | |
| string DFKA = TargetKey; | |
| string id = DFKA; | |
| string value = id; | |
| try { | |
| // Enclose all database retrieval/update code within a Transaction boundary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public override void CommitTransaction(object sender) { | |
| base.CommitTransaction(sender); | |
| // Your custom code here. | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TextBox CustomerID = MiscUtils.FindControlRecursively(Page, "CustomerID") as TextBox; | |
| string idValue = CustomerID.Text; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #region "Section 1: Place your customizations here." | |
| public static class PageExt { | |
| public static string CustomerID(this Page page) { | |
| return (MiscUtils.FindControlRecursively(page, "CustomerID") as TextBox).Text; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string idValue = Page.CustomerID(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var ampMembers = MemberTable.GetRecords("AMP = 1"); | |
| int random = new Random(DateTime.Now.Ticks).Next(ampMembers.Length); | |
| this.DataSource = ampMembers[random]; |
OlderNewer