コード例 #1
0
 private void SystemInfoView_DataContextChanged(object sender, EventArgs e)
 {
     if (DataContext is SystemInfoVM)
     {
         _vm = (SystemInfoVM)DataContext;
         _vm.PropertyChanged += _vm_PropertyChanged;
     }
 }
コード例 #2
0
        public WCFReturnResult Update(WCFAuthInfoVM entity_WCFAuthInfoVM, SystemInfoVM systemInfoVM)
        {
            WCFReturnResult ret = null;

            ret = _client.Update(entity_WCFAuthInfoVM, systemInfoVM);

            return(ret);
        }
コード例 #3
0
        public SystemInfoVM GetSystemInfo(WCFAuthInfoVM entity_WCFAuthInfoVM)
        {
            SystemInfoVM ret = null;

            ret = _client.GetSystemInfo(entity_WCFAuthInfoVM);

            return(ret);
        }
コード例 #4
0
        public ActionResult Edit(SystemInfoVM entity_VM)
        {
            //Message Box Title -- When Error occured, Message Box would be showed.
            string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "SystemInfoManage");

            ModelState.Clear();
            TryValidateModel(entity_VM);

            if (!ErrorMsgHelper.CustomValiation(str_MsgBoxTitle, ModelState, ViewBag))
            {
                return(View(entity_VM));
            }

            string strError = "";

            WCFReturnResult entity_Return = new WCFReturnResult();

            WebCommonHelper webCommonHelper = new WebCommonHelper();

            webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) =>
            {
                entity_Return = systemMgtHelper.Value.Update(entity_WCFAuthInfoVM, entity_VM);
            });

            if (entity_Return != null && entity_Return.StrList_Error.Count() > 0)
            {
                strError = string.Join("<br/>", entity_Return.StrList_Error.ToArray());
            }

            if (entity_Return != null && entity_Return.IsSuccess)
            {
                webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) =>
                {
                    //Update the static content
                    StaticContent.SystemInfoInst = systemMgtHelper.Value.GetSystemInfo(entity_WCFAuthInfoVM);
                });

                MsgInfo successMsgInfo = new MsgInfo();
                successMsgInfo.MsgTitle    = str_MsgBoxTitle;
                successMsgInfo.MsgDesc     = MultilingualHelper.GetStringFromResource(languageKey, "I000");
                successMsgInfo.MsgType     = MessageType.Success;
                TempData[ActionMessageKey] = successMsgInfo;
                return(RedirectToAction("Index"));
            }
            else
            {
                MsgInfo errorMsgInfo = new MsgInfo();
                errorMsgInfo.MsgTitle = str_MsgBoxTitle;
                errorMsgInfo.MsgDesc  = strError;
                errorMsgInfo.MsgType  = MessageType.ValidationError;
                ViewBag.ActionMessage = errorMsgInfo;
                return(View("Index", entity_VM));
            }
        }
コード例 #5
0
 private void SysInfo1dMap_DataContextChanged(object sender, EventArgs e)
 {
     if (DataContext is SystemInfoVM)
     {
         _vm = (SystemInfoVM)DataContext;
         _vm.StarSystems.SelectionChangedEvent += StarSystems_SelectionChangedEvent;
         _vm.Entities.SelectionChangedEvent    += Entities_SelectionChangedEvent;
         _vm.TreeBlobs.SelectionChangedEvent   += TreeBlobs_SelectionChangedEvent;
         Init();
     }
 }
コード例 #6
0
ファイル: SystemInfoCMD.cs プロジェクト: johny5w/Pulsar4x
        protected override void OnExecuted(EventArgs e)
        {
            base.OnExecuted(e);

            SystemInfoVM sysinfoVM = new SystemInfoVM(_gameVM);

            Views.MainWindow mw = (Views.MainWindow)Application.Instance.MainForm.Content;
            var view            = new Views.SystemInfoView();

            view.DataContext = sysinfoVM;
            mw.AddOrSelectTabPanel("System Info", view);
        }
コード例 #7
0
        // GET: AccessControl/SystemInfoManage
        public ActionResult Index()
        {
            //Message Box Title -- When Error occured, Message Box would be showed.
            string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "SystemInfoManage");

            string strError = "";

            SystemInfoVM entity_SystemInfoVM = null;

            WebCommonHelper webCommonHelper = new WebCommonHelper();

            webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) =>
            {
                entity_SystemInfoVM = systemMgtHelper.Value.GetSystemInfo(entity_WCFAuthInfoVM);
            });

            if (entity_SystemInfoVM == null)
            {
                MsgInfo errorMsgInfo = new MsgInfo();
                errorMsgInfo.MsgTitle = str_MsgBoxTitle;
                errorMsgInfo.MsgDesc  = strError;
                errorMsgInfo.MsgType  = MessageType.ValidationError;

                LUserRoleVM selectionCriteria = new LUserRoleVM();

                if (TempData.ContainsKey(SelectionCriteriaKey))
                {
                    selectionCriteria = (LUserRoleVM)TempData[SelectionCriteriaKey];
                }

                TempData[SelectionCriteriaKey] = selectionCriteria;

                TempData[ActionMessageKey] = errorMsgInfo;

                return(View("Index"));
            }
            else
            {
                if (TempData[ActionMessageKey] != null)
                {
                    ViewBag.ActionMessage = TempData[ActionMessageKey];
                }

                return(View(entity_SystemInfoVM));
            }
        }
コード例 #8
0
        public void EditSysInfo()
        {
            systemInfoMgtController.FunTypeKey = "Edit";
            commonFixture.MockControllerInfo(systemInfoMgtController, "http://localhost:50653/AccessControl/SystemInfoManage/Edit");

            WCFAuthInfoVM entity_WCFAuthInfoVM = new WCFAuthInfoVM("", "", commonFixture.StrToken, systemInfoMgtController.FunKey, systemInfoMgtController.FunTypeKey, this.commonFixture.LanguageKey.ToString(), "");

            SystemInfoVM entity_SysInfoVM = systemInfoMgtController.systemMgtHelper.Value.GetSystemInfo(entity_WCFAuthInfoVM);

            entity_SysInfoVM.Password_IncludeDiffCase    = false;
            entity_SysInfoVM.Password_IncludeNumDigit    = false;
            entity_SysInfoVM.Password_IncludeSpecialChar = false;

            ActionResult actionResult = systemInfoMgtController.Edit(entity_SysInfoVM);

            Assert.IsType <RedirectToRouteResult>(actionResult);
        }
コード例 #9
0
        public ActionResult GetCurrentDatetimeAndTotalCount()
        {
            JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
            CurrentInfoVM        entity_CurrentInfoVM = new CurrentInfoVM();
            SystemInfoVM         temp_SystemInfoVM    = (SystemInfoVM)StaticContent.SystemInfoInst;

            entity_CurrentInfoVM.CurrDateTime = DateTime.Now.ToString(temp_SystemInfoVM.DateFormat + " " + temp_SystemInfoVM.TimeFormat);

            //int int_Counter = authorizedHistoryRespo.GetTotalAuthorizationCount(OperationType.L);

            WebCommonHelper webCommonHelper = new WebCommonHelper();

            webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) =>
            {
                int int_Counter = authHisMgtHelper.Value.GetTotalAuthorizationCount(entity_WCFAuthInfoVM);

                entity_CurrentInfoVM.TotalLoginCount = int_Counter.ToString();
            });

            return(Json(javaScriptSerializer.Serialize(entity_CurrentInfoVM)));
        }
コード例 #10
0
        public WCFReturnResult Update(WCFAuthInfoVM entity_WCFAuthInfoVM, SystemInfoVM entity_SysVM)
        {
            try
            {
                //Retrieve Language And Session
                RetrieveLanguageAndSession(entity_WCFAuthInfoVM);



                WCFReturnResult returnResult = new WCFReturnResult();

                CoolPrivilegeControlContext dbContext = CoolPrivilegeControlContext.CreateContext();

                SysParmRespository Respo_SysParm = new SysParmRespository();

                Respo_SysParm.UserId = entity_BaseSession.ID;

                List <string> strList_Error = new List <string>();

                bool ret = false;

                ret = CheckAccPrivilege(entity_BaseSession.ID, entity_WCFAuthInfoVM.RequestFunKey, entity_WCFAuthInfoVM.RequestFunTypeKey, ref strList_Error);

                if (ret)
                {
                    ret = Respo_SysParm.UpdateSystemInfo(entity_SysVM, languageKey, ref strList_Error);
                }

                returnResult.IsSuccess = ret;

                returnResult.StrList_Error = strList_Error;

                return(returnResult);
            }
            catch (Exception ex)
            {
                throw new FaultException <WCFErrorContract>(new WCFErrorContract(ex), ex.Message);
            }
        }
コード例 #11
0
        public SystemInfoVM GetSystemInfo(WCFAuthInfoVM entity_WCFAuthInfoVM)
        {
            try
            {
                //Retrieve Language And Session
                //RetrieveLanguageAndSession(entity_WCFAuthInfoVM);

                //

                //List<string> strList_Error = new List<string>();

                //SysInfoSerEditResult returnResult = new SysInfoSerEditResult();

                CoolPrivilegeControlContext dbContext = CoolPrivilegeControlContext.CreateContext();

                SysParmRespository Respo_SysParm = new SysParmRespository();

                //Respo_SysParm.UserId = entity_BaseSession.ID;

                //bool ret = false;

                //ret = CheckAccPrivilege(entity_BaseSession.ID, entity_WCFAuthInfoVM.RequestFunKey, entity_WCFAuthInfoVM.RequestFunTypeKey, ref strList_Error);

                //if (ret)
                //{
                SystemInfoVM db_SysInfoVM = Respo_SysParm.RetrieveSystemInfo();

                //returnResult.Entity_SystemInfoVM = db_SysInfoVM;
                //}

                //returnResult.StrList_Error = strList_Error;

                return(db_SysInfoVM);
            }
            catch (Exception ex)
            {
                throw new FaultException <WCFErrorContract>(new WCFErrorContract(ex), ex.Message);
            }
        }