protected void RadGrid_Orders_ItemCommand(object sender, GridCommandEventArgs e) { int lKeyID = 0; string lEvent = e.CommandName; string page = ""; switch (lEvent) { case ActRow.Edit: lKeyID = int.Parse(e.CommandArgument.ToString()); page = WebConfigurationManager.AppSettings["PageOrder"]; TNavigation.EditPage(page, lKeyID, "401", "edit"); break; } }
// Delete's Button Click public void Delete_Click(object sender, EventArgs e) { if (this.KeyID != 0) { if (DeleteByID(this.KeyID) == 1) { ShowSuccessMes(MSG_DELETE_SUCCESS); TNavigation.BackPage(); } else { ShowErrorMes(MSG_DELETE_FAIL); } } else { ShowErrorMes(MSG_DELETE_CAN_NOT_DELETED); } }
protected void Page_Load(object sender, EventArgs e) { if (MySession.ClockScren != null && MySession.ClockScren == "True") { Session.Abandon(); Response.Redirect(WebConfigurationManager.AppSettings["WebHome"]); } String strShow = Request.QueryString["module"] == null ? "" : Request.QueryString["module"].ToString().ToUpper(); String strAct = Request.QueryString["act"] == null ? "" : Request.QueryString["act"].ToString().ToLower(); if (Request.QueryString["KeyID"] != null) { string page = Request.QueryString["module"]; int KeyID = int.Parse(Request.QueryString["KeyID"].ToString()); PageKeyID.AddKeyID(page, KeyID); string url = HttpContext.Current.Request.Url.AbsoluteUri; url = url.Substring(0, url.IndexOf("&KeyID=")); HttpContext.Current.Response.Redirect(url); return; } switch (strShow) { case "EX": Session.Abandon(); Response.Redirect(WebConfigurationManager.AppSettings["WebHome"]); break; default: if (Session["USysConfig"] == null || Session["USysConfig"].ToString() == "") //Chưa login { //Session["CSSStyle"] = "login.css"; Response.Redirect("~/Pages/Outer/Login.aspx" + Utils.FuncParam()); } else { cHeader.Controls.Add(LoadControl(WebConfigurationManager.AppSettings["ControlPath"] + "Header/cHeader.ascx")); cMenu.Controls.Add(LoadControl(WebConfigurationManager.AppSettings["ControlPath"] + "Menu/cLeftMenu.ascx")); if (strShow != "") { //if (strShow == "CP") // cPage.Controls.Add(LoadControl(WebConfigurationManager.AppSettings["PagePath"] + "Account/cAccountInfo.ascx")); if (MyConfig.CheckPermission(strShow)) { string sUControl = TNavigation.GetControlNavigation(strShow); if (sUControl.Trim() != "") { try { if (strAct == "") { cPage.Controls.Add(LoadControl(WebConfigurationManager.AppSettings["PagePath"] + sUControl)); } else //if (Page.FindControl(WebConfigurationManager.AppSettings["WebHome"] + "Controls/" + sUControl.Replace(".ascx", "Alter.ascx")) as UserControl) != null) { cPage.Controls.Add(LoadControl(WebConfigurationManager.AppSettings["PagePath"] + sUControl.Replace(".ascx", "Alter.ascx"))); } } catch // Lỗi vì sai Page Control ! { cPage.Controls.Add(LoadControl(WebConfigurationManager.AppSettings["PagePath"] + "ErrorPage/cPageNotFound.ascx")); } } else { Response.Redirect(WebConfigurationManager.AppSettings["WebHome"]); } } else // Không có quyền truy cập { cPage.Controls.Add(LoadControl(WebConfigurationManager.AppSettings["PagePath"] + "ErrorPage/cPageNotPermited.ascx")); } } } break; } }
// Event New's button Click public void New_Click(object sender, EventArgs e) { string page = Page.Request.QueryString["module"]; TNavigation.NewPage(page, 0); }
// Back's button CLick public void Back_Click(object sender, EventArgs e) { TNavigation.BackPage(); }