/// <summary> /// Occurs when any language image was clicked. /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void LanguageCallback_Callback(object source, CallbackEventArgs e) { if (String.Equals(e.Parameter, "LanguageEn", StringComparison.CurrentCultureIgnoreCase)) { SessionManager.CurrentLanguage = Business.Language.SupportedLanguages[Languages.English]; } else if (String.Equals(e.Parameter, "LanguageCz", StringComparison.CurrentCultureIgnoreCase)) { SessionManager.CurrentLanguage = Business.Language.SupportedLanguages[Languages.Czech]; } ASPxWebControl.RedirectOnCallback(Request.Url.OriginalString); }
protected void ListForApprovalGrid_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (e.ButtonID == "ForApprovalGridEdit") { string doc_number = ListForApprovalGrid.GetRowValues(ListForApprovalGrid.FocusedRowIndex, "DocNumber").ToString(); string work_line = ListForApprovalGrid.GetRowValues(ListForApprovalGrid.FocusedRowIndex, "WorkLine").ToString(); Session["mrp_docNum"] = doc_number; Session["mrp_wrkLine"] = work_line; //ASPxWebControl.RedirectOnCallback("mrp_inventoryanalyst_forapproval.aspx?DocNum=" + doc_number.ToString() + "&WrkFlwLn=" + work_line.ToString()); ASPxWebControl.RedirectOnCallback("mrp_inventanalyst.aspx?DocNum=" + doc_number.ToString() + "&WrkFlwLn=" + work_line.ToString()); } }
protected void base_AfterPerformCallback(object sender, ASPxGridViewAfterPerformCallbackEventArgs e) { ASPxGridView g = sender as ASPxGridView; if (e.CallbackName == "CUSTOMCALLBACK" && e.Args.Length == 1 && e.Args[0] == "UPDATEEDIT") { int rowIndex = g.EditingRowVisibleIndex; g.UpdateEdit(); ASPxWebControl.RedirectOnCallback("job_edit.aspx?id=" + txtSid.Text); //g.StartEdit(rowIndex); } }
protected void gridMapping_CustomButtonCallback(object sender, ASPxGridViewCustomButtonCallbackEventArgs e) { int productId = (int)gridMapping.GetRowValues(e.VisibleIndex, new String[] { "ProductId" }); switch (e.ButtonID) { case "btnCustomMapManual": ASPxWebControl.RedirectOnCallback(string.Format("~/ProductMapping.aspx?channel={0}&product={1}", this.CurrentChannel, productId)); break; } }
protected void GridUnitOfferView_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (e.ButtonID == "ButtonPriceList") { ASPxGridView grid = sender as ASPxGridView; int index = e.VisibleIndex; string offercode = grid.GetRowValues(index, "OfferCode").ToString(); string sitecode = grid.GetRowValues(index, "SiteCode").ToString(); string unitcode = grid.GetRowValues(index, "UnitCode").ToString(); ASPxWebControl.RedirectOnCallback(VirtualPathUtility.ToAbsolute("~/AspxArea/PriceList/Forms/RetailPriceForm.aspx?sc=" + sitecode + "&oc=" + offercode + "&uc=" + unitcode)); } }
protected void RedirectHome(int messagetype) { bool isCallback = CommonMethods.IsCallbackRequest(this.Request); if (isCallback) { ASPxWebControl.RedirectOnCallback("~/Home.aspx?messageType=" + messagetype); } else { Response.Redirect("~/Home.aspx?messageType=" + messagetype); } }
protected void DocumentUpload_DownloadAttachments(object sender, EventArgs e) { model = GetDeliveryNoteProvider().GetDeliveryNoteModel(); if (model != null) { string fileName = (sender as UploadAttachment).currentFile.Name; DocumentEntity obj = GetAttachmentFromDB(fileName); AddValueToSession(Enums.CommonSession.DownloadDocument, obj); //Response.Redirect(Request.RawUrl); ASPxWebControl.RedirectOnCallback(Request.RawUrl); } }
protected void cbpVolver_Callback(object source, CallbackEventArgs e) { //Page.Session["BUSQUEDA"] = ViewState["BUSQUEDA"]; if (ViewState["RES"] != null) { asignacionResumen(ref objresumen); ASPxWebControl.RedirectOnCallback(objresumen.linkPrincial); } else { ASPxWebControl.RedirectOnCallback("Cartera.aspx"); } }
protected void NotesGridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.EditForm) { if (e.GetValue("NotesID") != null && e.GetValue("NotesID") != "") { ASPxWebControl.RedirectOnCallback("NotesEdit.aspx?ID=" + e.GetValue("ID") + "&NotesID=" + e.GetValue("NotesID") + "&PrevPage=NotesSearch.aspx"); } else { ASPxWebControl.RedirectOnCallback("NotesEdit.aspx?PrevPage=NotesSearch.aspx"); } } }
protected void ASPxGridViewIssueDocument_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) { string[] split = e.Parameters.Split(';'); if (split[0] == "DoubleClick") { ClearAllSessions(Enum.GetValues(typeof(Enums.IssueDocumentSession)).Cast <Enums.IssueDocumentSession>().ToList()); ASPxWebControl.RedirectOnCallback(GenerateURI("IssueDocumentForm.aspx", (int)Enums.UserAction.Edit, split[1])); } else if (split[0] == "PrintDocument") { ASPxWebControl.RedirectOnCallback(ConcatenateURLForPrint(split[1], "IssueDocument", true)); } }
protected void VersionInfoGridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.EditForm) { if (e.GetValue("VersionInfoID") != null && e.GetValue("VersionInfoID") != "") { ASPxWebControl.RedirectOnCallback("VersionInfoEdit.aspx?ID=" + e.GetValue("ID") + "&VersionInfoID=" + e.GetValue("VersionInfoID") + "&PrevPage=CustomerInfo.aspx"); } else { ASPxWebControl.RedirectOnCallback("VersionInfoEdit.aspx?ID=" + CustomerKey.ToString() + "&PrevPage=CustomerInfo.aspx"); } } }
protected void ASPxGridViewInventoryDeliveries_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) { ClearAllSessions(Enum.GetValues(typeof(Enums.InventoryDeliveriesSession)).Cast <Enums.InventoryDeliveriesSession>().ToList()); object valueID = 0; int userAction = CommonMethods.ParseInt(e.Parameters); if (userAction != (int)Enums.UserAction.Add) { valueID = ASPxGridViewInventoryDeliveries.GetRowValues(ASPxGridViewInventoryDeliveries.FocusedRowIndex, "InventoryDeliveriesID"); } ASPxWebControl.RedirectOnCallback(GenerateURI("InventoryDeliveriesForm.aspx", userAction, valueID)); }
protected void gridPMapping_CustomButtonCallback(object sender, ASPxGridViewCustomButtonCallbackEventArgs e) { int relId = (int)gridPMapping.GetRowValues(e.VisibleIndex, new String[] { "RelId" }); switch (e.ButtonID) { case "btnCustomChooseAndSave": //save new mapping into DB CanonMapping.AddMapping(relId); ASPxWebControl.RedirectOnCallback(string.Format("~/ChannelMapping.aspx?channel={0}", this.CurrentChannel)); break; } }
protected void CustomerGridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.EditForm) { if (e.GetValue("ID") != null && e.GetValue("ID") != "") { ASPxWebControl.RedirectOnCallback("CustomerInfo.aspx?ID=" + e.GetValue("ID") + "&TabIndex=0"); } else { ASPxWebControl.RedirectOnCallback("CustomerInfo.aspx"); } } }
/// <summary> /// If the user doesn't have rights for opening page than we redirect user to Home page /// </summary> protected void RedirectHome() { Session["PreviousPage"] = Request.RawUrl; bool isCallback = CommonMethods.IsCallbackRequest(this.Request); if (isCallback) { ASPxWebControl.RedirectOnCallback("~/Default.aspx"); } else { Response.Redirect("~/Default.aspx"); } }
private void CheckCreatorKey() { if (Session["CreatorKey"] == null) { if (Page.IsCallback) { ASPxWebControl.RedirectOnCallback(MRPClass.DefaultPage()); } else { Response.Redirect("default.aspx"); } return; } }
protected void GridB2BCustomerView_CustomButtonCallback(object sender, ASPxGridViewCustomButtonCallbackEventArgs e) { ASPxGridView grid = sender as ASPxGridView; int index = e.VisibleIndex; string id = grid.GetRowValues(index, "Id").ToString(); if (e.ButtonID == "ButtonContacts") { ASPxWebControl.RedirectOnCallback(VirtualPathUtility.ToAbsolute("~/AspxArea/Booking/Forms/B2BCustomerDetailsView.aspx?id=" + id)); } if (e.ButtonID == "ButtonBookingProcess") { ASPxWebControl.RedirectOnCallback(VirtualPathUtility.ToAbsolute("~/AspxArea/Booking/Forms/B2BCustomerBookingDetailsView.aspx?id=" + id)); } }
private void Imprimir() { asignacionResumen(ref objresumen); string Reporte = "ReporteScoring"; byte[] archivo = GenerarReporte(objresumen.idEmpresa); if (archivo != null) { Page.Session["tipoDoc"] = "pdf"; Page.Session["binaryData"] = archivo; Page.Session["Titulo"] = Reporte; ASPxWebControl.RedirectOnCallback("BajarDocumento.aspx"); } //return "ok"; }
protected void gridSPPB_SelectionChanged(object sender, EventArgs e) { BootstrapGridView grid = sender as BootstrapGridView; for (int i = 0; i < grid.VisibleRowCount; i++) // Loop through selected rows { if (grid.Selection.IsRowSelected(i)) // do whatever you need to do with selected row values { // now use pre-initialized List<object> selectedList to save string key = grid.GetRowValues(i, "SPP_ID_PK").ToString(); string status = grid.GetRowValues(i, "StatusDesc").ToString(); ASPxWebControl.RedirectOnCallback(string.Format("~/Pages/InputSPPB.aspx?SPP_ID={0}&StatusDesc={1}", key, status)); } } }
private void CheckSessionExpire() { if (Session["CreatorKey"] == null) { if (Page.IsCallback) { ASPxWebControl.RedirectOnCallback(Constants.default_pagename); } else { Response.Redirect(Constants.default_pagename); } //Response.Redirect("default.aspx"); return; } }
protected void clbCheckIfReady_Callback(object source, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { if (String.Equals(e.Parameter, "CheckActualization", StringComparison.CurrentCultureIgnoreCase)) { UpdateActualizationStatus(); } else if (String.Equals(e.Parameter, "GoToFinished", StringComparison.CurrentCultureIgnoreCase)) { ManualImportQueue miq = CanonManualImport.GetCompleteChannelByUser(SessionManager.LoggedUser.UserId); if (miq != null) { ASPxWebControl.RedirectOnCallback(string.Format("~/ChannelMapping.aspx?channel={0}&miq={1}", miq.ChannelId, miq.RecordId)); } } }
protected void ClearAllSessions <T>(List <T> sessionList, string redirectPageUrl, bool isCallback = false) { foreach (var item in sessionList) { RemoveSession(item.ToString()); } if (isCallback) { ASPxWebControl.RedirectOnCallback(redirectPageUrl); } else { Response.Redirect(redirectPageUrl); } }
protected void grid_CustomCallback(object sender, DevExpress.Web.ASPxGridViewCustomCallbackEventArgs e) { try { int intIndiceRow = Convert.ToInt32(e.Parameters); DataRow dtr = grid.GetDataRow(intIndiceRow); //Session[Constantes.SesionCodigoEmpleado] = dtr[Constantes.ColumnaEmpleadoUserId].ToString(); Session[Constantes.SesionUserIdEmpleado] = dtr[Constantes.ColumnaEmpleadoUserId].ToString(); ASPxWebControl.RedirectOnCallback("~/datosempleado"); //Response.Redirect("~/datosempleado", false); } catch (Exception) { throw; } }
private bool DescargarExcel(string[] parametros) { bool Descarga = false; DataTable dt = (DataTable)Page.Session["dtBitacora"]; string certificado = parametros == null ? string.Empty : parametros[1]; string razonsocial = parametros == null ? string.Empty : parametros[2]; DataTable dtFilter = null; //var aa = dt.AsEnumerable().Where(r => r.Field<string>("NCF").Equals(string.IsNullOrEmpty(certificado) ? r.Field<string>("NCF") : certificado) // && r.Field<string>("RazonSocial").Contains(string.IsNullOrEmpty(razonsocial) ? r.Field<string>("RazonSocial") : razonsocial) // ).Any(); //var bb = dt.AsEnumerable().Where(r => r.Field<string>("NCF").Equals(string.IsNullOrEmpty(certificado) ? r.Field<string>("NCF") : certificado) // && r.Field<string>("RazonSocial").Contains(string.IsNullOrEmpty(razonsocial) ? r.Field<string>("RazonSocial") : razonsocial) // ); dtFilter = !dt.AsEnumerable().Where(r => r.Field <string>("NCF").Equals(string.IsNullOrEmpty(certificado) ? r.Field <string>("NCF") : certificado) && r.Field <string>("RazonSocial").Contains(string.IsNullOrEmpty(razonsocial) ? r.Field <string>("RazonSocial") : razonsocial) ).Any() ? new DataTable() : dt.AsEnumerable().Where(r => r.Field <string>("NCF").Equals(string.IsNullOrEmpty(certificado) ? r.Field <string>("NCF") : certificado) && r.Field <string>("RazonSocial").Contains(string.IsNullOrEmpty(razonsocial) ? r.Field <string>("RazonSocial") : razonsocial) ).CopyToDataTable(); if (dtFilter.Rows.Count > 0) { Descarga = true; dtFilter.Columns.Remove("Id"); dtFilter.Columns.Remove("IdMotivo"); dtFilter.Columns.Remove("IdCausa"); dtFilter.Columns.Remove("IdBanco"); dtFilter.Columns.Remove("IdAcreedor"); dtFilter.Columns.Remove("IdConcepto"); dtFilter.Columns["NCF"].ColumnName = "N° CF"; dtFilter.Columns["RazonSocial"].ColumnName = "Razón Social"; dtFilter.Columns["DescMotivo"].ColumnName = "Motivo"; dtFilter.Columns["DescCausa"].ColumnName = "Causa"; Page.Session["tipoDoc"] = "excel"; Page.Session["binaryData"] = util.convierteExcel(dtFilter); Page.Session["Titulo"] = "Cuenta Corriente"; ASPxWebControl.RedirectOnCallback("BajarDocumento.aspx"); } return(Descarga); }
public static bool IsTimeOutReached(Page page) { if (page != null && !Properties.Settings.Default.AirplaneMode) { string loginUrl = "~/Account/Login.aspx"; HttpSessionState mySession = page.Session; int sessionCount = (mySession != null) ? mySession.Count : 0; HttpResponse myResponse = page.Response; IPrincipal myUser = page.User; if ((sessionCount == 0 && !page.IsCallback) && myResponse != null) { myResponse.Redirect(loginUrl); } else if (sessionCount == 0 && page.IsCallback) { FormsAuthentication.SignOut(); ASPxWebControl.RedirectOnCallback(loginUrl); } else if (myUser != null) { IIdentity myIdentity = myUser.Identity; if (myIdentity != null && !myIdentity.IsAuthenticated) { FormsAuthentication.SignOut(); FormsAuthentication.RedirectToLoginPage(); } else if (myResponse != null && !IsUserAuthorised()) { string authorisedApp = GetAuthorisedApp(); string errorMessage = string.Format("You are not authorised to access {0} and are being redirected to {1}", Application, authorisedApp); string redirectUrl = "Default.aspx?Application=" + authorisedApp; string script = string.Format("alert('{0}'); window.location.href = '{1}'", errorMessage, redirectUrl); if (page != null && !page.ClientScript.IsClientScriptBlockRegistered("alert")) { page.ClientScript.RegisterClientScriptBlock(page.GetType(), "alert", script, true /* addScriptTags */); } } } } // All earlier redirects will exit before here ... return(false); }
protected void MaintWinListGridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.EditForm) { //Mukund: VSPLUS-844, Page redirect on callback try { ASPxWebControl.RedirectOnCallback("MaintenanceWin.aspx?ID=" + e.GetValue("ID")); Context.ApplicationInstance.CompleteRequest();//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); //throw ex; } } }
private void DescargarInstruccionCurse(string nCertificado) { LogicaNegocio Ln = new LogicaNegocio(); string Reporte = "CartaInstruccion"; string sp = "ReporteCartaInstrucciones"; byte[] archivo = Ln.CrearReporte(Reporte, sp, nCertificado); if (archivo != null) { //ExcluirReporteCurse(nCertificado); Page.Session["tipoDoc"] = "pdf"; Page.Session["binaryData"] = archivo; Page.Session["Titulo"] = Reporte; ASPxWebControl.RedirectOnCallback("BajarDocumento.aspx"); } }
protected void DocumentEditorCallback_Callback(object source, CallbackEventArgs e) { DocumentsApp.Document.ValidateCurrentDocumentExists(); string newDocumentName = e.Parameter; string newDocumentUrl; DocumentCommandResult commandStatus = DocumentsApp.Document.TrySaveAsNewDocument(newDocumentName, out newDocumentUrl); if (commandStatus == DocumentCommandResult.OK) { ASPxWebControl.RedirectOnCallback(newDocumentUrl); } else { e.Result = commandStatus == DocumentCommandResult.DocumentAlreadyExists ? "exists" : "format"; } }
protected void ServerAccessGridView_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.EditForm) { try { if (e.GetValue("ID") != " " && e.GetValue("ID") != null) { ASPxWebControl.RedirectOnCallback("AssignServerAccess_Edit.aspx?UserID=" + e.GetValue("ID") + "&FullName=" + e.GetValue("FullName")); Context.ApplicationInstance.CompleteRequest(); } } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["User"] == null) { if (Page.IsCallback) { ASPxWebControl.RedirectOnCallback("/Account/login.aspx"); } else { Response.Redirect("/Account/login.aspx"); } } if (!IsPostBack) { string val = string.IsNullOrWhiteSpace(Request.QueryString["id"]) ? "0" : Request.QueryString["id"]; string year = string.IsNullOrWhiteSpace(Request.QueryString["year"]) ? "0" : Request.QueryString["year"]; string month = string.IsNullOrWhiteSpace(Request.QueryString["month"]) ? "0" : Request.QueryString["month"]; string date = string.IsNullOrWhiteSpace(Request.QueryString["date"]) ? "0" : Request.QueryString["date"]; month = Request.QueryString["month"].PadLeft(2, '0'); date = Request.QueryString["date"].PadLeft(2, '0'); string path = "\\Image\\factor2010\\albaranes\\Dropbox\\" + year.Substring(year.Length - 2) + "\\" + month + "\\" + date + "\\"; var cliente = (Clientes)Session["User"]; if (AlbaranRepository.CheckAlbaranosverIdforImage(val, cliente.AutoCliente) > 0) { DirSearch(@"" + Server.MapPath(path), val, path); } else { Response.Redirect("~/Albaranes.aspx"); } } //string[] dirs = Directory.GetDirectories("C:\factor2010\albaranes"); //foreach (string item2 in dirs) //{ // FileInfo f = new FileInfo(item2); //} }