コード例 #1
0
        public static void Upadte()
        {
            try
            {
                {
                    //更新中间件
                    IBLL.IUpdate bll = new BLL.UpdateBLL();
                    bll.AutoUpdate();
                }
                {
                    //更新数据库
                    IBLL.ISys bll     = new BLL.Sys();
                    int       ser_ver = Conv.ToInt(bll.Read("ser_ver").Split('_')[1]);
                    int       ver     = Conv.ToInt(Appsetting.versions.Split('_')[1]);
                    if (ser_ver < ver)
                    {
                        //需要更新
                        Type         t     = soft_update.GetType();
                        MethodInfo[] infos = t.GetMethods();
                        foreach (MethodInfo info in infos)
                        {
                            if (info.Name.IndexOf("_") > -1)
                            {
                                int time = Conv.ToInt(info.Name.Split('_')[1]);

                                if (time > ser_ver)
                                {
                                    info.Invoke(soft_update, null);
                                }
                            }
                        }
                    }
                    else if (ser_ver > ver)
                    {
                        //需要更新程序
                        Log.writeLog("中间件版本过低,请更新");
                    }
                }
            }
            catch (Exception ex)
            {
                Log.writeLog("更新失败" + Environment.NewLine + ex.ToString());
            }
        }
コード例 #2
0
ファイル: sys.cs プロジェクト: zanderphh/IvyBack_GuiZhou
        public void Request(string t, string pars, out string res)
        {
            WebHelper w = new WebHelper(pars);

            IBLL.ISys bll = new BLL.Sys();
            try
            {
                if (t == "add")
                {
                    Model.sys_t_system system = w.GetObject <Model.sys_t_system>();
                    bll.add(system);
                    w.WriteSuccess();
                }
                else if (t == "addDic")
                {
                    Dictionary <string, Model.sys_t_system> dic = w.GetDic <Model.sys_t_system>();
                    bll.addDic(dic);
                    w.WriteSuccess();
                }
                else if (t == "update")
                {
                    Model.sys_t_system system = w.GetObject <Model.sys_t_system>();
                    bll.update(system);
                    w.WriteSuccess();
                }
                else if (t == "updateDic")
                {
                    Dictionary <string, Model.sys_t_system> dic = w.GetDic <Model.sys_t_system>();
                    bll.updatedic(dic);
                    w.WriteSuccess();
                }
                else if (t == "GetAll")
                {
                    var tb = bll.GetAll();
                    w.Write(tb);
                    w.WriteSuccess();
                }
                else if (t == "read")
                {
                    ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                    string sys_var_id = r.Read("sys_var_id");
                    string value      = bll.Read(sys_var_id);
                    ReadWriteContext.IWriteContext w2 = new ReadWriteContext.WriteContextByJson();
                    w2.Append("errId", "0");
                    w2.Append("errMsg", "");
                    w2.Append("value", value);

                    res = w2.ToString();
                    return;
                }
                else
                {
                    w.ReflectionMethod(bll, t);
                    res = w.NmJson();
                }

                res = w.NmJson();
            }
            catch (Exception ex)
            {
                w.WriteError(ex);
                res = w.NmJson();
            }
        }
コード例 #3
0
 public string GetServerVer()
 {
     IBLL.ISys bll = new BLL.Sys();
     return(bll.Read("ser_ver"));
 }