Ejemplo n.º 1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            sys_SystemInfoTable st = FrameSystemInfo.GetSystemInfoTable;

            st.DB_Option_Action_ = "Update";

            sys_ConfigDataTable dt = new sys_ConfigDataTable();

            dt.C_RequestLog              = Convert.ToBoolean((string)Common.sink(ddl_C_RequestLog.UniqueID, MethodType.Post, 5, 1, DataType.Str));
            dt.C_UpImgHeight             = (int)Common.sink(tb_C_UpImgHeight.UniqueID, MethodType.Post, 255, 1, DataType.Int);
            dt.C_UpImgWidth              = (int)Common.sink(tb_C_UpImgWidth.UniqueID, MethodType.Post, 255, 1, DataType.Int);
            dt.C_IPLookUrl               = (string)Common.sink(tb_C_IPLookUrl.UniqueID, MethodType.Post, 255, 1, DataType.Str);
            dt.C_UploadFileExt           = (string)Common.sink(tb_C_UploadFileExt.UniqueID, MethodType.Post, 255, 1, DataType.Str);
            dt.C_UploadSizeKb            = (int)Common.sink(tb_C_UploadSizeKb.UniqueID, MethodType.Post, 255, 1, DataType.Int);
            dt.C_LoginErrorDisableMinute = (int)Common.sink(tb_C_LoginErrorDisableMinute.UniqueID, MethodType.Post, 255, 1, DataType.Int);
            dt.C_LoginErrorMaxNum        = (int)Common.sink(tb_C_LoginErrorMaxNum.UniqueID, MethodType.Post, 255, 1, DataType.Int);
            dt.C_HttpGZip    = Convert.ToBoolean((string)Common.sink(ddl_C_HttpGZip.UniqueID, MethodType.Post, 5, 1, DataType.Str));
            dt.C_UploadPath  = (string)Common.sink(tb_C_UploadPath.UniqueID, MethodType.Post, 255, 1, DataType.Str);
            dt.C_CheckUpdate = Convert.ToBoolean((string)Common.sink(ddl_C_CheckUpdate.UniqueID, MethodType.Post, 5, 1, DataType.Str));
            dt.C_DisableIp   = (string)Common.sink(tb_C_DisableIp.UniqueID, MethodType.Post, 2000, 0, DataType.Str);

            dt.C_Enable_Ldap = Convert.ToBoolean((string)Common.sink(ddl_C_Enable_Ldap.UniqueID, MethodType.Post, 5, 1, DataType.Str));
            dt.C_Ldap_Path   = (string)Common.sink(tb_C_Ldap_Path.UniqueID, MethodType.Post, 200, 0, DataType.Str);
            dt.C_Ldap_Domain = (string)Common.sink(tb_C_Ldap_Domain.UniqueID, MethodType.Post, 200, 0, DataType.Str);



            st.S_Name    = (string)Common.sink(tb_S_Name.UniqueID, MethodType.Post, 255, 1, DataType.Str);
            st.S_Version = (string)Common.sink(tb_S_Version.UniqueID, MethodType.Post, 20, 1, DataType.Str);


            st.S_SystemConfigData = dt;
            BusinessFacade.sys_SystemInfoInsertUpdate(st);
            EventMessage.MessageBox(1, "修改环境配置", "修改环境配置成功!", Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx"));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 反序列化字节为sys_ConfigDataTable类
        /// </summary>
        /// <param name="BytArray">字节流</param>
        /// <returns>sys_ConfigDataTable类</returns>
        public static sys_ConfigDataTable Deserialize_sys_ConfigDataTable(byte[] BytArray)
        {
            IFormatter   formatter = new BinaryFormatter();
            MemoryStream ms        = new MemoryStream();

            ms.Write(BytArray, 0, BytArray.Length);
            ms.Position = 0;
            sys_ConfigDataTable it = formatter.Deserialize(ms) as sys_ConfigDataTable;

            return(it);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 序列化sys_ConfigDataTable类
        /// </summary>
        /// <param name="it">sys_ConfigDataTable类</param>
        /// <returns>byte[]字节流</returns>
        public static byte[] Serializable_sys_ConfigDataTable(sys_ConfigDataTable it)
        {
            IFormatter   formatter = new BinaryFormatter();
            MemoryStream ms        = new MemoryStream();

            byte[] b;
            formatter.Serialize(ms, it);
            ms.Position = 0;
            b           = new byte[ms.Length];
            ms.Read(b, 0, b.Length);
            ms.Close();
            return(b);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 构造函数
        /// </summary>
        static FrameSystemInfo()
        {
            if (GetSystemInfoTable == null)
            {
                sys_SystemInfoTable si = new sys_SystemInfoTable();
                QueryParam          qp = new QueryParam();
                qp.PageIndex = 1;
                qp.PageSize  = 1;
                qp.OrderType = 0;
                int Recount = 0;

                ArrayList lst = BusinessFacade.sys_SystemInfoList(qp, out Recount);
                if (Recount == 0)
                {
                    si.DB_Option_Action_ = "Insert";
                    si.SystemID          = BusinessFacade.sys_SystemInfoInsertUpdate(si);
                }
                else
                {
                    si = lst[0] as sys_SystemInfoTable;
                    //更新新加配置
                    sys_ConfigDataTable sys_ConfigDB = si.S_SystemConfigData;
                    sys_ConfigDataTable sys_Config   = new sys_ConfigDataTable();
                    //foreach (PropertyInfo pi in new sys_ConfigDataTable().GetType().GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
                    foreach (PropertyInfo pi in sys_ConfigDB.GetType().GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
                    {
                        if (pi.GetValue(sys_ConfigDB, null) == null)
                        {
                            pi.SetValue(sys_ConfigDB, pi.GetValue(sys_Config, null), null);
                        }
                    }

                    //从Dll中更新版本
                    //sys_FrameWorkInfoTable sys_Db = si.S_FrameWorkInfo;
                    //sys_FrameWorkInfoTable sys_Dll = new sys_FrameWorkInfoTable();
                    //foreach (PropertyInfo pi in sys_Db.GetType().GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
                    //{
                    //    if (pi.Name != "S_Licensed")
                    //    {
                    //        pi.SetValue(sys_Db, pi.GetValue(sys_Dll, null), null);
                    //    }
                    //}
                }
                GetSystemInfoTable = si;
            }
            FrameWorkPermission.InitStat = true;
        }
Ejemplo n.º 5
0
        private void SetValue()
        {
            sys_ConfigDataTable dt = FrameSystemInfo.GetSystemInfoTable.S_SystemConfigData;

            tb_S_Name.Text                    = lb_S_Name.Text = FrameSystemInfo.GetSystemInfoTable.S_Name;
            tb_S_Version.Text                 = lb_S_Version.Text = FrameSystemInfo.GetSystemInfoTable.S_Version;
            tb_C_UpImgHeight.Text             = lb_C_UpImgHeight.Text = dt.C_UpImgHeight.ToString();
            tb_C_UpImgWidth.Text              = lb_C_UpImgWidth.Text = dt.C_UpImgWidth.ToString();
            lb_C_RequestLog.Text              = ddl_C_RequestLog.SelectedValue = dt.C_RequestLog.ToString();
            tb_C_IPLookUrl.Text               = lb_C_IPLookUrl.Text = dt.C_IPLookUrl.ToString();
            tb_C_UploadFileExt.Text           = lb_C_UploadFileExt.Text = dt.C_UploadFileExt.ToString();
            tb_C_UploadSizeKb.Text            = lb_C_UploadSizeKb.Text = dt.C_UploadSizeKb.ToString();
            tb_C_LoginErrorDisableMinute.Text = lb_C_LoginErrorDisableMinute.Text = dt.C_LoginErrorDisableMinute.ToString();
            tb_C_LoginErrorMaxNum.Text        = lb_C_LoginErrorMaxNum.Text = dt.C_LoginErrorMaxNum.ToString();
            lb_C_HttpGZip.Text                = ddl_C_HttpGZip.SelectedValue = dt.C_HttpGZip.ToString();
            lb_C_UploadPath.Text              = tb_C_UploadPath.Text = dt.C_UploadPath;
            lb_C_CheckUpdate.Text             = ddl_C_CheckUpdate.SelectedValue = dt.C_CheckUpdate.ToString();
            tb_C_DisableIp.Text               = dt.C_DisableIp;
            lb_C_DisableIp.Text               = Common.FormatTextArea(dt.C_DisableIp);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 检测登陆
        /// </summary>
        /// <param name="username">用户名</param>
        /// <param name="password">密码</param>
        /// <returns>是否登陆成功</returns>
        public bool checkLogin(string username, string password)
        {
            try
            {
                sys_ConfigDataTable dt = FrameSystemInfo.GetSystemInfoTable.S_SystemConfigData;
                if (!dt.C_Enable_Ldap)
                {
                    return(false);
                }
                string strUserName = string.Format("{0}@{1}", username, dt.C_Ldap_Domain);// username + "@xxx.com.cn";

                DirectoryEntry dir = new DirectoryEntry(dt.C_Ldap_Path, strUserName, password);

                int intCount = dir.Properties.Count;
            }
            catch (Exception ex)
            {
                FileTxtLogs.WriteLog(ex.ToString());
                return(false);
            }
            return(true);
        }