//New protected void B_21_OnClick(object sender, EventArgs e) { try { Rep_General general = new Rep_General(); DataTable user = (DataTable)Session["user"]; int userId = int.Parse(user.Rows[0]["UserID"].ToString()); string module = general.SelectModule(userId, "AccountSearch"); if (module != "Stop") { string accId = Request.QueryString[general.ObfuscateQueryString("accID")].ToString(); Response.Redirect("~/Modules/" + module + ".aspx?" + general.ObfuscateQueryString("accID") + "=" + accId + "", false); } else { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", string.Format("window.alert('{0}');", "Access Denied"), true); } } catch (Exception ex) { string error = ex.Message; string errText = error.Replace("\'", ""); string AlertMSG = ""; AlertMSG += error; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", string.Format("window.alert('{0}');", AlertMSG), true); } }
//New protected void B_21_OnClick(object sender, EventArgs e) { try { Rep_General accountSearch = new Rep_General(); DataTable user = (DataTable)Session["user"]; int userId = int.Parse(user.Rows[0]["UserID"].ToString()); string module = accountSearch.SelectModule(userId, "AccountAdd"); if (module != "Stop") { //int accId = accountSearch.EncryptIds(int.Parse(selectinganItem["AccID"].Text)); Response.Redirect("~/Modules/" + module + ".aspx", false); } else { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", string.Format("window.alert('{0}');", "Access Denied"), true); } } catch (Exception ex) { string error = ex.Message; string errText = error.Replace("\'", ""); string AlertMSG = ""; AlertMSG += error; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", string.Format("window.alert('{0}');", AlertMSG), true); } }
protected void CustomersGRD_ItemCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == "EditCommand") { //string strKey = e.CommandArgument.ToString(); string strr = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["AccID"].ToString(); //Response.Redirect("~/Modules/Account/AccountAdd.aspx?ARXDWB=" + strr + ""); try { Rep_General accountSearch = new Rep_General(); DataTable user = (DataTable)Session["user"]; int userId = int.Parse(user.Rows[0]["UserID"].ToString()); string module = accountSearch.SelectModule(userId, "AccountAdd"); if (module != "Stop") { int accId = accountSearch.EncryptIds(int.Parse(strr)); Response.Redirect("~/Modules/" + module + ".aspx?" + accountSearch.ObfuscateQueryString("accID") + "=" + accId + ""); } else { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", string.Format("window.alert('{0}');", "Access Denied"), true); } } catch (Exception ex) { string error = ex.Message; string errText = error.Replace("\'", ""); string AlertMSG = ""; AlertMSG += error; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", string.Format("window.alert('{0}');", AlertMSG), true); } } #region Link else if (e.CommandName == "LinkCommand") { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", string.Format("ShowconfirmDialog();"), true); lblAccId.Text = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["AccID"].ToString(); } #endregion Link #region Refresh Grid else if (e.CommandName == "RebindGrid") { SearchBTN_Click(null, null); } #endregion Refresh Grid #region Else else { SearchBTN_Click(null, null); } #endregion Else }
protected void AddCustomerBTN_Click(object sender, EventArgs e) { //WindowsFlag = true; //AddCustomerWindow.Visible = true; //AddCustomerWindow.VisibleOnPageLoad = true; //Response.Redirect("CreateAccount.aspx"); //Response.Redirect("~/Modules/Account/AccountCreate.aspx"); //Response.Redirect("~/Modules/Account/AccountCreate.aspx?UZQF=1"); try { Rep_General accountSearch = new Rep_General(); DataTable user = (DataTable)Session["user"]; int userId = int.Parse(user.Rows[0]["UserID"].ToString()); string module = accountSearch.SelectModule(userId, "AccountAdd"); if (module != "Stop") { if (Request.QueryString[accountSearch.ObfuscateQueryString("accID")] != null) { string accId = Request.QueryString[accountSearch.ObfuscateQueryString("accID")].ToString(); Response.Redirect("~/Modules/" + module + ".aspx?" + accountSearch.ObfuscateQueryString("accID") + "=" + accId + "&" + accountSearch.ObfuscateQueryString("view") + "=1", false); } else { Response.Redirect("~/Modules/" + module + ".aspx", false); } } else { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", string.Format("window.alert('{0}');", "Access Denied"), true); } } catch (Exception ex) { string error = ex.Message; string errText = error.Replace("\'", ""); string AlertMSG = ""; AlertMSG += error; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", string.Format("window.alert('{0}');", AlertMSG), true); } }
protected void panel_lnkAccSales_OnClick(object sender, EventArgs e) { Rep_General general = new Rep_General(); foreach (GridDataItem selectinganItem in CustomersGRD.MasterTableView.Items) { if (selectinganItem.Selected) { try { int accId = general.EncryptIds(int.Parse(selectinganItem["AccID"].Text)); int accNo = general.EncryptIds(int.Parse(selectinganItem["AccNo"].Text)); Rep_General accountSearch = new Rep_General(); DataTable user = (DataTable)Session["user"]; int userId = int.Parse(user.Rows[0]["UserID"].ToString()); string module = accountSearch.SelectModule(userId, "AccountSales"); if (module != "Stop") { Response.Redirect("~/Modules/" + module + ".aspx?" + general.ObfuscateQueryString("accID") + "=" + accId + "&" + general.ObfuscateQueryString("accNo") + "=" + accNo + "", false); } else { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", string.Format("window.alert('{0}');", "Access Denied"), true); } } catch (Exception ex) { string error = ex.Message; string errText = error.Replace("\'", ""); string AlertMSG = ""; AlertMSG += error; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", string.Format("window.alert('{0}');", AlertMSG), true); } } else { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", string.Format("window.alert('{0}');", "Please select your record"), true); } } }
protected void btnLinkContact_OnClick(object sender, EventArgs e) { try { Rep_General general = new Rep_General(); Rep_Account contactLink = new Rep_Account(); DataTable user = (DataTable)Session["user"]; int userId = int.Parse(user.Rows[0]["UserID"].ToString()); int accId = general.DecryptIds(int.Parse(Request.QueryString[general.ObfuscateQueryString("accID")].ToString())); int accContactId = int.Parse(lblAccId.Text); byte contactType = byte.Parse(ddlContactType.Text); contactLink.Contact_Link(userId, accId, accContactId, contactType); //return to contact page string module = general.SelectModule(userId, "AccountContact"); if (module != "Stop") { int value = int.Parse(Request.QueryString[general.ObfuscateQueryString("accID")].ToString()); Response.Redirect("~/Modules/" + module + ".aspx?" + general.ObfuscateQueryString("accID") + "=" + value + "", false); } else { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", string.Format("window.alert('{0}');", "Access Denied"), true); } } catch (Exception ex) { string error = ex.Message; string errText = error.Replace("\'", ""); string AlertMSG = ""; AlertMSG += errText; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", string.Format("window.alert('{0}');", AlertMSG), true); } }