示例#1
0
    protected void GridViewPresupuestosver_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
    {
        var Cliente = (Clientes)Session["User"];

        if (Cliente == null)
        {
            if (Page.IsCallback)
            {
                ASPxWebControl.RedirectOnCallback("/Account/login.aspx");
            }
            else
            {
                Response.Redirect("/Account/login.aspx");
            }
        }
        if (e.Parameters.Contains("searchtext"))
        {
            Session["buttonclick"]             = "searchtext";
            GridViewPresupuestosver.DataSource = PresupuestosRepository.GetAllPresupuestosver(searchText.Text, Cliente.AutoCliente, null, null);
        }
        else if (e.Parameters.Contains("date"))
        {
            Session["buttonclick"]             = "date";
            GridViewPresupuestosver.DataSource = PresupuestosRepository.GetAllPresupuestosver("", Cliente.AutoCliente, dtfromDate.Date, dttoDate.Date);
        }
        else
        {
            Session["buttonclick"]             = "showall";
            GridViewPresupuestosver.DataSource = PresupuestosRepository.GetAllPresupuestosver("", Cliente.AutoCliente, null, null);
        }
        GridViewPresupuestosver.DataBind();
    }
 private void AddClientSideFunctionalityCore(ASPxWebControl dxControl)
 {
     if (dxControl != null)
     {
         EventHandler loadEventHandler = (s, e) => {
             ASPxWebControl control = (ASPxWebControl)s;
             ClientSideEventsHelper.AssignClientHandlerSafe(control, "GotFocus", @"
                 function (s,e){
                     if (s.inputElement!=null)
                         window.lastFocusedEditorId = s.inputElement.id;
                 }", Guid.NewGuid().ToString());
             ClientSideEventsHelper.AssignClientHandlerSafe(control, "Init", @"            
                 function (s,e){
                     if (s.inputElement!=null && window.lastFocusedEditorId === s.inputElement.id) {
                         var timeout = window.setTimeout(function () {
                             var element = document.getElementById(s.inputElement.id);
                             element.focus();
                             element.selectionStart = element.selectionEnd = 10000;
                             clearTimeout(timeout);
                         }, 500);
                     }
                 }", Guid.NewGuid().ToString());
         };
         EventHandler disposedEventHandler = null;
         disposedEventHandler = (s, e) => {
             ASPxWebControl control = (ASPxWebControl)s;
             control.Disposed -= disposedEventHandler;
             control.Load     -= loadEventHandler;
         };
         dxControl.Disposed += disposedEventHandler;
         dxControl.Load     += loadEventHandler;
     }
 }
示例#3
0
        protected void sharepointGridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            e.Row.Attributes.Add("onmouseover", "this.originalcolor=this.style.backgroundColor;" + "this.style.backgroundColor='#C0C0C0';");

            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalcolor;");

            if (e.RowType == GridViewRowType.EditForm)
            {
                if (e.GetValue("ID").ToString() != " ")
                {
                    //"DominoProperties.aspx?Key=" + e.GetValue("ID")
                    //Mukund: VSPLUS-844, Page redirect on callback
                    try
                    {
                        ASPxWebControl.RedirectOnCallback("SharepointServer.aspx?ID=" + e.GetValue("ID") + "&name=" + e.GetValue("ServerName") + "&Cat=" + e.GetValue("ServerType") + "&Loc=" + e.GetValue("Location") + "&ipaddr=" + e.GetValue("ipaddress"));
                        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;
                    }
                }
            }
        }
 protected void CallbackPanel_Callback(object sender, DevExpress.Web.CallbackEventArgsBase e)
 {
     if (ASPxEdit.ValidateEditorsInContainer(sender as ASPxCallbackPanel))
     {
         ASPxWebControl.RedirectOnCallback(VirtualPathUtility.ToAbsolute(loginUrl));
     }
 }
示例#5
0
        protected void LicenseGridView_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e)
        {
            if (e.RowType == GridViewRowType.EditForm)



            {
                try
                {
                    if (e.GetValue("ID") != " " && e.GetValue("ID") != null)
                    {
                        ASPxWebControl.RedirectOnCallback("Licensekey.aspx?ID=" + e.GetValue("ID"));
                        Context.ApplicationInstance.CompleteRequest();
                    }
                    else
                    {
                        ASPxWebControl.RedirectOnCallback("Licensekey.aspx");
                        Context.ApplicationInstance.CompleteRequest();
                    }
                }
                catch (Exception ex)
                {
                    Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                }
            }
        }
示例#6
0
        // Cách tạo lỗi Exception
        // NotImplementedException innerException = new NotImplementedException("NoReport");
        // throw new NotImplementedException("This message has been generated for a GetCallbackErrorMessage() method demonstration.", innerException);

        //protected override void InitializeCulture()
        //{
        //    if (!string.IsNullOrEmpty(GetDXCurrentLanguageValue()))
        //    {
        //        //for regional server standards
        //        Culture = GetDXCurrentLanguageValue();
        //        //for DevExpress localizable strings
        //        UICulture = GetDXCurrentLanguageValue();
        //    }
        //}
        protected void Page_Load(object sender, EventArgs e)
        {
            if (HttpContext.Current.Session["Log"] == null)
            {
                HttpContext.Current.Session["Log"] = "";
            }

            ASPxWebControl.RegisterBaseScript(this);
            GridViewFeaturesHelper.SetupGlobalGridViewBehavior(GridView);

            DemoHelper.Instance.ControlAreaMaxWidth = Unit.Pixel(1300);
            UpdatePageToolbarEnable();

            if (!IsPostBack)
            {
                HttpContext.Current.Session["isActBloChanged_Com"] = true;
                HttpContext.Current.Session["isCloneRow_Com"]      = false;
                HttpContext.Current.Session["isDetailRow_Com"]     = false;

                List <MenuInfo> menuItems = StatusProvider.GetMenuList("Request", "Tình trạng HS");
                //FiltersNavBar.BuildNavBarItems(menuItems);
            }
            if (IsCallback)
            {
            }
        }
示例#7
0
        protected void NodesGridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            //3/4/2016 NS modified for VSPLUS-2687
            //e.Row.Attributes.Add("onmouseover", "this.originalcolor=this.style.backgroundColor;" + "this.style.backgroundColor='#C0C0C0';");
            //e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalcolor;");

            if (e.RowType == GridViewRowType.EditForm)
            {
                try
                {
                    if (e.GetValue("ID") != " " && e.GetValue("ID") != null)
                    {
                        ASPxWebControl.RedirectOnCallback("~/Configurator/NodeSettingsProperties.aspx?ID=" + e.GetValue("ID"));
                        Context.ApplicationInstance.CompleteRequest();                        //Mukund, 05Aug14, VSPLUS-844:Page redirect on callback
                    }
                    else
                    {
                        ASPxWebControl.RedirectOnCallback("~/Configurator/NodeSettingsProperties.aspx");
                        Context.ApplicationInstance.CompleteRequest();
                    }
                }
                catch (Exception ex)
                {
                    Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                    //throw ex;
                }

                //}
            }
        }
示例#8
0
 protected void URLsGridView_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType == GridViewRowType.EditForm)
     {
         //11/19/2013 NS modified - can't use TheURL column value as it may not be unique
         //if (e.GetValue("TheURL") != " " && e.GetValue("TheURL")!=null)
         //{
         //    ASPxWebControl.RedirectOnCallback("URLProperties.aspx?TheURL=" + e.GetValue("TheURL"));
         //}
         //Mukund: VSPLUS-844, Page redirect on callback
         try
         {
             if (e.GetValue("ID") != "" && e.GetValue("ID") != null)
             {
                 ASPxWebControl.RedirectOnCallback("URLProperties.aspx?ID=" + e.GetValue("ID"));
                 Context.ApplicationInstance.CompleteRequest();//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback
             }
             else
             {
                 ASPxWebControl.RedirectOnCallback("URLProperties.aspx");
                 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;
         }
     }
 }
        protected void QuoteTransfersGrid_OnCustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
        {
            switch (e.Parameters)
            {
            case "RowDoubleClick":
                if (QuoteTransfersGrid.FocusedRowIndex < 0)
                {
                    return;
                }
                Session["QuoteNumber"]     = QuoteTransfersGrid.GetRowValues(QuoteTransfersGrid.FocusedRowIndex, "QuoteNumber");
                Session["RedirectPage"]    = "~/QuoteLogIntegration/Pages/QuoteTransferList.aspx";
                Session["FocusedRowIndex"] = QuoteTransfersGrid.FocusedRowIndex;
                var TARGET_URL = "~/QuoteLogIntegration/Pages/QuoteTransfer.aspx";
                if (Page.IsCallback)
                {
                    ASPxWebControl.RedirectOnCallback(TARGET_URL);
                }
                else
                {
                    Response.Redirect(TARGET_URL);
                }
                break;

            default:
                throw new Exception(e.Parameters);
            }
        }
示例#10
0
        // This method is now obsolete!
        public void btnWF_Clicked(object sender, EventArgs e)
        {
            ASPxButton pButton = (ASPxButton)sender;

            // This could change - and we should add a tool tip
            String sAction = pButton.Text;

            // Hopefully, this is always set!

            if (Assignment != null)
            {
                // We found a winner!
                // OK - we should now have the assignment ID right in the workflow item!
                WFEngine pWFEngine = GetWFEngine();

                // Handle item with the specified action
                pWFEngine.HandleItemAsync(Assignment.WFAssignId, sAction, null);

                // Change to this if we put this in a callback!
                ASPxWebControl.RedirectOnCallback("/Default.aspx");

                // This doesn't work in a callback!
                // Response.Redirect ("/Default.aspx");
            }
        }
示例#11
0
        protected void nlGridView1_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            //if (e.RowType == GridViewRowType.EditForm)
            //{
            //    ASPxWebControl.RedirectOnCallback("DominoProperties.aspx?Key=" + e.GetValue("ID"));
            //}
            e.Row.Attributes.Add("onmouseover", "this.originalcolor=this.style.backgroundColor;" + "this.style.backgroundColor='#C0C0C0';");

            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalcolor;");
            //1/7/2014 NS added
            if (e.RowType == GridViewRowType.EditForm)
            {
                //Mukund: VSPLUS-844, Page redirect on callback
                try
                {
                    if (e.GetValue("NetworkLatencyId") != " " && e.GetValue("NetworkLatencyId") != null)
                    {
                        ASPxWebControl.RedirectOnCallback("NetworkLatencyTestServers.aspx?Key=" + e.GetValue("NetworkLatencyId"));
                        Context.ApplicationInstance.CompleteRequest();//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback
                    }
                    else
                    {
                        ASPxWebControl.RedirectOnCallback("NetworkLatencyTestServers.aspx");
                        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;
                }
            }
        }
示例#12
0
        /// <summary>
        /// Panel callback processing
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        protected void DefaultPageCallbackPanel_Callback(object source, CallbackEventArgsBase e)
        {
            if ((!e.Parameter.StartsWith("ShowChart")) && (!e.Parameter.StartsWith("ExportToExcel")))
            {
                return;
            }
            List <int> channels = (SessionManager.CurrentChannels.Count == 0) ? this.GetListOfChannels()
                                                                : SessionManager.CurrentChannels;
            List <int>    products  = new List <int>();
            List <object> keyValues = gridMainMonitor.GetSelectedFieldValues("ProductId");

            foreach (object key in keyValues)
            {
                products.Add(int.Parse(key.ToString()));
            }
            if ((channels.Count == 0) || (products.Count == 0))
            {
                return;
            }
            if (e.Parameter.StartsWith("ShowChart"))
            {
                string productsParam = string.Format("products={0}",
                                                     Memos.Framework.Utilities.ListToString(products));
                string channelsParam = string.Format("channels={0}",
                                                     Memos.Framework.Utilities.ListToString(channels));
                ASPxWebControl.RedirectOnCallback(string.Format("~/Charts.aspx?{0}&{1}",
                                                                productsParam, channelsParam));
            }
            else if (e.Parameter.StartsWith("ExportToExcel"))
            {
                string filename = this.GenerateExcelFile(channels, products);
                string fileUrl  = string.Format("{0}/{1}", ConfigSettings.UploadDirectory, filename);
                DefaultPageCallbackPanel.JSProperties["cpResult"] = fileUrl;
            }
        }
示例#13
0
        /// <summary>
        /// Valida si la conexion ya expiro
        /// </summary>
        /// <param name="sender">Objeto que dispara la accion</param>
        /// <returns>retorna verdadero cuando la sesion esta activa</returns>
        public bool ValidarConexionYUsuarioLogueado(dynamic sender)
        {
            try
            {
                if (Session["connectionString"] == null || Session["USER"] == null)
                {
                    Session.Clear();
                    string paginaLogin = "******";

                    if (sender.GetType() == typeof(ASPxGridView))
                    {
                        ASPxWebControl.RedirectOnCallback(paginaLogin);
                    }
                    else if (sender.GetType() == typeof(GridViewWrapper))
                    {
                        ASPxWebControl.RedirectOnCallback(paginaLogin);
                    }
                    else if (sender.GetType() == typeof(ASPxCallbackPanel))
                    {
                        ASPxWebControl.RedirectOnCallback(paginaLogin);
                    }
                    else
                    {
                        Response.Redirect(paginaLogin);
                    }
                    return(false);
                }
                return(true);
            }
            catch (Exception ex)
            {
                EstablecerError(ex.Message, sender);
                return(false);
            }
        }
示例#14
0
        protected void Grid_BatchUpdate(object sender, ASPxDataBatchUpdateEventArgs e)
        {
            DataTable dtbEliminados = new DataTable();

            try
            {
                dtbEliminados.Columns.Add(Constantes.ColumnaHorarioSchclassid, typeof(int));

                foreach (var args in e.InsertValues)
                {
                    InsertNewItem(args.NewValues);
                }
                foreach (var args in e.UpdateValues)
                {
                    UpdateItem(args.Keys, args.NewValues);
                }
                foreach (var args in e.DeleteValues)
                {
                    DeleteItem(args.Keys, dtbEliminados);
                }

                new ClsHorariosAsistencia().GestionarHorario((DataTable)Session[Constantes.SesionTablaHorario], dtbEliminados);
                //Session[Constantes.TablaDistribucion] = null;
                grvHorarios.DataSource = (DataTable)Session[Constantes.SesionTablaHorario];
                grvHorarios.DataBind();
                e.Handled = true;
            }
            catch (Exception ex)
            {
                Session["Error"] = ex.Message;
                ASPxWebControl.RedirectOnCallback("~/horarios.aspx");
            }
        }
        protected void gridCreatedPO_CustomButtonCallback(object sender, ASPxGridViewCustomButtonCallbackEventArgs e)
        {
            string       btnID = e.ButtonID;
            ASPxGridView grid  = sender as ASPxGridView;

            ponumber = grid.GetRowValues(grid.FocusedRowIndex, "PONumber").ToString();
            switch (btnID)
            {
            case "Edit":
            {
                ASPxWebControl.RedirectOnCallback("mrp_po_addedit.aspx?PONum=" + ponumber);
                //Response.RedirectLocation = "mrp_po_addedit.aspx?PONum="+ponumber;
                break;
            }

            case "Delete":
            {
                break;
            }

            case "Submit":
            {
                break;
            }
            }
        }
示例#16
0
        protected void CallbackPanel_Callback(object sender, DevExpress.Web.CallbackEventArgsBase e)
        {
            string[] split = e.Parameter.Split(';');

            if (split[0] == "UserAction")
            {
                object position  = ASPxGridViewIssueDocumentPosition.GetRowValues(ASPxGridViewIssueDocumentPosition.FocusedRowIndex, "IssueDocumentPositionID");
                bool   openPopup = SetSessionsAndOpenPopUp(split[1], Enums.IssueDocumentSession.IssueDocumentPositionID, position);
                AddValueToSession(Enums.IssueDocumentSession.IssueDocumentID, issueDocumentID);

                if (userAction == (int)Enums.UserAction.Add)
                {
                    AddOrEditEntityObject(true);
                    AddValueToSession(Enums.CommonSession.OpenPopupAfterRefresh, true);
                    ASPxWebControl.RedirectOnCallback(GenerateURI("IssueDocumentForm.aspx", (int)Enums.UserAction.Edit, issueDocumentID));
                }
                else
                {
                    if (openPopup)
                    {
                        PopupControlIssueDocumentPos.ShowOnPageLoad = true;
                    }
                }
            }
        }
示例#17
0
 protected void DominoClusterGridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType == GridViewRowType.EditForm)
     {
         //Mukund: VSPLUS-844, Page redirect on callback
         try
         {
             if (e.GetValue("ID") != " " && e.GetValue("ID") != null)
             {
                 ASPxWebControl.RedirectOnCallback("LotusDominoCluster.aspx?ID=" + e.GetValue("ID"));
                 Context.ApplicationInstance.CompleteRequest();//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback
             }
             else
             {
                 ASPxWebControl.RedirectOnCallback("LotusDominoCluster.aspx");
                 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;
         }
     }
 }
示例#18
0
 protected void MailServicesGridView_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType == GridViewRowType.EditForm)
     {
         //Mukund: VSPLUS-844, Page redirect on callback
         try
         {
             if (e.GetValue("key") != " ")
             {
                 ASPxWebControl.RedirectOnCallback("MailService.aspx?Key=" + e.GetValue("key"));
                 Context.ApplicationInstance.CompleteRequest();//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback
             }
             else
             {
                 ASPxWebControl.RedirectOnCallback("MailService.aspx");
                 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;
         }
     }
 }
示例#19
0
    protected void cpFind_Callback(object sender, CallbackEventArgsBase e)
    {
        try
        {
            var _Security = new Security();
            var _User     = new User();
            _Security.UserName = txtEmail.Value;
            _Security.Password = txtPassword.Value;

            if (_Security.ValidateUser())
            {
                ASPxWebControl.RedirectOnCallback(VirtualPathUtility.ToAbsolute("/HomePage.aspx"));
            }
            {
                txtEmail.Value = "Invalid Email or Password!!";
            }
        }
        catch (Exception ex)
        {
            Security MInsureSecurity = new Security();
            MInsureSecurity.ErrorDesscription = ex.Message;
            MInsureSecurity.ErrorModule       = "Validating Privilige on Roles";
            MInsureSecurity.SaveError();
        }
    }
示例#20
0
 public static void InjectIEEdgeCompatModeMeta(Control parent)
 {
     if (RenderUtils.Browser.IsIE)
     {
         ASPxWebControl.SetIECompatibilityModeEdge(parent);
     }
 }
示例#21
0
        protected void BlackBerryGridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            e.Row.Attributes.Add("onmouseover", "this.originalcolor=this.style.backgroundColor;" + "this.style.backgroundColor='#C0C0C0';");

            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalcolor;");


            if (e.RowType == GridViewRowType.EditForm)
            {
                //Mukund: VSPLUS-844, Page redirect on callback
                try
                {
                    if (e.GetValue("SID").ToString() != "")
                    {
                        ASPxWebControl.RedirectOnCallback("BlackBerryEntertpriseServer.aspx?Key=" + e.GetValue("SID"));
                        Context.ApplicationInstance.CompleteRequest();//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback
                    }
                    else
                    {
                        ASPxWebControl.RedirectOnCallback("BlackBerryEntertpriseServer.aspx");
                        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;
                }
            }
        }
        protected void DELSDefGridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            e.Row.Attributes.Add("onmouseover", "this.originalcolor=this.style.backgroundColor;" + "this.style.backgroundColor='#C0C0C0';");

            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalcolor;");


            if (e.RowType == GridViewRowType.EditForm)
            {
                try
                {
                    if (e.GetValue("ID") != " " && e.GetValue("ID") != null)
                    {
                        ASPxWebControl.RedirectOnCallback("DominoELS_Edit.aspx?EventKey=" + e.GetValue("ID"));
                        Context.ApplicationInstance.CompleteRequest();
                    }
                    else
                    {
                        ASPxWebControl.RedirectOnCallback("DominoELS_Edit.aspx");
                        Context.ApplicationInstance.CompleteRequest();
                    }
                }
                catch (Exception ex)
                {
                    Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                }
            }
        }
示例#23
0
        protected void QuoteTransferCallbackPanel_OnCallback(object sender, CallbackEventArgsBase e)
        {
            switch (e.Parameter)
            {
            case "New":
                if (QuoteTransfersGrid.FocusedRowIndex < 0)
                {
                    return;
                }
                Session["QuoteNumber"]     = null;
                Session["RedirectPage"]    = "~/QuoteLogIntegration/Pages/QuoteTransferList.aspx";
                Session["FocusedRowIndex"] = QuoteTransfersGrid.FocusedRowIndex;
                var TARGET_URL = "~/QuoteLogIntegration/Pages/QuoteTransfer.aspx";
                if (Page.IsCallback)
                {
                    ASPxWebControl.RedirectOnCallback(TARGET_URL);
                }
                else
                {
                    Response.Redirect(TARGET_URL);
                }
                break;

            default:
                throw new Exception(e.Parameter);
            }
        }
示例#24
0
    protected void GridViewAlbaransver_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
    {
        var Cliente = (Clientes)Session["User"];

        if (Cliente == null)
        {
            ASPxWebControl.RedirectOnCallback("/Account/login.aspx");
        }

        string CodigoCliente = Cliente.Código;
        int    AutoCliente   = Cliente.AutoCliente;
        int    AutoArticulo  = Convert.ToInt32(e.GetListSourceFieldValue("AutoArtículo"));
        string resp          = (string)CommonFunction.Calculoalbaran(Convert.ToString(GridViewAlbaransver.GetRowValues(e.ListSourceRowIndex, "SerieAlbaran")), 5);

        if (e.Column.FieldName == "Importe")
        {
            var val = CommonFunction.Field(resp, 1, "&");
            if (!string.IsNullOrEmpty(val))
            {
                e.Value = Convert.ToDouble(CommonFunction.Field(resp, 1, "&"));
            }
        }
        else if (e.Column.FieldName == "ImporteIgic")
        {
            var val = CommonFunction.Field(resp, 2, "&");
            if (!string.IsNullOrEmpty(val))
            {
                e.Value = Convert.ToDouble(CommonFunction.Field(resp, 2, "&"));
            }
        }
    }
 void ChangeTheme(ControlCollection cc, string strCssFilePath, string strCssPostfix)
 {
     foreach (Control control in cc)
     {
         ASPxWebControl Webcontrol = control as ASPxWebControl;
         if (Webcontrol != null)
         {
             Webcontrol.CssFilePath = strCssFilePath;
             Webcontrol.CssPostfix  = strCssPostfix;
             ASPxPageControl temp = control as ASPxPageControl;
             if (temp != null)
             {
                 //ASPxPageControl1.TabPages[0].Controls
                 foreach (TabPage tp in temp.TabPages)
                 {
                     ChangeTheme(tp.Controls, strCssFilePath, strCssPostfix);
                 }
             }
             else
             {
                 ASPxPanelBase temp2 = control as ASPxPanelBase;
                 if (temp2 != null)
                 {
                     ChangeTheme(temp2.Controls, strCssFilePath, strCssPostfix);
                 }
             }
         }
     }
 }
示例#26
0
    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 (Request.Browser.IsMobileDevice)
        //      {
        //          if (Page.IsCallback)
        //          {
        //              ASPxWebControl.RedirectOnCallback("/mobile/PresupuestosList.aspx");
        //          }
        //          else
        //          {
        //              Response.Redirect("/mobile/PresupuestosList.aspx");
        //          }

//        }
        DateTime?defecha = null;
        DateTime?afecha  = null;

        if (!Page.IsPostBack)
        {
            Session["buttonclick"] = "date";
            defecha = Convert.ToDateTime(fechahoy.ToString("01/MMM/yyy"));
            afecha  = Convert.ToDateTime(DateTime.DaysInMonth(fechahoy.Year, fechahoy.Month) + "/" + fechahoy.Month + "/" + fechahoy.Year);
        }

        if ((dtfromDate.Date != null || dttoDate.Date != null) && Convert.ToString(Session["buttonclick"]) == "date")
        {
            defecha = dtfromDate.Date;
            afecha  = dttoDate.Date;
        }

        var Cliente = (Clientes)Session["User"];

        GridViewPresupuestosver.DataSource = PresupuestosRepository.GetAllPresupuestosver("", Cliente.AutoCliente, defecha, afecha);
        GridViewPresupuestosver.DataBind();

        string seriePresupuesto = string.Empty;

        if (GridViewPresupuestosver.GetSelectedFieldValues("SeriePresupuesto").Count > 0)
        {
            seriePresupuesto = Convert.ToString(GridViewPresupuestosver.GetSelectedFieldValues("SeriePresupuesto").Select(c => c).FirstOrDefault());
        }
        else
        {
            seriePresupuesto = Convert.ToString(GridViewPresupuestosver.GetRowValues(0, "SeriePresupuesto"));
        }
        GridViewPresupuestosverDetail.DataSource = PresupuestosRepository.GetAllPresupuestosverDetail(seriePresupuesto);
        GridViewPresupuestosverDetail.DataBind();
    }
示例#27
0
 public static void InjectIECompatModeMeta(Control parent, int compatibilityVersion)
 {
     if (!RenderUtils.Browser.IsIE || RenderUtils.Browser.Version >= 10 || RenderUtils.Browser.Version < compatibilityVersion + 1)
     {
         return;
     }
     ASPxWebControl.SetIECompatibilityMode(compatibilityVersion, parent);
 }
        protected void ChartsCallback_Callback(object sender, CallbackEventArgsBase e)
        {
            List <GraphBinding> list = GetClientDataProviderInstance().GetGraphBindingList();

            List <QueryStrings> queryStrings = new List <QueryStrings> {
                new QueryStrings()
                {
                    Attribute = Enums.QueryStringName.categorieId.ToString(), Value = categorieID.ToString()
                },
                new QueryStrings()
                {
                    Attribute = Enums.QueryStringName.recordId.ToString(), Value = clientID.ToString()
                }
            };

            if (!String.IsNullOrEmpty(e.Parameter))
            {
                if (e.Parameter.Equals("ThreeInRow"))
                {
                    chartsInRow = 3;
                }
                else if (e.Parameter.Equals("TwoInRow"))
                {
                    chartsInRow = 2;
                }

                else if (e.Parameter.Equals("OneInRow"))
                {
                    chartsInRow = 1;
                }

                GetClientDataProviderInstance().SetChartsCoutInRow(chartsInRow);
                ASPxWebControl.RedirectOnCallback(GenerateURI("ClientsChartsDetail.aspx", queryStrings));

                /*ChartsCallback.Controls.Clear();
                 * AddControlsToPanel(list);*/
            }

            if (model == null)
            {
                ShowClientPopUp("First save the client and add some categories to view the charts.");
            }

            if (list == null && !btnDisplayAllCharts.Checked)
            {
                CreateCharts();
            }
            else if (list == null && btnDisplayAllCharts.Checked)
            {
                CreateCharts(true);
            }
            else if (model.StrankaKategorija.Count(cat => cat.HasChartDataForCategorie) != list.Count)
            {
                GetClientDataProviderInstance().SetGraphBindingList(null);
                ASPxWebControl.RedirectOnCallback(GenerateURI("ClientsChartsDetail.aspx", queryStrings));
                //We use this if the user is changing tabs(if the user has deleted one of the categories wee need to refresh it)
            }
        }
示例#29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] != null)
        {
            TopMenu.Visible    = false; //Login
            LogingMenu.Visible = true;  //Logout
        }
        else
        {
            TopMenu.Visible    = true;  //Login
            LogingMenu.Visible = false; //Logout
            if (!HttpContext.Current.Request.Url.AbsoluteUri.Contains("login"))
            {
                if (Page.IsCallback)
                {
                    ASPxWebControl.RedirectOnCallback("/Account/login.aspx");
                }
                else
                {
                    Response.Redirect("/Account/login.aspx");
                }
            }
        }

        DateTime?defecha = null;
        DateTime?afecha  = null;

        if (!Page.IsPostBack)
        {
            Session["buttonclick"] = "date";
            defecha = Convert.ToDateTime(fechahoy.ToString("01/MMM/yyy"));
            afecha  = Convert.ToDateTime(DateTime.DaysInMonth(fechahoy.Year, fechahoy.Month) + "/" + fechahoy.Month + "/" + fechahoy.Year);
        }

        if ((dtfromDate.Date != null || dttoDate.Date != null) && Convert.ToString(Session["buttonclick"]) == "date")
        {
            defecha = dtfromDate.Date;
            afecha  = dttoDate.Date;
        }

        var Cliente = (Clientes)Session["User"];

        GridViewPresupuestosver.DataSource = PresupuestosRepository.GetAllPresupuestosver("", Cliente.AutoCliente, defecha, afecha);
        GridViewPresupuestosver.DataBind();

        string seriePresupuesto = string.Empty;

        if (GridViewPresupuestosver.GetSelectedFieldValues("SeriePresupuesto").Count > 0)
        {
            seriePresupuesto = Convert.ToString(GridViewPresupuestosver.GetSelectedFieldValues("SeriePresupuesto").Select(c => c).FirstOrDefault());
        }
        else
        {
            seriePresupuesto = Convert.ToString(GridViewPresupuestosver.GetRowValues(0, "SeriePresupuesto"));
        }
        GridViewPresupuestosverDetail.DataSource = PresupuestosRepository.GetAllPresupuestosverDetail(seriePresupuesto);
        GridViewPresupuestosverDetail.DataBind();
    }
示例#30
0
        void Application_Error(object sender, EventArgs e)
        {
            string error = "";

            if (Context != null && Server.GetLastError() != null)
            {
                CommonMethods.getError(Context.Error, ref error);
            }

            if (HttpContext.Current.Error != null)
            {
                CommonMethods.getError(HttpContext.Current.Error, ref error);
            }

            //if is there error on client side we need aditional information about error


            error += "\r\n \r\n" + sender.GetType().FullName + "\r\n" + HttpContext.Current.Request.UrlReferrer.AbsoluteUri + "\r\n";

            string body = "Pozdravljeni! \r\n Uporabnik " + PrincipalHelper.GetUserPrincipal().FirstName + " " +
                          PrincipalHelper.GetUserPrincipal().LastName + " je dne " + DateTime.Now.ToLongDateString() + " ob " + DateTime.Now.ToLongTimeString() +
                          " naletel na napako! \r\n Podrobnosti napake so navedene spodaj: \r\n \r\n" + error + "\r\n";

            bool isSent = CommonMethods.SendEmailToDeveloper("ETT - NAPAKA", "Napaka aplikacije", body);

            CommonMethods.LogThis(body);

            if (Context != null)
            {
                Context.ClearError();
            }


            Server.ClearError();

            if (error.Contains("&%") && error.Contains("messageType"))
            {
                string[] split       = error.Split('&');
                int      startIndex  = error.IndexOf("&%") + 2;//eliminiramo znaka &%
                int      length      = error.Substring(startIndex).IndexOf("&%");
                string   newString   = error.Substring(startIndex, length);
                string   messagetype = newString.Substring(newString.IndexOf("=") + 1);

                bool isCallback = CommonMethods.IsCallbackRequest(HttpContext.Current.Request);
                if (isCallback)
                {
                    ASPxWebControl.RedirectOnCallback("~/Home.aspx?messageType=" + messagetype);
                }
                else
                {
                    HttpContext.Current.Response.Redirect("~/Home.aspx?messageType=" + messagetype);
                }
            }
            else
            {
                HttpContext.Current.Response.Redirect("~/Home.aspx?unhandledExp=true");
            }
        }
 private static void AddEventHandlerSafe(ASPxWebControl control, string eventName, string handler) {
     string existingHandler = control.GetClientSideEventHandler(eventName);
     if(string.IsNullOrEmpty(existingHandler)) {
         control.SetClientSideEventHandler(eventName, string.Format(ClientSideEventHandlerFunctionFormat, handler));
     }
     else {
         existingHandler = String.Format("{0}{1}\r\n}}", existingHandler.Substring(0, existingHandler.LastIndexOf('}')), handler);
         control.SetClientSideEventHandler(eventName, existingHandler);
     }
 }
  private void ApplyFocusedStyleCore(ASPxWebControl dxControl) {
     if(dxControl != null) {
         EventHandler loadEventHandler = (s, e) => {
             var control = (ASPxWebControl)s;
             AddEventHandlerSafe(control, "Init", "window.initEditor(s,e);");
             AddEventHandlerSafe(control, "GotFocus", "window.gotFocusEditor(s,e);");
         };
         EventHandler disposedEventHandler = null;
         disposedEventHandler = (s, e) => {
             var control = (ASPxWebControl)s;
             control.Disposed -= disposedEventHandler;
             control.Load -= loadEventHandler;
         };
         dxControl.Disposed += disposedEventHandler;
         dxControl.Load += loadEventHandler;
     }
 }
 protected CommonASPxExpandablePanel(ASPxWebControl ownerControl)
     : base(ownerControl)
 {
 }
 protected CommonASPxSearchPanel(ASPxWebControl ownerControl)
     : base(ownerControl)
 {
     InitializeDefaults();
 }
 public ASPxSmartStaticDataViewControl(ASPxWebControl ownerControl) : base(ownerControl)
 {
 }
 protected ASPxSearchPanel(ASPxWebControl ownerControl) : base(ownerControl)
 {
 }
 public ASPxSimpleDataViewItem(ASPxWebControl ownerControl) : base(ownerControl)
 {
 }