Beispiel #1
0
        /// <summary>
        /// 在状态栏显示提示信息
        /// </summary>
        /// <param name="Error">提示文本</param>
        public static void TipError(string Error)
        {
            BarButtonItem BarTip;
            string        ChildMenu_Error = "页面错误";

            if (Provider.Get("BarTip") != null)
            {
                BarTip = (BarButtonItem)Provider.Get("BarTip");
                if (BaseService.CheckConfiguration("Global_ChildMenu_ShowErrorDetail").ToBoolEx())
                {
                    BarTip.Caption = Error;
                }
                else
                {
                    ChildMenu_Error = Provider.Get("ChildMenu_Error").ToStringEx();
                    BarTip.Caption  = ChildMenu_Error;
                    BarTip.Hint     = Error;
                }
                BarTip.Visibility = BarItemVisibility.Always;
                Sys_Page sys_Page = new Sys_Page();
                if (Provider.SysPage != null)
                {
                    sys_Page = Provider.SysPage;
                }
                //BaseService.SaveLog(ChildMenu_Error, Error, (byte)Sys_Log_Type.Information, sys_Page.Menu_Id);
            }
        }
Beispiel #2
0
 /// <summary>
 /// 自动更新
 /// </summary>
 protected void InitializeAutoUpdate()
 {
     try
     {
         if (!BaseService.CheckConfiguration("Global_MainUI_AllowAutoUpdate").ToBoolEx())
         {
             return;
         }
         string             version      = ConfigurationHelper.ReadSetting("version");
         List <MyParameter> myParameters = new List <MyParameter>();
         myParameters.Add("@FileInput_Version", DbType.String, version, null);
         List <Sys_FileInput> sys_FileInputs = BaseService.Open <Sys_FileInput>("SystemUpdate_Files", myParameters);
         foreach (Sys_FileInput sys_FileInput in sys_FileInputs.OrderBy(f => f.Create_Time))
         {
             if (sys_FileInput.FileInput_Bytes != null)
             {
                 File.WriteAllBytes(sys_FileInput.FileInput_Relative, sys_FileInput.FileInput_Bytes);
             }
         }
         ConfigurationHelper.SaveSetting("version", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #3
0
 /// <summary>
 /// 显示错误信息,根据系统配置显示错误信息
 /// </summary>
 /// <param name="Error">Exception</param>
 public static void RaiseError(Exception Error)
 {
     if (BaseService.CheckConfiguration("Global_ChildMenu_ThrowException").ToBoolEx())
     {
         throw Error;
     }
     if (BaseService.CheckConfiguration("Global_ChildMenu_ShowErrorDetail").ToBoolEx())
     {
         if (BaseService.CheckConfiguration("Global_ChildMenu_ShowErrorMessageBox").ToBoolEx())
         {
             ShowError(Error.Message, Error.ToJson());
         }
         else
         {
             TipError(Error.Message, Error.ToJson());
         }
     }
     else
     {
         if (BaseService.CheckConfiguration("Global_ChildMenu_ShowErrorMessageBox").ToBoolEx())
         {
             ShowError(Error.Message);
         }
         else
         {
             TipError(Error.Message);
         }
     }
 }
Beispiel #4
0
 /// <summary>
 /// 判断菜单是否已经打开
 /// </summary>
 /// <param name="sys_Menu">系统菜单</param>
 /// <returns>返回布尔值</returns>
 private bool IsMenuOpen(Sys_Menu sys_Menu)
 {
     try
     {
         if (!BaseService.CheckConfiguration("Global_MainUI_MdiTabMenu_CheckDuplicate").ToBoolEx())
         {
             return(false);
         }
         foreach (Form tabPage in this.OwnedForms)
         {
             ChildPage myPage   = (ChildPage)tabPage;
             Sys_Menu  cys_Menu = myPage.SysMenu;
             if (cys_Menu != null && cys_Menu.Menu_Id.Equals(sys_Menu.Menu_Id))
             {
                 tabPage.Show();
                 return(true);
             }
         }
         return(false);
     }
     catch (Exception ex)
     {
         SharedFunc.RaiseError(ex);
         return(false);
     }
     finally
     {
     }
 }
Beispiel #5
0
 /// <summary>
 /// 显示错误信息,根据系统配置显示错误信息
 /// </summary>
 /// <param name="Error">提示文本</param>
 /// <param name="Detail">错误详情</param>
 public static void RaiseError(string Error, string Detail)
 {
     if (BaseService.CheckConfiguration("Global_ChildMenu_ShowErrorMessageBox").ToBoolEx())
     {
         ShowError(Error, Detail);
     }
     else
     {
         TipError(Error, Detail);
     }
 }
Beispiel #6
0
 /// <summary>
 /// 加载配置信息
 /// </summary>
 private void InitializeConfiguration()
 {
     //Global_MainUI_AllowUserSkinMenu
     if (BaseService.CheckConfiguration("Global_MainUI_AllowUserSkinMenu").ToBoolEx())
     {
         barSkin.Visibility = BarItemVisibility.Always;
     }
     else
     {
         barSkin.Visibility = BarItemVisibility.Never;
     }
 }
Beispiel #7
0
 private void InitializePageConfiguration()
 {
     if (BaseService.CheckConfiguration("Global_Query_PageLoad_Open").ToBoolEx())
     {
         Sys_Button sys_Button = ButtonList.Find(b => b.Button_Sub == "Open" && b.Button_Visible && b.Button_Enabled);
         if (sys_Button != null && sys_Button.Button_BarItem != null)
         {
             //BarItem barItem = (BarItem)sys_Button.Button_BarItem;
             //barItem.PerformClick();
             this.Open();
         }
     }
 }
Beispiel #8
0
        /// <summary>
        /// 显示错误消息框
        /// </summary>
        /// <param name="Error">提示文本</param>
        /// <param name="Detail">错误明细详情</param>
        /// <param name="type">错误类型</param>
        public static void ShowError(string Error, string Detail, MessageBoxIcon type = MessageBoxIcon.Error)
        {
            if (BaseService.CheckConfiguration("Global_ChildMenu_ShowErrorDetail").ToBoolEx())
            {
                XtraMessageBox.Show(Detail, Error, MessageBoxButtons.OK, type);
            }
            else
            {
                string ChildMenu_Error = "页面错误";
                if (!string.IsNullOrEmpty(Provider.Get("ChildMenu_Error").ToStringEx()))
                {
                    ChildMenu_Error = Provider.Get("ChildMenu_Error").ToStringEx();
                }
                XtraMessageBox.Show(Error, ChildMenu_Error, MessageBoxButtons.OK, type);
            }
            Sys_Page sys_Page = new Sys_Page();

            if (Provider.SysPage != null)
            {
                sys_Page = Provider.SysPage;
            }
            //BaseService.SaveLog(Error, Detail, (byte)Sys_Log_Type.Information, sys_Page.Menu_Id);
        }
Beispiel #9
0
 private void barMenu_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         MyLeftPanel.Visible      = !MyLeftPanel.Visible;
         splitterControl1.Visible = !splitterControl1.Visible;
         if (BaseService.CheckConfiguration("Global_MainUI_ShowHideMenu_ReloadData").ToBoolEx())
         {
             if (MyLeftPanel.Visible)
             {
                 InitializeMenu();
                 MyTree.DataSource = Provider.UserMenus;
             }
         }
     }
     catch (Exception ex)
     {
         SharedFunc.RaiseError(ex);
     }
     finally
     {
     }
 }