Exemple #1
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;
        }
Exemple #2
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));
            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"));
        }
Exemple #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;
 }