private void SinglePatern() { if (_Instance == null) { _Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
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"); }
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)); }
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()); }