private void BindData() { //try //{ // Load Setting Data var objSetting = new CMS.BLL.Setting(); DataTable dtbSetting = objSetting.Search(); int nSettingCount = dtbSetting.Rows.Count; int nSettingLastestId = ConvertData.ConvertToInt(dtbSetting.Rows[nSettingCount - 1]["SettingID"]); objSetting.LoadById(nSettingLastestId); txtMetaKeyword.Text = objSetting.Data.MetaKeyword1; txtMetaDescription.Text = objSetting.Data.MetaDescription1; var objCompany = new Company(); objCompany.LoadById(1); //int nCompanyLastestID = ConvertData.ConvertToInt(dtbCompany.Rows[nCompanyCount - 1]["CompanyID"]); //objCompany.LoadById(nCompanyLastestID); txtAddress.Text = objCompany.Data.Address; txtCompanyName.Text = objCompany.Data.CompanyName; txtEmail.Text = objCompany.Data.Email; txtFooter.Text = objCompany.Data.Copyright; txtHotline.Text = objCompany.Data.Hotline; txtTel.Text = objCompany.Data.Tel; txtWebsite.Text = objCompany.Data.Website; txtYahoo1.Text = objCompany.Data.YahooAccount1; txtYahoo2.Text = objCompany.Data.YahooAccount2; txtYahoo3.Text = objCompany.Data.YahooAccount3; txtYahoo4.Text = objCompany.Data.YahooAccount4; txtYahooDescription1.Text = objCompany.Data.YahooDescription1; txtYahooDescription2.Text = objCompany.Data.YahooDescription2; txtYahooDescription3.Text = objCompany.Data.YahooDescription3; txtYahooDescription4.Text = objCompany.Data.YahooDescription4; txtSkypeName.Text = objCompany.Data.SkypeDescription1; txtUserSkype.Text = objCompany.Data.SkypeAccount1; //txtSkype3.Text = objCompany.Data.SkypeAccount3; //txtSkype4.Text = objCompany.Data.SkypeAccount4; txtGoogleMap.Text = objCompany.Data.GoogleMap; txtEmailForward1.Text = objCompany.Data.EmailFwd1; txtEmailForward2.Text = objCompany.Data.EmailFwd2; //} //catch //{ // string sURL = Constants.ROOT + Pages.BackEnds.ADMIN; // Response.Redirect(sURL); //} }
protected void lnkbtSave_Click(object sender, EventArgs e) { // Updating Setting Data var objSetting = new CMS.BLL.Setting(); DataTable dtbSetting = objSetting.Search(); int nSettingCount = dtbSetting.Rows.Count; int nSettingLastestId = ConvertData.ConvertToInt(dtbSetting.Rows[nSettingCount - 1]["SettingID"]); objSetting.Data.MetaKeyword1 = txtMetaKeyword.Text.Trim(); objSetting.Data.MetaDescription1 = txtMetaDescription.Text.Trim(); int nSettingResult = objSetting.Update(nSettingLastestId); // Updating Company Data var objCompany = new Company(); DataTable dtbCompany = objCompany.Search(); int nCompanyCount = dtbCompany.Rows.Count; int nCompanyLastestId = ConvertData.ConvertToInt(dtbCompany.Rows[nCompanyCount - 1]["CompanyID"]); objCompany.Data.Website = txtWebsite.Text.Trim(); objCompany.Data.Tel = txtTel.Text.Trim(); objCompany.Data.Hotline = txtHotline.Text.Trim(); objCompany.Data.Email = txtEmail.Text.Trim(); objCompany.Data.Copyright = txtFooter.Text.Trim(); objCompany.Data.YahooAccount1 = txtYahoo1.Text.Trim(); objCompany.Data.YahooAccount2 = txtYahoo2.Text.Trim(); objCompany.Data.YahooAccount3 = txtYahoo3.Text.Trim(); objCompany.Data.YahooAccount4 = txtYahoo4.Text.Trim(); objCompany.Data.YahooDescription1 = txtYahooDescription1.Text.Trim(); objCompany.Data.YahooDescription2 = txtYahooDescription2.Text.Trim(); objCompany.Data.YahooDescription3 = txtYahooDescription3.Text.Trim(); objCompany.Data.YahooDescription4 = txtYahooDescription4.Text.Trim(); objCompany.Data.SkypeDescription1 = txtSkypeName.Text.Trim(); objCompany.Data.SkypeAccount1 = txtUserSkype.Text.Trim(); objCompany.Data.SkypeAccount3 = string.Empty; // txtSkype3.Text.Trim(); objCompany.Data.SkypeAccount4 = string.Empty; // txtSkype4.Text.Trim(); objCompany.Data.CompanyName = txtCompanyName.Text.Trim(); objCompany.Data.Address = txtAddress.Text.Trim(); objCompany.Data.GoogleMap = txtGoogleMap.Text.Trim(); objCompany.Data.EmailFwd1 = txtEmailForward1.Text.Trim(); objCompany.Data.EmailFwd2 = txtEmailForward2.Text.Trim(); int nCompanyResult = objCompany.Update(nCompanyLastestId); int nResult = nCompanyResult * nSettingResult; if (nResult > 0) { MessageBoxss.Show(MessagesAlert.UPDATE_SUCCESSFUL); string sUrl = Constants.ROOT + Pages.BackEnds.ADMIN + "?" + Constants.PAGE + "=" + Pages.BackEnds.STR_SETTING + "&" + Constants.MESS_ID + "=" + Constants.MESSAGE_UPDATE; Response.Redirect(sUrl); } else { MessageBoxss.Show(MessagesAlert.UPDATE_UNSUCCESSFUL); } }