protected void btnSave_Click(object sender, EventArgs e) { StaticPageGroup objContinents = new StaticPageGroup(); objContinents.Data = this.SetData(); int nResult = 0; string sLink = ""; string sAction = Request.QueryString[Constants.ACTION]; switch (sAction) { case Constants.ACTION_ADD: nResult = objContinents.Insert(); if (nResult > 0) { sLink = Constants.ROOT + Pages.BackEnds.ADMIN + "?" + Constants.PAGE + "=" + Pages.BackEnds.STR_STATICPAGEGROUP + "&" + Constants.MESS_ID + "=" + Constants.MESSAGE_INSERT; Response.Redirect(sLink); } else MessageBoxss.Show(MessagesAlert.INSERT_UNSUCCESSFUL); break; case Constants.ACTION_EDIT: int nID = ConvertData.ConvertToInt(Request.QueryString[Constants.ACTION_ID]); nResult = objContinents.Update(nID); if (nResult > 0) { MessageBoxss.Show(MessagesAlert.UPDATE_SUCCESSFUL); } else MessageBoxss.Show(MessagesAlert.UPDATE_UNSUCCESSFUL); break; } }
private void BindData(int CurrentPageIndex) { StaticPageGroup objContactUs = new StaticPageGroup(); DataTable dtbContactUs = new DataTable(); dtbContactUs = objContactUs.SearchAll(); RpStaticPageGroup.DataSource = dtbContactUs; RpStaticPageGroup.DataBind(); }
protected void RpStaticPageGroup_ItemCommand(object source, RepeaterCommandEventArgs e) { string strCommand = e.CommandName; int nID = ConvertData.ConvertToInt(e.CommandArgument); StaticPageGroup objContactUs = new StaticPageGroup(); switch (strCommand) { case "Delete": int nDelete = objContactUs.DeleteById(nID); BindData(1); break; case "Edit": string sEdit = Constants.ROOT + Pages.BackEnds.ADMIN + "?" + Constants.PAGE + "=" + Pages.BackEnds.STR_STATICPAGEGROUP_ADD+ "&" + Constants.ACTION + "=" + Constants.ACTION_EDIT + "&" + Constants.ACTION_ID + "=" + nID; Response.Redirect(sEdit); break; } }
private void BindDataWhenEdit() { string sAction = ConvertData.ConvertToString(Request.QueryString[Constants.ACTION]); try { if (sAction == Constants.ACTION_EDIT) { int nID = ConvertData.ConvertToInt(Request.QueryString[Constants.ACTION_ID]); if (nID > 0) { StaticPageGroup objContinents = new StaticPageGroup(); objContinents.LoadById(nID); txtDescript.Text = ConvertData.ConvertToString(objContinents.Data.Description); } } } catch { string sLink = Constants.ROOT + Pages.BackEnds.ADMIN + "?" + Constants.PAGE + "=" + Pages.BackEnds.STR_STATICPAGEGROUP + "&" + Constants.MESS_ID + "=" + Constants.ITEM_NOTEXIST; ; Response.Redirect(sLink); } }
private string GetGroupByID(int nID) { StaticPageGroup obj = new StaticPageGroup(); obj.LoadById(nID); string sGroupName = obj.Data.Description; return sGroupName; }
private void BindDataToGroupDropdown() { DataTable dtbCategory = new DataTable(); StaticPageGroup objCategory = new StaticPageGroup(); dtbCategory = objCategory.SearchAll(); ddlGroup.DataSource = dtbCategory; ddlGroup.DataValueField = "StaticPageGroupID"; ddlGroup.DataTextField = "Description"; ddlGroup.DataBind(); }
private eStaticPageGroup ContinentsEntity() { eStaticPageGroup entityContinents = new eStaticPageGroup(); int nItemID = ConvertData.ConvertToInt(Request.QueryString[Constants.ACTION_ID]); string sQueery = ConvertData.ConvertToString(Request.QueryString[Constants.ACTION]); if (nItemID > 0 && sQueery == Constants.ACTION_EDIT) { StaticPageGroup objContinents = new StaticPageGroup(); objContinents.LoadById(nItemID); entityContinents = objContinents.Data; } return entityContinents; }
private eStaticPageGroup SetData() { StaticPageGroup objCountry = new StaticPageGroup(); eStaticPageGroup eCountry = this.ContinentsEntity(); objCountry.Data.Description = ConvertData.ConvertToString(txtDescript.Text.Trim()); return objCountry.Data; }