예제 #1
0
 private void SinglePatern()
 {
     if (_Instance == null)
     {
         _Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
예제 #2
0
    public static void SaveUser(User_Manager _myUserManager)
    {
        BinaryFormatter _myFormatter = new BinaryFormatter();
        string          path         = Path.Combine(Application.persistentDataPath, "User.GameData");
        FileStream      _myStream    = new FileStream(path, FileMode.Create);

        UserData _myUserData = new UserData();

        _myFormatter.Serialize(_myStream, _myUserData);
        _myStream.Close();
        Debug.Log("Save Succesfully");
    }
예제 #3
0
        public ActionResult EditUser(string id)
        {
            User_Manager man   = new User_Manager();
            var          model = man.GetBySN(Convert.ToInt32(id));

            WebService_Manage service = new WanFang.BLL.WebService_Manage();
            //List<CostInformation> Cost = service.GetALLCostcerter();
            var Dept = service.GetAllDept();

            ViewData["Model"]   = model;
            ViewData["AllDept"] = Dept;
            return(View(model));
        }
예제 #4
0
        public ActionResult UserListing(User_Filter filter, Rest.Core.Paging Page)
        {
            var PermissionCheck = CheckPermission("員工帳號管理");

            if (PermissionCheck != null)
            {
                return(PermissionCheck);
            }

            ViewData["MenuItem"] = 12;
            if (filter.LoginId == "請輸入帳號搜尋")
            {
                filter.LoginId = null;
            }
            ViewData["Filter"] = filter;

            User_Manager man = new User_Manager();

            Rest.Core.Paging page = new Rest.Core.Paging()
            {
            };
            if (Page.CurrentPage > 0)
            {
                page.CurrentPage = Page.CurrentPage;
            }
            List <User_Info> data = man.GetByParameter(filter, page, null, "LoginId");

            //Modify DeptCode To DeptName
            data.ForEach(x =>
            {
                if (x.PermissionType == 0)
                {
                    x.DeptName   = EnumHelper.GetEnumDescription <WS_Dept_type>(EnumHelper.GetEnumByName <WS_Dept_type>(x.DeptName));
                    x.Permission = string.Empty;
                }
                else
                {
                    x.DeptName = string.Empty;
                }
            });

            ViewData["Model"] = data;
            ViewData["Page"]  = page;

            return(View());
        }