// Save Button protected void btnSave_Click(object sender, EventArgs e) { msgPanel.Visible = false; string successMsg = string.Format("{0} <b>{1}</b> {2}", Properties.Resources.Save, this.NewsTitle, Properties.Resources.Successfully); bool action = false; if (Page.IsValid) { if (this.AddNew == true) action = this.LinqInsertData(); else action = this.LinqUpdateData(); // Check Saving data.. if (this.Found == true) BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.Found, "error"); else { if (action == true) BaseSys.ShowMsg(msgPanel, lbMsg, successMsg, "ok"); else BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.Failure, "error"); } } else { BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.FailureValid, "error"); } }
// Fetch row data from xml using xml dataset protected void XmlFetchRowData() { if (File.Exists(this.xmlFile)) { // Get data from xml file about.ReadXml(this.xmlFile); row = (Company.AboutRow)about.Rows[0]; txtWhoAreWe.Text = row.WhoAreWe; txtProfile.Text = row.Profile; txtManager.Text = row.Manager; } else { BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.XmlFileNotFound, "error"); } }
// Save Button protected void btnSave_Click(object sender, EventArgs e) { if (File.Exists(this.xmlFile)) { if (Page.IsValid) { bool action = this.XmlSaveData(); if (action == true) BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.Success, "ok"); else BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.Failure, "error"); } else { BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.FailureValid, "error"); } } else { BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.XmlFileNotFound, "error"); } }
// Fetch row data from xml using xml dataset protected void XmlFetchRowData() { if (File.Exists(this.xmlFile)) { // Get data from xml file home.ReadXml(this.xmlFile); row = (Company.HomeRow)home.Rows[0]; txtTitle.Text = row.Title; txtInformation.Text = row.Information; txtVision.Text = row.Vision; txtMission.Text = row.Mission; } else { BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.XmlFileNotFound, "error"); } }
// Fetch row data from xml using xml dataset protected void XmlFetchRowData() { if (File.Exists(this.xmlFile)) { // Get data from xml file about.ReadXml(this.xmlFile); row = (Company.WebsiteRow)about.Rows[0]; txtCompany.Text = row.Company; txtTitle.Text = row.Title; mwcAsyncImageUpload.InitializeUploadBox(false, row.Logo); } else { BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.XmlFileNotFound, "error"); } }
// Save Data protected void btnSave_Click(object sender, EventArgs e) { msgPanel.Visible = false; // Check if the page is valid - this is for more security if (Page.IsValid) { bool action = false; action = this.LinqChangeCurrentUserPassword(); // Check Saving data.. if(this.WrongOldPassword == true) BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.WrongPassword, "error"); else BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.Success, "ok"); } else { BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.FailureValid, "error"); } }
// Fetch row data from xml using xml dataset protected void XmlFetchRowData() { if (File.Exists(this.xmlFile)) { // Get data from xml file home.ReadXml(this.xmlFile); row = (Company.ContactUsRow)home.Rows[0]; txtAddress.Text = row.Address; txtPhone.Text = row.Phone; txtFax.Text = row.Fax; txtMobile.Text = row.Mobile; txtEmail.Text = row.Email; } else { BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.XmlFileNotFound, "error"); } }
// Save Button protected void btnSave_Click(object sender, EventArgs e) { msgPanel.Visible = false; bool action = false; if (Page.IsValid) { action = this.SendEmailMessage(); // Check Saving and sending data.. if (action == true) { BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.SuccessSentEmail, "ok"); this.LinqInsertEmail(); } else BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.Failure, "error"); } else { BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.FailureValid, "error"); } }
// Save Button protected void btnSave_Click(object sender, EventArgs e) { if (File.Exists(xmlFile)) { if (Page.IsValid) { bool action = false; if (this.AddNew == true) action = this.XmlInsertData(); else action = this.LinqXmlUpdateData(); // Checking saving data.. if (action == true) BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.Success, "ok"); else BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.Failure, "error"); } else { BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.FailureValid, "error"); } } else { BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.XmlFileNotFound, "error"); } }
/// <summary> /// Check the login authentication and pass to next page for successful login /// </summary> protected void CheckLoginAuthentication() { this.LinqLoginAuthentication(); if (this.LoginResult == "Success")// Login Successful Success { // Store values in session BaseSys.LogInControlPanel = true; BaseSys.SysUserID = this.FoundUserID; BaseSys.PrivilegeID = this.FoundPrivilegeID; // Store login info for status this.LinqInsertLoginStatusData(); // Redirect to control panel Response.Redirect("~/Admin/Smart/Default.aspx"); this.SetUserInfoToTopMenu(); } else { BaseSys.LogInControlPanel = false; if (this.LoginResult == "NotActive") BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.NoAdminPermission, "error"); else if (this.LoginResult == "NotSucceed") BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.WrongLogin, "error"); // Only add for first time, others update in specified time if (this.LoginTryID > 0) { this.LinqUpdateLoginTryData().ToString(); } else { this.LinqInsertLoginTryData(); } txtPassword.Text = string.Empty; } }