示例#1
0
 public override void execute(List <Activity> historyList)
 {
     if (relActivity is UserChangePageActivity)
     {
         UserChangePageActivity activity = (UserChangePageActivity)relActivity;
         PageAction             pa       = activity.getPageAction();
         int pageNum = activity.getPageNumber();
         storyManager.changePage(pa, pageNum);
     }
     else if (relActivity is InternalSpeechNavigatePageActivity)
     {
         InternalSpeechNavigatePageActivity activity = (InternalSpeechNavigatePageActivity)relActivity;
         PageAction pa      = activity.getPageAction();
         int        pageNum = activity.getPageNumber();
         storyManager.changePage(pa, pageNum);
     }
     else if (relActivity is InternalFinishPageActivity)
     {
         InternalFinishPageActivity activity = (InternalFinishPageActivity)relActivity;
         storyManager.changePage(PageAction.NEXT, 0);
         //AbstractEBookEvent.raise(new FinishPageEvent());
         if (storyManager.getStoryMode() == Mode.RECORD)
         {
             AbstractDeviceManager.executeCommand(new Command(CommandType.LOG_PAGE_END));
         }
     }
 }
示例#2
0
 public __()
 {
     堆垛机管理 = new PageAction()
     {
         ActionId = 1, ActionName = "堆垛机管理"
     };
 }
示例#3
0
        /// <summary>
        /// 根据动作,计算出应该显示的页数
        /// </summary>
        public static int GetPageNow(PageAction action, int pageNow, int pageTotal)
        {
            int pageNum = pageNow;

            if (action.Equals(PageAction.First))
            {
                pageNum = 0;
            }
            else if (action.Equals(PageAction.Last))
            {
                pageNum = pageTotal;
            }
            else if (action.Equals(PageAction.Next))
            {
                pageNum++;
            }
            else if (action.Equals(PageAction.Previous))
            {
                pageNum--;
            }
            else
            {
                pageNum = 1;
            }
            if (pageNum > pageTotal)
            {
                pageNum = pageTotal;
            }
            if (pageNum < 1)
            {
                pageNum = 1;
            }
            return(pageNum);
        }
示例#4
0
        public override bool VerifySearchResultByCriteria(KeyValuePair <string, string> valuePair, SearchCriteria name)
        {
            bool   isDisplayed = false;
            string logMsg      = string.Empty;

            try
            {
                IList <bool> resultsList = new List <bool>();

                PopulateCriteriaByType(SearchCriteria.Title, valuePair.Key);
                ClickBtn_Search();
                //PageAction.WaitForLoading();
                PageAction.WaitForPageReady();
                bool searchResult = GridHelper.VerifyRecordIsDisplayed(ColumnName.Number, valuePair.Value, TableHelper.TableType.Single);
                resultsList.Add(searchResult);

                logMsg = $"Search by Criteria '{SearchCriteria.Title.ToString()}'";
                Report.Info($"{logMsg}  was {(searchResult ? "" : "NOT ")}successful", searchResult);
                TestUtility.AddAssertionToList(searchResult, logMsg);

                ClickBtn_Clear();
                PageAction.WaitForPageReady();

                isDisplayed = resultsList.Contains(false)
                    ? false
                    : true;
            }
            catch (Exception)
            {
                log.Error(logMsg);
            }

            return(isDisplayed);
        }
 public __()
 {
     查看 = new PageAction()
     {
         ActionId = 1
     };
 }
示例#6
0
 public __()
 {
     添加 = new PageAction()
     {
         ActionId = 1, ActionName = "btn_add"
     };
     除 = new PageAction()
     {
         ActionId = 2, ActionName = "Delete"
     };
     修改 = new PageAction()
     {
         ActionId = 3, ActionName = "Edit"
     };
     查询 = new PageAction()
     {
         ActionId = 4, ActionName = "btn_search"
     };
     历史查询 = new PageAction()
     {
         ActionId = 5, ActionName = "btn_history_search"
     };
     导出 = new PageAction()
     {
         ActionId = 6, ActionName = "btnExport"
     };
 }
示例#7
0
        public override PageDefinition Parse(string resourceLocation)
        {
            var result = new PageDefinition();

            var action = new PageAction("GET");

            var moduleDefinitionList = new ModuleDefinitionList();
            var pageParameters = new PageParameterList();

            var viewComponentDefinition = _viewCatalog.Get(typeof(XHtmlView).Name);
            if (viewComponentDefinition == null)
                throw new XrcException(string.Format("View '{0}' not found on catalog.", typeof(XHtmlView).Name));

            var view = new ViewDefinition(viewComponentDefinition, null);
            string propertyName = "Content";
            var viewProperty = viewComponentDefinition.Type.GetProperty(propertyName);
            if (viewProperty == null)
                throw new XrcException(string.Format("Property '{0}' for type '{1}' not found.", propertyName, viewComponentDefinition.Type.FullName));

            XDocument content = _resourceProvider.ResourceToXml(resourceLocation);
            var propertyValue = new XValue(viewProperty.PropertyType, content);

            view.Properties.Add(new XProperty(viewProperty, propertyValue));
            action.Views.Add(view);
            result.Actions.Add(action);

            return result;
        }
示例#8
0
        public void Save_Submit_And_Forward_End_To_End()
        {
            UploadOwnerSubmittal.LogintoSubmittal(UserType.Bhoomi);

            //Enter Name and Title
            var valuePair = UploadOwnerSubmittal.PopulateFields(true);

            //Filter record by Number and Validate for "New" Status
            AddAssertionToList(UploadOwnerSubmittal.VerifySubmittalNumberIsDisplayed(valuePair.Value, false, true), "VerifySubmittalNumberIsDisplayed - ReviseReviewSubmittal");

            //Click on Edit in Revise Review page
            PageAction.WaitForPageReady();
            GridHelper.ClickButtonForRow(Page.TableHelper.TableButton.Edit, string.Empty, false);
            ClickSubmitForward();

            //Filter record by Number and Validate for "In Progress" Status
            AddAssertionToList(UploadOwnerSubmittal.VerifySubmittalNumberIsDisplayed(valuePair.Value, false, false), "VerifySubmittalNumberIsDisplayed - ReviseReviewSubmittal");

            //Click on Edit in Revise Review page
            PageAction.WaitForPageReady();
            GridHelper.ClickButtonForRow(Page.TableHelper.TableButton.Edit, string.Empty, false);
            ClickSubmitForward();

            //Go to RMCenter > Search
            NavigateToPage.RMCenter_Search();
            //Filter record by Number
            AddAssertionToList(UploadOwnerSubmittal.VerifySubmittalNumberIsDisplayed(valuePair.Value, true), "VerifySubmittalNumberIsDisplayed - Search");

            //Validate all assertions
            AssertAll();
        }
示例#9
0
 /*
  * Change page in the story.
  */
 public void changePage(PageAction pa, int pageNum)
 {
     if (pa == PageAction.NEXT)
     {
         Page page = currentStory.GetNextPage();
         if (page != null)
         {
             textProcessor.process(page, storyMode);
         }
     }
     else if (pa == PageAction.PREVIOUS)
     {
         Page page = currentStory.GetPreviousPage();
         if (page != null)
         {
             textProcessor.process(page, storyMode);
         }
     }
     else if (pa == PageAction.GO_PAGE_X)
     {
         Page page = currentStory.GetPage(pageNum);
         if (page != null)
         {
             textProcessor.process(page, storyMode);
         }
     }
 }
示例#10
0
        private void RunConditionAction(PageAction pageAction)
        {
            if (pageAction.ConditoinAction == null || pageAction.ConditoinAction.Count == 0)
            {
                return;
            }

            foreach (IAction action in pageAction.ConditoinAction)
            {
                this.RunAction(action);
            }


            int pageIndex = StringConvertTo.ConvertTo <int>(this.GetData <string>("conditionActions_page_Index"));
            int pageCount = StringConvertTo.ConvertTo <int>(this.GetData <string>("conditionActions_page_Count"));

            if (pageIndex < 1)
            {
                throw new ElementNoFoundException("PageTask No Result", pageAction);
            }
            if (pageCount < 1)
            {
                throw new ElementNoFoundException("PageTask No Result", pageAction);
            }

            int max = pageAction.MaxPageIndex > pageCount ? pageCount : pageAction.MaxPageIndex;

            if (pageIndex < max)
            {
                return;
            }

            throw new ElementNoFoundException("PageTask Element Not Found", pageAction);
        }
示例#11
0
 public __()
 {
     设置部门角色 = new PageAction()
     {
         ActionId = 1, ActionName = "btnSetRole"
     };
 }
        public static void CreatePaginatedMessage(
            ulong userId,
            IUserMessage message,
            int pageCount,
            int initialPage,
            PageAction action,
            int timeout      = 300000,
            Action onTimeout = null
            )
        {
            if (pageCount == 1)
            {
                return;
            }
            message.AddReactionsAsync(
                new[]
            {
                new Emoji(PaginatedMessage.FirstPage), new Emoji(PaginatedMessage.PreviousPage), new Emoji(PaginatedMessage.NextPage),
                new Emoji(PaginatedMessage.LastPage)
            }
                );

            var paginatedMessage = new PaginatedMessage(userId, message, pageCount, initialPage, action);

            ReactionMessageCache.Add(
                message.Id.ToString(),
                paginatedMessage,
                new CacheItemPolicy
            {
                SlidingExpiration = TimeSpan.FromMilliseconds(timeout),
                RemovedCallback   = onTimeout == null ? null : (CacheEntryRemovedCallback)(_ => onTimeout())
            }
                );
        }
示例#13
0
        public __()
        {
            添加 = new PageAction()
            {
                ActionId = 1, ActionName = "btnAdd,btnAddSave"
            };
            查询 = new PageAction()
            {
                ActionId = 2, ActionName = "btnSearch"
            };
            历史查询 = new PageAction()
            {
                ActionId = 3, ActionName = "btnSearchAll"
            };
            导出 = new PageAction()
            {
                ActionId = 4, ActionName = "btnExport"
            };

            除 = new PageAction()
            {
                ActionId = 5, ActionName = "Delete"
            };
            修改 = new PageAction()
            {
                ActionId = 6, ActionName = "Edit,btnModifySave"
            };
            恢复 = new PageAction()
            {
                ActionId = 7, ActionName = "Recover"
            };
        }
        public static void Write(this PageAction action, CSideWriter writer)
        {
            var idLength         = Math.Max(action.ID.ToString().Length, 8);
            var id               = action.ID.ToString().PadRight(idLength);
            var idAndIndentation = string.Format("{0};{1}", id, action.IndentationLevel.ToString());

            writer.Write("{{ {0};", idAndIndentation.PadRight(13));
            writer.Indent(writer.Column);
            writer.WriteLine("Action    ;");
            action.Properties.Write(PropertiesStyle.Field, writer);

            var relevantProperties = action.Properties.Where(p => p.HasValue);
            var lastProperty       = relevantProperties.LastOrDefault();

            if (lastProperty != null)
            {
                if (lastProperty is TriggerProperty)
                {
                    writer.Write(new string(' ', 10));
                }
            }

            writer.WriteLine("}");
            writer.Unindent();
        }
示例#15
0
 public __()
 {
     空出库管理 = new PageAction()
     {
         ActionId = 1, ActionName = "空出库管理"
     };
 }
 public __()
 {
     统计查看 = new PageAction()
     {
         ActionId = 1, ActionName = "btnSearch"
     };
 }
示例#17
0
 public __()
 {
     站台状态维护 = new PageAction()
     {
         ActionId = 1, ActionName = "堆垛机管理"
     };
 }
示例#18
0
 public __()
 {
     订单信息查询 = new PageAction()
     {
         ActionId = 1, ActionName = "订单信息查询"
     };
 }
示例#19
0
 public override void LogintoSubmittal(UserType userType)
 {
     LoginAs(userType);
     PageAction.WaitForPageReady();
     NavigateToPage.RMCenter_Upload_DEV_Submittal();
     TestUtility.AddAssertionToList_VerifyPageHeader("Submittal Details", "LogintoQASubmittal()");
 }
示例#20
0
        public Task <bool> UpdatePage(GenericPage page, PageAction action)
        {
            bool PageAction(GenericPage page)
            {
                using var conn = _conn;

                var command = new SqliteCommand
                {
                    Connection  = conn,
                    CommandText =
                        "UPDATE 'pages_history' SET valid_to = @Now WHERE valid_to = -1 AND id = @Id;\nINSERT INTO 'pages_history' (id, link, content, created, changed, locked, contentType, valid_to, valid_from, action) VALUES (@Id, @Link, @Content, @Created, @Changed, @Locked, @ContentType, -1, @Now, @Action);\nUPDATE 'pages' SET id = @Id, link = @Link, content = @Content, created = @Created, changed = @Changed, locked = @Locked, contentType = @ContentType WHERE id = @Id;"
                };

                command.Parameters.AddWithValue("@Id", page.Id.ToString());
                command.Parameters.AddWithValue("@Link", page.Link);
                command.Parameters.AddWithValue("@Content", page.Content);
                command.Parameters.AddWithValue("@Created", page.Created.ToUnixTimeMilliseconds());
                command.Parameters.AddWithValue("@Changed", _clock.GetCurrentInstant().ToUnixTimeMilliseconds());
                command.Parameters.AddWithValue("@Locked", page.IsLocked);
                command.Parameters.AddWithValue("@ContentType", page.ContentType.Name);
                command.Parameters.AddWithValue("@Now", _clock.GetCurrentInstant().ToUnixTimeMilliseconds());
                command.Parameters.AddWithValue("@Action", action);

                conn.Open();
                var result = command.ExecuteNonQuery();

                return(true);
            }

            return(new TaskFactory <bool>().StartNew((page) => PageAction((GenericPage)page), page));
        }
示例#21
0
        // TODO E' possibile semplificare e irrobustire questo codice?
        // TODO Potrebero esserci problemi di cache e dipendenze? Da ottimizzare in qualche modo?
        public override PageDefinition Parse(string resourceLocation)
        {
            var result = new PageDefinition();

            var action = new PageAction("GET");

            var moduleDefinitionList = new ModuleDefinitionList();
            var pageParameters = new PageParameterList();

            var viewComponentDefinition = _viewCatalog.Get(typeof(XsltView).Name);
            if (viewComponentDefinition == null)
                throw new XrcException(string.Format("View '{0}' not found on catalog.", typeof(XsltView).Name));

            var view = new ViewDefinition(viewComponentDefinition, null);

            XDocument xsltContent = _resourceProvider.ResourceToXml(resourceLocation);
            AddProperty(viewComponentDefinition, view, "Xslt", xsltContent);

            string dataVirtualPath = resourceLocation.Replace(".xrc.xslt", ".xml");
            if (_resourceProvider.ResourceExists(dataVirtualPath))
            {
                AddProperty(viewComponentDefinition, view, "Data", _resourceProvider.ResourceToXml(dataVirtualPath));
            }

            action.Views.Add(view);
            result.Actions.Add(action);

            return result;
        }
示例#22
0
        /// <summary>
        /// 反射页面中的权限
        /// </summary>
        /// <returns>List{SysPageAction}.</returns>
        private List <PageAction> Reflection()
        {
            List <PageAction> lst = new List <PageAction>();
            Type type             = this.GetType();

            #region 属性
            PropertyInfo[] piList = type.GetProperties();
            foreach (PropertyInfo pi in piList)
            {
                if (pi.PropertyType == typeof(PageAction))
                {
                    PageAction m = (PageAction)pi.GetValue(this, null);
                    if (string.IsNullOrWhiteSpace(m.ShowName))
                    {
                        m.ShowName = pi.Name;
                    }
                    m.Permit = 0;
                    lst.Add(m);
                }
            }
            #endregion
            #region 字段
            FieldInfo[] miList = type.GetFields();
            foreach (FieldInfo pi in miList)
            {
                if (pi.FieldType == typeof(PageAction))
                {
                    PageAction m = (PageAction)pi.GetValue(this);
                    if (string.IsNullOrWhiteSpace(m.ShowName))
                    {
                        m.ShowName = pi.Name;
                    }
                    m.Permit = 0;
                    lst.Add(m);
                }
            }
            #endregion
            #region 去除重复的ActionId
            List <PageAction> Result = new List <PageAction>();
            for (int i = lst.Count - 1; i >= 0; i--)
            {
                bool       isExist = false;
                PageAction m       = lst[i];
                foreach (PageAction a in Result)
                {
                    if (m.ActionId == a.ActionId)
                    {
                        isExist = true;
                        break;
                    }
                }
                if (!isExist)
                {
                    Result.Add(m);
                }
            }
            #endregion
            return(Result);
        }
示例#23
0
 /// <summary>
 /// Invoked when this page is about to be displayed in a Frame.
 /// </summary>
 /// <param name="e">Event data that describes how this page was reached.
 /// This parameter is typically used to configure the page.</param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (e.Parameter != null)
     {
         action = PageAction.Update;
     }
     InitializePreview();
 }
 /// <summary>
 /// Invoked when this page is about to be displayed in a Frame.
 /// </summary>
 /// <param name="e">Event data that describes how this page was reached.
 /// This parameter is typically used to configure the page.</param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (e.Parameter != null)
     {
         action = PageAction.Update;
     }
     InitializePreview();
 }
示例#25
0
 /// <summary>
 /// Construtor da classe.
 /// </summary>
 /// <param name="pageName">Nome da página.</param>
 /// <param name="value">Valor de retorno.</param>
 /// <param name="action">Ação da página.</param>
 public PageReturnObject(string pageName
                         , object value
                         , PageAction action)
 {
     m_pageName = pageName;
     m_value    = value;
     m_action   = action;
 }
 /// <summary>
 /// Construtor da classe.
 /// </summary>
 /// <param name="pageName">Nome da página.</param>
 /// <param name="value">Valor de retorno.</param>
 /// <param name="action">Ação da página.</param>
 public PageReturnObject(string pageName
     , object value
     , PageAction action)
 {
     m_pageName = pageName;
     m_value = value;
     m_action = action;
 }
        /// <summary>
        /// Sets action message for a completed turn
        /// </summary>
        private void InitializeZOrder(PageAction pAction)
        {
            var ActionMessage = new PageActionMessage()
            {
                action = pAction
            };

            Messenger.Default.Send <PageActionMessage>(ActionMessage);
        }
示例#28
0
 public virtual IList <string> GetTenantRequiredFieldLocators()
 {
     return(reqFieldLocators = PageAction.GetAttributes(new List <By>()
     {
         By.XPath("//span[contains(text(),'Required')]"),
         By.XPath("//span[contains(text(),'Required')]/parent::span"),
         By.XPath("//span[contains(text(),'You need at least 1 submittal file')]")
     }, "data-valmsg-for"));
 }
示例#29
0
 public __()
 {
     查询信息 = new PageAction()
     {
         ActionId = 1, ActionName = "btnSearch"
     };
     导出 = new PageAction()
     {
         ActionId = 2, ActionName = "btnExport"
     };
 }
示例#30
0
 public __()
 {
     设置角色权限 = new PageAction()
     {
         ActionId = 1, ActionName = "btnSetRole"
     };
     制角色权限 = new PageAction()
     {
         ActionId = 2, ActionName = "btnRoleCopy"
     };
 }
示例#31
0
 public __()
 {
     清空数据库缓存 = new PageAction()
     {
         ActionId = 1, ActionName = "btnSqlCacheClear"
     };
     清空页面配置缓存 = new PageAction()
     {
         ActionId = 2, ActionName = "btnUiCacheClear"
     };
 }
示例#32
0
 public __()
 {
     查询单据信息 = new PageAction()
     {
         ActionId = 1, ActionName = "btnSearch"
     };
     添加单据信息 = new PageAction()
     {
         ActionId = 2, ActionName = "btnAddBill"
     };
 }
示例#33
0
 public __()
 {
     任务添加 = new PageAction()
     {
         ActionId = 1, ActionName = "btnSaveBill"
     };
     任务删除 = new PageAction()
     {
         ActionId = 1, ActionName = "Delete"
     };
 }
示例#34
0
 public __()
 {
     状态查看 = new PageAction()
     {
         ActionId = 1, ActionName = "btnSearch"
     };
     库位禁用 = new PageAction()
     {
         ActionId = 2, ActionName = "btnBinDisable"
     };
 }
 /// <summary>
 /// Populates the page with content passed during navigation.  Any saved state is also
 /// provided when recreating a page from a prior session.
 /// </summary>
 /// <param name="sender">
 /// The source of the event; typically <see cref="NavigationHelper"/>
 /// </param>
 /// <param name="e">Event data that provides both the navigation parameter passed to
 /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
 /// a dictionary of state preserved by this page during an earlier
 /// session.  The state will be null the first time a page is visited.</param>
 private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
     if (e.NavigationParameter != null && e.PageState == null)
     {
         long noteID = (long)e.NavigationParameter;
         viewModel = new EditPhotoNoteViewModel((PhotoNote)photoNoteManager.GetNoteById(noteID));
         Debug.WriteLine(viewModel.ToString());
         action = PageAction.Update;
         if (viewModel.IsNotificationDateVisible)
         {
             SetNotificationSchedulingVisibile(true);
         }
     }
     else
     {
         if (e.PageState != null)
         {
             EditPhotoNoteViewModel editPhotoNoteViewModel = (EditPhotoNoteViewModel)e.PageState[VIEW_MODEL];
             if (editPhotoNoteViewModel != null)
             {
                 viewModel = editPhotoNoteViewModel;
                 e.PageState[VIEW_MODEL] = null;
             }
             if (e.NavigationParameter != null)
             {
                 action = PageAction.Update;
             }
             else
             {
                 action = PageAction.Create;
             }
         }
         else
         {
             viewModel = new EditPhotoNoteViewModel();
         }
     }
     ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
     Object value = localSettings.Values[PhotoNoteManager.PHOTO_PATH_KEY];
     if (value != null)
     {
         Debug.WriteLine(value);
         viewModel.PhotoPath = (string)value;
         localSettings.Values.Remove(PhotoNoteManager.PHOTO_PATH_KEY);
     }
     this.DataContext = viewModel;
 }
 /// <summary>
 /// Populates the page with content passed during navigation.  Any saved state is also
 /// provided when recreating a page from a prior session.
 /// </summary>
 /// <param name="sender">
 /// The source of the event; typically <see cref="NavigationHelper"/>
 /// </param>
 /// <param name="e">Event data that provides both the navigation parameter passed to
 /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
 /// a dictionary of state preserved by this page during an earlier
 /// session.  The state will be null the first time a page is visited.</param>
 private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
     if (e.NavigationParameter != null)
     {
         long noteID = (long)e.NavigationParameter;
         viewModel = new EditTodoNoteViewModel((TodoNote)todoNoteDataHelper.GetNoteById(noteID));
         if (viewModel.IsNotificationDateVisible)
         {
             SetNotificationSchedulingVisibile(true);
         }
         state = PageAction.Update;
     }
     else
     {
         viewModel = new EditTodoNoteViewModel();
         viewModel.AddEntry(EMPTY_STRING, false);
         state = PageAction.Create;
     }
     this.DataContext = viewModel;
     TodoNotesList.DataContext = viewModel.TodoEntries;
 }
示例#37
0
        private void ParseActions(XDocument xdoc, PageDefinition parserResult)
        {
            foreach (var actionElement in xdoc.Root.Elements(ACTION))
            {
                string method = actionElement.AttributeAsOrDefault<string>(METHOD);
                if (method == null)
                    method = DEFAULT_METHOD;
                var action = new PageAction(method);
                if (actionElement.Attribute(LAYOUT) != null)
                    action.Layout = actionElement.AttributeAs<string>(LAYOUT);

                foreach (var subElement in actionElement.Elements())
                {
                    if (subElement.Name.Namespace != XMLNS)
                        continue;

                    if (subElement.Name == OUTPUTCACHE)
                    {
                    }
                    else if (subElement.Name == CATCHEXCEPTION)
                    {
                        var url = subElement.AttributeAsOrDefault<string>(URL);
                        action.CatchException = new PageCatch(url);
                    }
                    else
                    {
                        var view = ParseView(subElement, parserResult);
                        action.Views.Add(view);
                    }
                }

                parserResult.Actions.Add(action);
            }
        }
        private void ShowControl(PageAction pageAction)
        {
            switch (pageAction)
            {
                case PageAction.Default:
                    RadButton_Save.Visible = false;
                    RadButton_ApGia.Visible = true;
                    thongbao.Visible = false;
                    break;
                case PageAction.ApGia:

                    lydo.Focus();
                    RadButton_Save.Visible = true;
                    RadButton_ApGia.Visible = false;
                    RadButton_Back.Visible = true;
                    DanhMuc.Columns[1].Visible = true;
                    DanhMuc.Columns[2].Visible = false;
                    thongTinEdit.Visible = true;
                    TimKiem.Visible = false;

                    //todo: cuonglt 4/21/15
                    int checkNullRadGrid = Grid_LichSu.MasterTableView.Items.Count;
                    if (checkNullRadGrid != 0)
                    {
                        for (int i = 0; i < 5; i++)
                        {
                            Grid_LichSu.MasterTableView.Items[i].Selected = false;
                        }

                    }
                    break;
                case PageAction.Save:
                    lydo.Text = "";
                    DanhMuc.AllowPaging = false;
                    DanhMuc.AllowSorting = false;
                    RadButton_Back.Visible = true;
                    RadButton_Back.Text = "Hủy";
                    RadButton_ApGia.Visible = false;
                    thongbao.Visible = true;

                    break;
                case PageAction.Cancel:
                    this.Grid_LichSu.CurrentPageIndex = 0;
                    RadButton_ApGia.Visible = true;
                    thongbao.Visible = false;
                    DanhMuc.AllowPaging = true;
                    DanhMuc.PageSize = 20;
                    DanhMuc.AllowSorting = true;
                    RadButton_Back.Visible = false;
                    // RadButton_Back.Text = "Quay lại";
                    RadButton_Save.Visible = true;
                    RadButton_Save.Visible = false;
                    thongTinEdit.Visible = false;
                    TimKiem.Visible = true;
                    DanhMuc.Columns[2].Visible = true;
                    DanhMuc.Columns[1].Visible = false;
                    thongTinEdit.Visible = false;
                    thongbao.Visible = false;
                    break;
            }
        }
示例#39
0
        /// <summary>
        /// 根据动作,计算出应该显示的页数
        /// </summary>
        public static int GetPageNow(PageAction action, int pageNow, int pageTotal) 
        {
		    int pageNum = pageNow;
            if (action.Equals(PageAction.First))
            {
			    pageNum = 0;
            }
            else if (action.Equals(PageAction.Last))
            {
			    pageNum = pageTotal;
            }
            else if (action.Equals(PageAction.Next))
            {
			    pageNum++;
            }
            else if (action.Equals(PageAction.Previous))
            {
			    pageNum--;
		    } 
            else 
            {
			    pageNum = 1;
		    }
		    if (pageNum > pageTotal) 
            {
			    pageNum = pageTotal;
		    }
		    if (pageNum < 1) 
            {
			    pageNum = 1;
		    }
		    return pageNum;
	    }
示例#40
0
 private void ShowControl(PageAction pageAction)
 {
     switch (pageAction)
     {
         case PageAction.Default:
             //ẩn nút gì hiện nút gì ở đây
             txt_MaPhieu.Text = "" ;
             txt_MaPin.Text = "";
             break;
         case PageAction.Error:
             pn_KQXN.Visible = true;
             lblThongBao.ForeColor = Color.Red;
             lblThongBao.Text = "Tra cứu không thành công. Quý khách vui lòng nhập đầy đủ thông tin Mã phiếu và Mã pin";
             break;
     }
 }
        /// <summary>
        /// Gets the view model for this <see cref="Page"/>.
        /// This can be changed to a strongly typed view model.
        /// </summary>
        //public ObservableDictionary DefaultViewModel
        //{
        //    get { return this.defaultViewModel; }
        //}

        /// <summary>
        /// Populates the page with content passed during navigation.  Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session.  The state will be null the first time a page is visited.</param>
        private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            if (e.NavigationParameter != null)
            {
                long noteID = (long)e.NavigationParameter;
                viewModel = new EditSimpleNoteDetailViewModel((SimpleNote)simpleNoteManager.GetNoteById(noteID));
                Debug.WriteLine(viewModel.ToString());
                action = PageAction.Update;
                if(viewModel.IsNotificationDateVisible){
                        SetNotificationSchedulingVisibile(true);
                }
            }
            else
            {
                viewModel = new EditSimpleNoteDetailViewModel();
            }
            this.DataContext = viewModel;
        }
 private void ShowControl(PageAction pageAction)
 {
     switch (pageAction)
     {
         case PageAction.Default:
             //ẩn nút gì hiện nút gì ở đây
             rtvCtChung.EnableDragAndDrop = true;
             break;
         case PageAction.AddChild:
             lblThongbao.Text = "";
             lblTrangThaiChucNang.Text = "Chức năng thêm mới loại xét nghiệm <span style='Color: blue;'>nằm trong</span> loại xét nghiệm được chọn";
             ViewState["CaseChucNang"] = "addChild";
             txtTenLXN_add.Text = "";
             pnSearch.Enabled = false;
             pnTree.Enabled = false;
             pnThongTin.Visible = false;
             pnAddChild.Visible = true;
             break;
         case PageAction.AddBefore:
             lblThongbao.Text = "";
             txtTenLXN_add.Text = "";
             lblTrangThaiChucNang.Text = "Chức năng thêm mới loại xét nghiệm <span style='Color: blue;'>ngang hàng và đứng trước</span> loại xét nghiệm được chọn";
             ViewState["CaseChucNang"] = "addBefore";
             pnSearch.Enabled = false;
             pnTree.Enabled = false;
             pnThongTin.Visible = false;
             pnAddChild.Visible = true;
             break;
         case PageAction.AddAffter:
             lblThongbao.Text = "";
             txtTenLXN_add.Text = "";
             lblTrangThaiChucNang.Text = "Chức năng thêm mới loại xét nghiệm <span style='Color: blue;'>ngang hàng và đứng sau</span> loại xét nghiệm được chọn";
             ViewState["CaseChucNang"] = "addAffter";
             pnSearch.Enabled = false;
             pnTree.Enabled = false;
             pnThongTin.Visible = false;
             pnAddChild.Visible = true;
             break;
     }
 }