Пример #1
0
        /// <summary>
        /// 批量修改泰隆优选大使公告的状态。
        /// </summary>
        /// <param name="sysNos"></param>
        /// <param name="status"></param>
        /// <param name="callback"></param>
        public void BatchUpdateAmbassadorNewsStatus(List <int> sysNos, AmbassadorNewsStatus status, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            AmbassadorNewsBatchInfo batchInfo = new AmbassadorNewsBatchInfo();

            batchInfo.AmbassadorNewsSysNos = sysNos;
            batchInfo.Status      = status;
            batchInfo.CompanyCode = CPApplication.Current.CompanyCode;

            string relativeUrl = "/MKTService/AmbassadorNews/BatchUpdateAmbassadorNewsStatus";

            restClient.Update(relativeUrl, batchInfo, callback);
        }
Пример #2
0
        /// <summary>
        /// 批量修改泰隆优选大使公告状态。
        /// </summary>
        /// <param name="status"></param>
        private void BatchUpdateAmbassadorNewsStatus(AmbassadorNewsStatus status)
        {
            dynamic items = this.DataGrid.ItemsSource as dynamic;

            if (items == null)
            {
                return;
            }

            List <int> sysNos = new List <int>();

            for (int i = 0; i < items.Count; i++)
            {
                dynamic item = items[i];
                if (item.IsChecked)
                {
                    sysNos.Add(item.SysNo);
                }
            }
            if (sysNos.Count > 0)
            {
                if (CurrentFacade != null)
                {
                    CurrentFacade.BatchUpdateAmbassadorNewsStatus(sysNos, status, (s, args) =>
                    {
                        if (args.FaultsHandle())
                        {
                            return;
                        }

                        this.DataGrid.Bind();
                    });
                }
            }
            else
            {
                CPApplication.Current.CurrentPage.Context.Window.MessageBox.Show("没有选择记录", MessageBoxType.Error);
            }
        }