コード例 #1
0
        public AjaxResult <List <MenuShowModel> > LoadMenu(SysManager manager)
        {
            List <MenuShowModel> menus    = new List <MenuShowModel>();
            List <WebSysMenu>    menuList = GetMenus(manager);
            var topMenulist = menuList.Where(m => m.MenuPid == 0).ToList();

            foreach (var item in topMenulist)
            {
                MenuShowModel addItem = new MenuShowModel()
                {
                    id     = Encrypt.MD5Encrypt16(item.MenuId.ToString("0000000000")),
                    icon   = "fa fa-" + item.MenuIcon,
                    isOpen = false,
                    text   = item.MenuName,
                };
                addItem.children = new List <MenuShowModel>();
                var cList = menuList.Where(m => m.MenuPid == item.MenuId).ToList();
                foreach (var itemc in cList)
                {
                    MenuShowModel addC = new MenuShowModel()
                    {
                        id         = Encrypt.MD5Encrypt16(itemc.MenuId.ToString("0000000000")),
                        icon       = "fa fa-circle",
                        targetType = "iframe-tab",
                        text       = itemc.MenuName,
                        url        = itemc.MenuUrl
                    };
                    addItem.children.Add(addC);
                }
                menus.Add(addItem);
            }
            return(new AjaxResult <List <MenuShowModel> >(menus));
        }
コード例 #2
0
ファイル: KeyConfig.cs プロジェクト: onart/JustAA
 // Update is called once per frame
 void Update()
 {
     if (selected != -1)
     {
         if (Input.anyKeyDown)
         {
             if (Input.inputString.Length != 0)
             {
                 SysManager.DictUpdate(SysManager.keys[selected], (KeyCode)(Input.inputString[0]));
             }
             else
             {//사실 이걸로 해도 최적화에는 큰 영향이 없긴 한데 아 몰라
                 foreach (var k in klist)
                 {
                     if (Input.GetKeyDown(k))
                     {
                         SysManager.DictUpdate(SysManager.keys[selected], k);
                         break;
                     }
                 }
             }
             labels[selected].SetText(SysManager.keys[selected] + ": " + SysManager.keymap[SysManager.keys[selected]]);
             CancelSelect();
         }
     }
 }
コード例 #3
0
        /// <summary>
        /// 获取账户相关权限页面
        /// </summary>
        /// <param name="sysUser"></param>
        /// <returns></returns>
        public List <WebSysMenuPage> GetAuthPages(SysManager sysUser)
        {
            List <WebSysMenuPage> autoPages = new List <WebSysMenuPage>();

            if (sysUser.IsSupper != 1)
            {
                var roleIds = db.WebSysManagerRole.Where(m => m.ManagerId == sysUser.ManagerId).Select(m => m.RoleId).Distinct().ToList();
                List <WebSysRoleMenu> roleMenus = db.WebSysRoleMenu.Where(m => roleIds.Contains(m.RoleId)).ToList();
                List <int>            pageIds   = new List <int>();
                foreach (var item in roleMenus)
                {
                    if (string.IsNullOrEmpty(item.PageIds))
                    {
                        continue;
                    }
                    string[] pageidArr = item.PageIds.Split(',');
                    foreach (var pageid in pageidArr)
                    {
                        int ipageId = int.Parse(pageid);
                        if (!pageIds.Contains(ipageId))
                        {
                            pageIds.Add(int.Parse(pageid));
                        }
                    }
                }
                autoPages = db.WebSysMenuPage.Where(m => pageIds.Contains(m.PageId)).ToList();
            }
            else
            {
                autoPages = db.WebSysMenuPage.ToList();
            }
            return(autoPages);
        }
コード例 #4
0
 private void OnPrintPorfolio()
 {
     if (SysManager != null)
     {
         SysManager.PrintPortfolio();
     }
 }
コード例 #5
0
        private bool AuthorizeCheck(ActionExecutingContext filterContext, SysManager user, bool isAjax)
        {
            if (user.IsSupper == 1)
            {
                return(true);
            }
            var CurAuthPages = AdminUser.CurAuthPages;

            string ActionName     = filterContext.ActionDescriptor.ActionName;
            string ControllerName = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName;
            string thisUrl        = string.Format("/{0}/{1}", ControllerName, ActionName).ToLower();
            var    autoPage       = CurAuthPages.FirstOrDefault(m => m.PageUrl.ToLower() == thisUrl);

            if (autoPage == null)
            {
                if (isAjax)
                {
                    JsonResult jr = new JsonResult();
                    jr.Data = new AjaxResult("你无访问权限" + thisUrl);
                    jr.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
                    filterContext.Result   = jr;
                }
                else
                {
                    filterContext.RequestContext.HttpContext.Response.Write("你无访问权限" + thisUrl);
                    filterContext.RequestContext.HttpContext.Response.End();
                }
                return(false);
            }
            return(true);
        }
コード例 #6
0
        private bool AuthorizeCheck(ActionExecutingContext filterContext, SysManager user, bool isAjax)
        {
            if (user.IsSupper == 1)
            {
                return(true);
            }
            var CurAuthPages = User.CurAuthPages;

            var route = filterContext.ActionDescriptor.RouteValues;

            route.TryGetValue("controller", out string ControllerName);
            route.TryGetValue("action", out string ActionName);

            string thisUrl  = string.Format("/{0}/{1}", ControllerName, ActionName).ToLower();
            var    autoPage = CurAuthPages.FirstOrDefault(m => m.PageUrl.ToLower() == thisUrl);

            if (autoPage == null)
            {
                if (isAjax)
                {
                    JsonResult jr = new JsonResult(new AjaxResult <Object>("你无访问权限" + thisUrl));
                    filterContext.Result = jr;
                }
                else
                {
                    filterContext.HttpContext.Response.WriteAsync("你无访问权限" + thisUrl).Wait();
                    // filterContext.HttpContext.Abort();
                }
                return(false);
            }
            return(true);
        }
コード例 #7
0
    //protected string strdate = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["userCode"] == null || Session["userCode"].ToString().Trim() == "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "window.location.href='../Login.aspx','_self';", true);
            return;
        }
        if (!IsPostBack)
        {
            //strdate = DateTime.Now.ToString("yyyy-MM-dd");
            SysManager sysMgr = new SysManager();
            txtBillCode.Text = sysMgr.GetYbbxBillName("", DateTime.Now.ToString("yyyMMdd"), 1);
            string strType = Request.QueryString["type"];
            if (Page.Request.QueryString["djtype"] == null)
            {
                this.hd_djtype.Value = "ybbx";
                hfdydj.Value         = "02";
                this.lbdjmc.Text     = "费用报销单→表头信息";
            }
            else
            {
                this.hd_djtype.Value = Page.Request.QueryString["djtype"].ToString().Trim();
                this.lbdjmc.Text     = "其他报销单";
                hfdydj.Value         = "02";
            }


            IList <Bill_DataDic> list = (new SysManager()).GetDicByType("02");
            ddlBxmxlx.DataSource     = list;
            ddlBxmxlx.DataTextField  = "DicName";
            ddlBxmxlx.DataValueField = "DicCode";
            ddlBxmxlx.DataBind();

            //2014-04-28 beg
            if (!string.IsNullOrEmpty(Request["dydj"]) && Request["dydj"] == "sr")
            {
                this.hd_djtype.Value    = Page.Request.QueryString["dydj"].ToString().Trim();
                this.lbdjmc.Text        = "收入单";
                ddlBxmxlx.SelectedValue = "04";
            }
            //2014-04-28 end

            //2014-04-29 beg
            if (!string.IsNullOrEmpty(Request["dydj"]) && Request["dydj"] == "gdzcgz")
            {
                this.hd_djtype.Value    = Page.Request.QueryString["dydj"].ToString().Trim();
                hfdydj.Value            = "03";
                this.lbdjmc.Text        = "固定资产购置单";
                ddlBxmxlx.SelectedValue = "05";
            }
            //2014-04-29 end


            txtBillDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
            txtZdr.Text      = server.GetCellValue("select '['+usercode+']'+userName  from bill_users where userCode='" + Session["userCode"] + "'");
            txtBillDept.Text = server.GetCellValue("select '['+a.deptCode+']'+a.deptName  as dept from bill_departments a,bill_users b where a.deptCode=b.userDept and b.userCode='" + Session["userCode"] + "'");
            BindGk();
        }
    }
コード例 #8
0
        private void RecordLog(ActionExecutingContext filterContext, SysManager user)
        {
            var Request = filterContext.RequestContext.HttpContext.Request;

            //StringBuilder sb = new StringBuilder();
            //sb.Append("============================================================ \r\n");
            //sb.Append(string.Format("请求时间:{0:yyyy-MM-dd HH:mm:ss.fff}\r\n", DateTime.Now));
            //sb.Append("操作人:" + CurAccount.ManagerName + "\r\n");
            //sb.Append("用户ID:" + CurAccount.ManagerId + "\r\n");
            //sb.Append("请求参数:\r\n" + GetRequestString() + "\r\n");
            //LogFileTool.WriteLog(string.Format("Log/Request/{0}/{1}/", ControllerName, ActionName), sb.ToString());
            try
            {
                SQLiteParameter URL        = new SQLiteParameter("URL", Request.Url.ToString());
                SQLiteParameter UserInfo   = new SQLiteParameter("UserInfo", Newtonsoft.Json.JsonConvert.SerializeObject(user));
                SQLiteParameter CreateTime = new SQLiteParameter("CreateTime", DateTime.Now);
                SQLiteParameter IP         = new SQLiteParameter("IP", MvcApplication.GetIP());
                if (Request.QueryString.AllKeys.Length > 0 || Request.Form.AllKeys.Length > 0)
                {
                    var vv = "Request.QueryString\r\n";
                    foreach (var key in Request.QueryString.AllKeys)
                    {
                        vv += key + ":" + Request.QueryString[key] + "\r\n";
                    }
                    vv += "Request.Form\r\n";
                    foreach (var key in Request.Form.AllKeys)
                    {
                        vv += key + ":" + Request.Form[key] + "\r\n";
                    }
                    vv += "Request.Headers\r\n";
                    foreach (var key in Request.Headers.AllKeys)
                    {
                        if (key == "Cookie")
                        {
                            continue;
                        }
                        vv += key + ":" + Request.Headers[key] + "\r\n";
                    }
                    SQLiteParameter Param = new SQLiteParameter("Param", vv);
                    var             c     = SqliteAdoSessionManager.Current;
                    var             vvc   = c.OperLogsDB.CreateSQLiteCommand(@"INSERT INTO OperLogs (
                             URL,
                             Param,
                             UserInfo,
                             CreateTime,
                             IP
                         )
                         VALUES (
                             @URL,
                             @Param,
                             @UserInfo,
                             @CreateTime,
                             @IP
                         );", new SQLiteParameter[] { URL, Param, UserInfo, CreateTime, IP });
                    c.OperLogsDB.ExecuteNonQuery(vvc);
                }
            }
            catch { }
        }
コード例 #9
0
ファイル: FormMain.cs プロジェクト: ckbcjj/jxcar
 public static void closeMyCom(SysManager sm)
 {
     if ((sm != null) && sm.comm._serialPort.IsOpen)
     {
         sm.comm.closePort();
         sm.comm = null;
     }
 }
コード例 #10
0
    private void Awake()
    {
        _instance       = this;
        displayLeftBtn  = displayLeft.GetComponent <Button>();
        displayRightBtn = displayRight.GetComponent <Button>();

        filePath = Application.dataPath + "/StreamingAssets/";
    }
コード例 #11
0
ファイル: FormMain.cs プロジェクト: ckbcjj/jxcar
 private void barLargeButtonItem3_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (((this.SwitchModuleSM == null) && (ServerSystemInfo.SerialComInfoList != null)) && (ServerSystemInfo.SerialComInfoList.Count != 0))
     {
         SerialComConfig config = (from t in ServerSystemInfo.SerialComInfoList
                                   where t.SerialComType == 1
                                   select t).FirstOrDefault <SerialComConfig>();
         if (config != null)
         {
             this.SwitchModuleSM = new SysManager(config.SerialComInfo.Key, config.SerialComInfo.Value);
         }
     }
     if (ServerSystemInfo.ModuleId == ServerSystemInfo.SoftModuleId)
     {
         CMessageInfo.ShowMessage("该模块已连接!", "模块切换", 1);
         if ((this.client != null) && (this.buffer != null))
         {
             PaidComm.SendBack(this.client, this.buffer, 0);
         }
     }
     else if (CheckInfo.PcCheckState)
     {
         CMessageInfo.ShowMessage("学生机考核进行中,无法操作!", "模块切换", 1);
     }
     else if (CheckInfo.PaidCheckState)
     {
         CMessageInfo.ShowMessage("平板用户考核进行中,无法操作!", "模块切换", 1);
     }
     else
     {
         string msg = string.Empty;
         if (this.SwitchModuleSM.ConnectModule(int.Parse(this._dr["Id"].ToString())))
         {
             ServerSystemInfo.ModuleName   = this._dr["ModuleName"].ToString();
             ServerSystemInfo.ModuleIdBuff = int.Parse(this._dr["Id"].ToString());
             CMessageInfo.ShowMessage("模块切换成功!", "模块切换", 1);
             if ((this.client != null) && (this.buffer != null))
             {
                 PaidComm.SendBack(this.client, this.buffer, 0);
             }
             SysManager.ModuleId = ServerSystemInfo.ModuleId;
             SysManager.ResetFaultPoint();
             msg = string.Format("切换模块[{0}]成功", ServerSystemInfo.ModuleName);
         }
         else
         {
             CMessageInfo.ShowMessage("模块连接失败,请重试!", "模块切换", 1);
             msg = string.Format("切换模块[{0}]失败", this._dr["ModuleName"].ToString());
             if ((this.client != null) && (this.buffer != null))
             {
                 PaidComm.SendBack(this.client, this.buffer, 1);
             }
         }
         this.da.WriteLog(LoginInfo.UserName, msg);
     }
 }
コード例 #12
0
        public void InspectionInit()
        {
            lock (ratioLock)
            {
                int ratioTotal = 0;
                if (InspectionratioHash != null)
                {
                    InspectionratioHash.Clear();
                }
                if (allocatedInspectionMenHash != null)
                {
                    allocatedInspectionMenHash.Clear();
                }

                string  sql = "select * from WH_User_WorkRatio where WorkType=" + (int)AppEnum.WhWorkType.ProductInspection + "and BillType=" + (int)AppEnum.WhWorkBillType.SO;
                DataSet ds  = SqlHelper.ExecuteDataSet(sql);
                if (!Util.HasMoreRow(ds))
                {
                    return;
                }

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    ratioTotal += Util.TrimIntNull(dr["Ratio"]);
                    if (!allocatedInspectionMenHash.ContainsKey(Util.TrimIntNull(dr["UserSysNo"])))
                    {
                        UserInfo user = SysManager.GetInstance().LoadUser(Util.TrimIntNull(dr["UserSysNo"]));
                        allocatedInspectionMenHash.Add(Util.TrimIntNull(dr["UserSysno"]), user);
                    }
                }

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    WHUserWorkRatioInfo item = new WHUserWorkRatioInfo();
                    map(item, dr);
                    if (InspectionratioHash == null)
                    {
                        InspectionratioHash = new Hashtable(5);
                    }
                    for (int i = 0; i < item.Ratio; i++)
                    {
                        bool found = false;
                        do
                        {
                            System.Random oRandom = new System.Random(RandomString.GetNewSeed());
                            int           tempkey = oRandom.Next(ratioTotal);
                            if (!InspectionratioHash.ContainsKey(tempkey))
                            {
                                found = true;
                                InspectionratioHash.Add(tempkey, item.UserSysNo);
                            }
                        } while (!found);
                    }
                }
            }
        }
コード例 #13
0
        public void Init()
        {
            lock (ratioLock)
            {
                int ratioTotal = 0;
                if (ratioHash != null)
                {
                    ratioHash.Clear();
                }
                if (allocatedMenHash != null)
                {
                    allocatedMenHash.Clear();
                }

                string  sql = "select * from SO_User_AuditRatio";
                DataSet ds  = SqlHelper.ExecuteDataSet(sql);
                if (!Util.HasMoreRow(ds))
                {
                    return;
                }

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    ratioTotal += Util.TrimIntNull(dr["Ratio"]);
                    if (!allocatedMenHash.ContainsKey(Util.TrimIntNull(dr["UserSysNo"])))
                    {
                        UserInfo user = SysManager.GetInstance().LoadUser(Util.TrimIntNull(dr["UserSysNo"]));
                        allocatedMenHash.Add(Util.TrimIntNull(dr["UserSysno"]), user);
                    }
                }

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    SOUserAuditRatioInfo item = new SOUserAuditRatioInfo();
                    map(item, dr);
                    if (ratioHash == null)
                    {
                        ratioHash = new Hashtable(5);
                    }
                    for (int i = 0; i < item.Ratio; i++)
                    {
                        bool found = false;
                        do
                        {
                            System.Random oRandom = new System.Random(RandomString.GetNewSeed());
                            int           tempkey = oRandom.Next(ratioTotal);
                            if (!ratioHash.ContainsKey(tempkey))
                            {
                                found = true;
                                ratioHash.Add(tempkey, item.UserSysNo);
                            }
                        } while (!found);
                    }
                }
            }
        }
コード例 #14
0
        private void EnterOnlineMode()
        {
            SelectedSetup.Online = true;
            SelectedSetup.Basket = BasketCollection.Where(i => i.Capital > 0).ToList();

            SysManager.CreateTasks(SelectedSetup);

            UpdateSetupAtDatabase(SelectedSetup);
            OnSave();
        }
コード例 #15
0
        public List <WebSysMenu> GetManagerMenus(SysManager manager)
        {
            //获取角色ID集合
            var roleIds = db.WebSysManagerRole.Where(m => m.ManagerId == manager.ManagerId).Select(m => m.RoleId).Distinct().ToList();
            //获取菜单ID集合
            List <int> menuIds = db.WebSysRoleMenu.Where(m => roleIds.Contains(m.RoleId)).Select(m => m.MenuId ?? 0).Distinct().ToList();

            //获取菜单
            return(db.WebSysMenu.Where(m => menuIds.Contains(m.MenuId) && m.MenuStatus == 1).OrderByDescending(m => m.MenuSort).ToList());
        }
コード例 #16
0
 /// <summary>
 /// 获取菜单
 /// </summary>
 /// <param name="manager"></param>
 /// <returns></returns>
 public List <WebSysMenu> GetMenus(SysManager manager)
 {
     if (manager.IsSupper == 1)
     {
         return(GetAllMenus());
     }
     else
     {
         return(GetManagerMenus(manager));
     }
 }
コード例 #17
0
 public void Init()
 {
     //数据库配置
     DataAccessConfig.Configure();
     //标识符生成配置
     SysManager.ConfigureIdentityKey();
     //对象映射转换配置
     ObjectMapConfig.Configure();
     //领域事件配置
     DomainEventConfig.Configure();
     //仓储事件配置
     RepositoryEventConfig.Configure();
 }
コード例 #18
0
        private async void OnOptimization()
        {
            if (!User.IsDeveloper())
            {
                return;
            }

            SelectedSetup.Online         = true;
            SysManager.OptimizationSetup = SelectedSetup;
            await SysManager.OfflineTrading(SelectedSetup);

            try
            {
                await Task.Factory.StartNew(() => SysManager.GetData(SelectedSetup)).ContinueWith(async _ =>
                {
                    try
                    {
                        var ga        = new GA(SysManager, UpdateProgress, 2, 0.8, 0.1, 100, 10, 0.0001);
                        ga.InputGenes = SysManager.GetGenes();
                        await ga.Go();

                        double[] bestGenes; double bestFitness;
                        ga.GetBest(out bestGenes, out bestFitness);

                        var file = DateTime.Now.ToString("yyMMddHHmm") + ".csv";
                        File.WriteAllText(Roaming + @"\Otimização\" + file, Log);
                        Log = TimeTag + "Resultado da otimização no ficheiro " + file + ". Pressione F4 para abrir sua localização.\r\n\r\n" +
                              TimeTag + "Final/Best: " + bestFitness + "\r\n" +
                              SysManager.SetGenes(bestGenes).ToString() + "\r\n" + Log;

                        SysManager.OptimizationSetup.Online = false;
                        SelectedSetup.Online = false;
                    }
                    catch (Exception ex)
                    {
                        SelectedSetup.Online = false;
                        Log      = TimeTag + ex.Message + "\r\n" + Log;
                        var file = DateTime.Now.ToString("yyMMddHHmm") + ".csv";
                        File.WriteAllText(Roaming + @"\Otimização\" + file, Log);
                    }
                });
            }
            catch (Exception e)
            {
                SelectedSetup.Online = false;
                Log = TimeTag + e.Message + "\r\n" + Log;
                var file = DateTime.Now.ToString("yyMMddHHmm") + ".csv";
                File.WriteAllText(Roaming + @"\Otimização\" + file, Log);
            }
        }
コード例 #19
0
        private void Switch()
        {
            SysManager.PreOnlineTrading();

            if (SelectedSetup.Online)
            {
                ExitOnlineMode();
            }
            else
            {
                EnterOnlineMode();
            }

            RaisePropertyChanged(() => TradingButton);
        }
コード例 #20
0
        /// <summary>
        /// 获取ro发票
        /// </summary>
        /// <param name="roSysNo"></param>
        /// <returns></returns>
        public ROInvoiceInfo GetROInvoice(int roSysNo)
        {
            ROInvoiceInfo invoice = new ROInvoiceInfo();
            ROInfo        ro      = this.LoadRO(roSysNo);
            RMAInfo       rma     = RMAManager.GetInstance().Load(ro.RMASysNo);
            SOInfo        so      = SaleManager.GetInstance().LoadSO(rma.SOSysNo);
            IcsonInfo     son     = new IcsonInfo();

            invoice.AuditUserSysNo = ro.AuditUserSysNo;
            invoice.CompanyAddress = son.CompanyAddress;
            invoice.InvoiceNote    = so.InvoiceNote;
            invoice.SOID           = so.SOID;
            PayTypeInfo ptInfo = ASPManager.GetInstance().LoadPayType(so.PayTypeSysNo);

            invoice.PayTypeName    = ptInfo.PayTypeName;
            invoice.ReceiveAddress = ro.ReceiveAddress;
            CustomerInfo customer = CustomerManager.GetInstance().Load(so.CustomerSysNo);

            invoice.CustomerName  = customer.CustomerName;
            invoice.CustomerSysNo = customer.SysNo;
            invoice.ReceiveName   = ro.ReceiveName;
            invoice.ReceivePhone  = ro.ReceivePhone;
            invoice.ROID          = ro.ROID;
            invoice.ROSysNo       = ro.SysNo;
            ShipTypeInfo stInfo = ASPManager.GetInstance().LoadShipType(so.ShipTypeSysNo);

            invoice.ShipTypeName = stInfo.ShipTypeName;
            UserInfo employee = SysManager.GetInstance().LoadUser(so.OutUserSysNo);

            if (employee != null)
            {
                invoice.WarehouseUserCode = employee.UserID;
            }
            else
            {
                invoice.WarehouseUserCode = "";
            }
            this.InitPageList(ro, invoice);
            invoice.TotalPage   = invoice.ItemHash.Count;
            invoice.TotalWeight = ro.GetTotalWeight();
            return(invoice);
        }
コード例 #21
0
 /// <summary>
 /// 初始化模块配置
 /// </summary>
 /// <param name="autoMapperConfiguration">Automapper configuration</param>
 public static void Init(ref Action <IMapperConfigurationExpression> autoMapperConfiguration)
 {
     //对象转换
     if (autoMapperConfiguration == null)
     {
         autoMapperConfiguration = ObjectMapConfig.Configure;
     }
     else
     {
         autoMapperConfiguration += ObjectMapConfig.Configure;
     }
     //仓储配置
     RepositoryConfig.Init();
     //标识符生成配置
     SysManager.ConfigureIdentityKey();
     //领域事件配置
     DomainEventConfig.Init();
     //数据库配置
     DatabaseConfig.Init();
 }
コード例 #22
0
 private void barLargeButtonItem10_ItemClick(object sender, ItemClickEventArgs e)
 {
     if ((ServerSystemInfo.ModuleId != ServerSystemInfo.SoftModuleId) || (ServerSystemInfo.SysPattern != 1))
     {
         CMessageInfo.ShowMessage("请先连接当前要操作的系统模块并且将软件运行模式设置为实训考核模式", "考核发题", 2);
     }
     else if (CheckInfo.PcCheckState)
     {
         MessageBox.Show("学生机考核进行中,不能操作");
     }
     else
     {
         ServerSystemInfo.dic = new Dictionary <int, string>();
         foreach (DataRow row in ((DataTable)this.gridControl1.DataSource).Rows)
         {
             if (row[0].ToString() == "True")
             {
                 string str = row["PointState"].ToString();
                 string.Compare(row["NormalIsBreak"].ToString(), "False", true);
                 if ((string.IsNullOrEmpty(str) || (str == "清除故障失败")) || ((str == "读取状态失败") || (str == "设置故障失败")))
                 {
                     CMessageInfo.ShowMessage("请先设置故障,再发题", "考核发题", 1);
                     return;
                 }
                 ServerSystemInfo.dic.Add(int.Parse(row[1].ToString()), str);
             }
         }
         int           num = (ServerSystemInfo.Counts == 0) ? this.dt.Rows.Count : ServerSystemInfo.Counts;
         SendCheckItem msg = new SendCheckItem {
             ItemList   = ServerSystemInfo.dic,
             ScorePoint = ServerSystemInfo.ScorePoint,
             Counts     = num,
             Time       = ServerSystemInfo.PcTimeCount,
             Memo       = ServerSystemInfo.Memo
         };
         SysManager.SentToClient(TcpService.clientPool, LoginInfo.StudyNO, SocketInfoType.CheckItem, msg);
         CheckInfo.PcCheckState = true;
         CheckInfo.PcCheckTime  = DateTime.Now;
         CMessageInfo.ShowMessage("发题成功", "考核发题", 1);
     }
 }
コード例 #23
0
 private async void OnBacktest()
 {
     SelectedSetup.Online = true;
     await Task.Factory.StartNew(async() =>
     {
         try
         {
             await SysManager.OfflineTrading(SelectedSetup);
         }
         catch (Exception e)
         {
             Log = TimeTag + e.Message + "\r\n" + Log;
         }
         finally
         {
             SelectedSetup.Online = false;
             UpdateSetupAtDatabase(SelectedSetup);
             OnSave();
         }
     });
 }
コード例 #24
0
    public void Save(Scene s, int caller)
    {
        mapName = s.name;

        List <char> c = new List <char> {
            'ㄴ', 'ㅁ', 'ㅊ', 'ㅎ', 'ㅇ', 'ㄱ', 'ㅈ', 'ㅍ'
        };

        //ㄴ(난이도), ㅁ(맵) ㅊ(최대HP), ㅎ(현재HP), ㅇ(저장장치 위치), ㄱ(경험치), ㅈ(매직넘버), ㅍ(플래그)
        writer = new BinaryWriter(File.Open("save.onladv", FileMode.Create));
        while (c.Count != 0)
        {
            int rd = Random.Range(0, c.Count);
            PartSave(c[rd], caller);
            c.RemoveAt(rd);
        }
        writer.Close();

        SysManager.KeyMapSave();
        PlayerPrefs.Save();
    }
コード例 #25
0
        private static void Main(string[] args)
        {
            User user = (User)SysData.Login("admin", "123");

            user.DisplayInfo();
            SysManager admin   = (SysManager)user;
            Teacher    teacher = new Teacher("李沙沙", "123", "计算机系", 5000);

            admin.insertTeacher(ref teacher);
            Student student = new Student("张郭郭", "123", "310760", 60);

            admin.insertStudent(ref student);

            user = (User)SysData.Login("李沙沙", "123");
            user.DisplayInfo();

            user = (User)SysData.Login("张郭郭", "123");
            user.DisplayInfo();

            Console.ReadKey();
        }
コード例 #26
0
        private void barLargeButtonItem6_ItemClick(object sender, ItemClickEventArgs e)
        {
            MapLocation location = new MapLocation();

            if (ServerSystemInfo.ModuleId == ServerSystemInfo.SoftModuleId)
            {
                foreach (DataRow row in ((DataTable)this.gridControl1.DataSource).Rows)
                {
                    if (row[0].ToString() == "True")
                    {
                        bool flag            = string.Compare(row["NormalIsBreak"].ToString(), "False", true) != 0;
                        int  moduleId        = ServerSystemInfo.ModuleId;
                        int  faultPointState = SysManager.GetFaultPointState(int.Parse(row[1].ToString().Trim()));
                        if (faultPointState == 90)
                        {
                            row["PointState"] = "读取状态失败";
                        }
                        else
                        {
                            int num = location.CoderToData(faultPointState);
                            row["PointState"] = this.table.Select(" orderid=" + num).First <DataRow>()["ordername"].ToString();
                            if (((row["PointState"].ToString() == "通路") && !flag) || ((row["PointState"].ToString() == "断路") && flag))
                            {
                                row["IsNormal"] = "正常";
                            }
                            else
                            {
                                row["IsNormal"] = "有故障";
                            }
                        }
                        this.gridControl1.RefreshDataSource();
                    }
                }
            }
            else
            {
                MessageBox.Show("对不起,您要操作的模块和接入的模块不一致。请接入该系统模块后再尝试");
            }
        }
コード例 #27
0
ファイル: AuthorityGroup.cs プロジェクト: Jafic/Demo.Core3.0
 /// <summary>
 /// 生成角色编号
 /// </summary>
 /// <returns></returns>
 public static long GenerateAuthorityGroupId()
 {
     return(SysManager.GetId(SysModuleObject.AuthorityGroup));
 }
コード例 #28
0
ファイル: Permission.cs プロジェクト: eznew-net/Demo.Core2.2
 /// <summary>
 /// 初始化对象标识值
 /// </summary>
 public override void InitIdentityValue()
 {
     Id = SysManager.GetId(SysModuleObject.Permission);
 }
コード例 #29
0
 /// <summary>
 /// 生成操作分组对象编号
 /// </summary>
 /// <returns>返回操作分组编号</returns>
 public static long GenerateOperationGroupId()
 {
     return(SysManager.GetId(SysModuleObject.OperationGroup));
 }
コード例 #30
0
ファイル: User.cs プロジェクト: Jafic/Demo.Core3.0
 /// <summary>
 /// 生成用户编号
 /// </summary>
 /// <returns></returns>
 public static long GenerateUserId()
 {
     return(SysManager.GetId(SysModuleObject.User));
 }