コード例 #1
0
 public static bool CreateProductConsultInfo(AddProductConsultInfoViewModel request)
 {
     if (request.ProductSysNo <= 0)
     {
         throw new BusinessException("商品编号不能为空!");
     }
     if (string.IsNullOrEmpty(request.Content))
     {
         throw new BusinessException("咨询内容不能为空!");
     }
     if (string.IsNullOrEmpty(request.Type))
     {
         throw new BusinessException("咨询类型不能为空!");
     }
     return(ConsultationFacade.CreateProductConsult(EntityConverter <AddProductConsultInfoViewModel, ConsultationInfo> .Convert(request)));
 }
コード例 #2
0
ファイル: GiftCardFacade.cs プロジェクト: sanlonezhang/ql
        public void GetGiftVoucherProductRelationRequest(int sysno, Action <List <GiftVoucherProductRelationReqVM> > callback)
        {
            string relativeUrl = string.Format("/IMService/GiftCardInfo/GetGiftVoucherProductRelationRequest/{0}", sysno);

            restClient.Query <List <GiftVoucherProductRelationRequest> >(relativeUrl, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }

                List <GiftVoucherProductRelationReqVM> vmList = EntityConverter <List <GiftVoucherProductRelationRequest>, List <GiftVoucherProductRelationReqVM> > .Convert(args.Result);

                callback(vmList);
            });
        }
コード例 #3
0
        public void ConvertWithMappingCollection()
        {
            List <Customer> customers = GetCustomers();

            PropertyMappings collection = new PropertyMappings();

            collection.Add("Telephone", "Phone");

            EntityConverter <Customer, Contact> converter = new EntityConverter <Customer, Contact>(collection);
            IList <Contact> contacts = converter.Convert(customers);

            Assert.AreEqual(100, contacts.Count);
            Assert.AreEqual("TestCustomer1", contacts[0].Name);
            Assert.AreEqual("TestAddress1", contacts[0].Address);
            Assert.AreEqual("555-1212", contacts[0].Phone);
        }
コード例 #4
0
        /// <summary>
        /// 虚库单 - 批量审核同意
        /// </summary>
        /// <param name="viewVMList"></param>
        /// <param name="callback"></param>
        public void BatchApproveVirtualRequest(List <VirtualRequestVM> viewVMList, Action <string> callback)
        {
            string relativeUrl = "/InventoryService/VirtualRequest/BatchApproveVirtualRequest";

            var infoList = EntityConverter <List <VirtualRequestVM>, List <VirtualRequestInfo> > .Convert(viewVMList);

            restClient.Update <string>(relativeUrl, infoList, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }

                callback(args.Result);
            });
        }
コード例 #5
0
        public static CheckOutResultModel MappingCheckOutResult(CheckOutResult result)
        {
            CheckOutResultModel model = EntityConverter <CheckOutResult, CheckOutResultModel> .Convert(result, "Item");

            if (model != null)
            {
                //model.PayTypeList = (model.PayTypeList != null && model.PayTypeList.Count > 0) ? model.PayTypeList.FindAll(item => item.PayTypeID == 111) : null;
                if (result != null && result.OrderProcessResult != null)
                {
                    model.ReturnData = MappingOrderInfo(result.OrderProcessResult.ReturnData, "Order");
                    model.ReturnData.ShipTypeName = (model.ShipTypeList != null && model.ShipTypeList.Count > 0) ? model.ShipTypeList.FindAll(item => item.ShipTypeID == model.ReturnData.ShipTypeID).ElementAt(0).ShipTypeName : null;
                }
            }

            return(model);
        }
コード例 #6
0
        private void hpladdProduct_Click(object sender, RoutedEventArgs e)
        {
            UCProductSearch uc = new UCProductSearch();

            uc.SelectionMode = SelectionMode.Multiple;
            //uc.ProductC3SysNo = _c3SysNo;

            IDialog dialog = Window.ShowDialog("添加商品", uc, (obj, args) =>
            {
                if (args.DialogResult == DialogResultType.OK)
                {
                    List <ProductVM> products = args.Data as List <ProductVM>;
                    if (products != null && products.Count > 0)
                    {
                        products.ForEach(p =>
                        {
                            GiftVoucherProductRelationVM temp = this._voucherProductVM.RelationProducts.FirstOrDefault(item =>
                            {
                                return(item.ProductSysNo == p.SysNo);
                            });

                            if (temp == null)
                            {
                                GiftVoucherProductRelationVM vm = EntityConverter <ProductVM, GiftVoucherProductRelationVM> .Convert(p, (s, t) =>
                                {
                                    t.ProductSysNo  = s.SysNo.Value;
                                    t.ProductStatus = s.Status;
                                    t.SysNo         = null;
                                });
                                vm.IsChecked = false;
                                vm.Type      = GVRReqType.Add;
                                vm.SaleInWeb = true;
                                _voucherProductVM.RelationProducts.Add(vm);
                            }
                            else
                            {
                                Window.Alert(string.Format("已存在编号为{0}的商品.", p.ProductID));
                            }
                        });

                        this.productgd.ItemsSource = this._voucherProductVM.RelationProducts;
                    }
                }
            });

            uc.DialogHandler = dialog;
        }
コード例 #7
0
        private void LoaPORefundDetailInfo()
        {
            serviceFacade.LoadVendorRefundInfo(RefundSysNo, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                this.viewVM      = EntityConverter <VendorRefundInfo, VendorRefundInfoVM> .Convert(args.Result);
                this.DataContext = viewVM;
                this.gridRefundProductsList.Bind();

                //权限判断:PM,PMD,PMCC
                isPM   = viewVM.UserRole == "PM";
                isPMD  = AuthMgr.HasFunctionPoint(AuthKeyConst.PO_VendorRefund_PMDVerify);
                isPMCC = AuthMgr.HasFunctionPoint(AuthKeyConst.PO_VendorRefund_PMCCVerify);
                if (isPMD)
                {
                    viewVM.UserRole = "PMD";
                }
                else if (isPMCC)
                {
                    viewVM.UserRole = "PMCC";
                }

                #region [验证权限角色]
                if (viewVM.NotPMAndPMD == true && !isPMD && !isPMCC)
                {
                    this.lblAlertText.Text        = "您不是当前产品的PM,也不是当前产品PM的备份PM,无法审核!";
                    this.btnUpdate.IsEnabled      = false;
                    this.btnAuditPassed.IsEnabled = false;
                    this.btnAuditDenied.IsEnabled = false;
                    return;
                }
                if (!isPM && !isPMD && !isPMCC)
                {
                    this.lblAlertText.Text        = " 你既不是PM,也不是PMD,无法进行任何操作 !";
                    this.btnUpdate.IsEnabled      = false;
                    this.btnAuditPassed.IsEnabled = false;
                    this.btnAuditDenied.IsEnabled = false;
                    return;
                }
                #endregion

                HideActionButtons();
            });
        }
コード例 #8
0
ファイル: DeductQuery.xaml.cs プロジェクト: sanlonezhang/ql
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            //构造查询条件
            //扣款名称
            string name = this.txtName.Text.Trim();

            if (name.Length > 200)
            {
                return;
            }

            deductQueryVM.Name = this.txtName.Text.Trim();
            //构造查询条件
            this.queryRequest = EntityConverter <DeductQueryVM, DeductQueryFilter> .Convert(deductQueryVM);

            QueryResultGrid.Bind();
        }
コード例 #9
0
        private void btnDeleteSettledProducts_Click(object sender, RoutedEventArgs e)
        {
            //删除结算商品:
            List <GatherSettlementItemInfoVM> getItemVM = this.SettledProductsGrid.ItemsSource as List <GatherSettlementItemInfoVM>;

            if (null != getItemVM)
            {
                GatherSettlementInfoVM updateVM = new GatherSettlementInfoVM();
                updateVM = EntityConverter <GatherSettlementInfoVM, GatherSettlementInfoVM> .Convert(GetherInfoVM);

                updateVM.GatherSettlementItemInfoList.Clear();
                getItemVM.ForEach(delegate(GatherSettlementItemInfoVM vm)
                {
                    if (vm.IsDeleteChecked)
                    {
                        updateVM.GatherSettlementItemInfoList.Add(vm);
                    }
                });
                if (0 >= updateVM.GatherSettlementItemInfoList.Count)
                {
                    Window.Alert(ResGatherMaintain.AlertMsg_Delete);
                    return;
                }

                Window.Confirm(ResGatherMaintain.AlertMsg_AlertTitle, ResGatherMaintain.AlertMsg_Save, (obj, args) =>
                {
                    if (args.DialogResult == DialogResultType.OK)
                    {
                        serviceFacade.UpdateGatherSettlementInfo(BuildEntity(updateVM), (obj2, args2) =>
                        {
                            if (args2.FaultsHandle())
                            {
                                return;
                            }
                            AlertAndRefreshPage(ResGatherMaintain.AlertMsg_SaveSuc);
                        });
                    }
                });
            }
            else
            {
                Window.Alert(ResGatherMaintain.AlertMsg_Delete);
                return;
            }
        }
コード例 #10
0
ファイル: SOQueryFacade.cs プロジェクト: sanlonezhang/ql
        public void QuerySO(SOQueryVM queryVM, Action <List <SOQueryDataVM>, int> action)//EventHandler<RestClientEventArgs<List<SOQueryDataVM>>> handler
        {
            SORequestQueryFilter filter = queryVM == null ? null : EntityConverter <SOQueryVM, SORequestQueryFilter> .Convert(queryVM);

            restClient.QueryDynamicData("/SOService/SO/Query", filter, (sender, e) =>
            {
                if (!e.FaultsHandle())
                {
                    if (e.Result != null && action != null)
                    {
                        List <SOQueryDataVM> dataVMList = DynamicConverter <SOQueryDataVM> .ConvertToVMList(e.Result.Rows);
                        action(dataVMList, e.Result.TotalCount);
                    }
                }
            });

            //restClient.Update("/SOService/SO/Job/ProcessFinishedAndInvalidGroupBuySO", null, (a, b) => { b.FaultsHandle(); });
        }
コード例 #11
0
        public void ConvertWithNullableIntToNotNullableIntProperty()
        {
            CustomerNullableInt customer = new CustomerNullableInt
            {
                Address     = "Address1",
                City        = "City1",
                Name        = "Name1",
                State       = "State1",
                Telephone   = "Telephone1",
                TerritoryId = 0,
                ZipCode     = 12345
            };

            EntityConverter <CustomerNullableInt, ContactNotNullableInt> converter = new EntityConverter <CustomerNullableInt, ContactNotNullableInt>((cu, co) => co.Phone = cu.Telephone);
            ContactNotNullableInt contact = converter.Convert(customer);

            Assert.IsNotNull(contact);
        }
コード例 #12
0
ファイル: DeductQuery.xaml.cs プロジェクト: sanlonezhang/ql
        private void QueryResultGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e)
        {
            var queryRequest = EntityConverter <DeductQueryVM, DeductQueryFilter> .Convert(deductQueryVM);

            queryRequest.PageInfo = new PagingInfo()
            {
                PageSize  = QueryResultGrid.PageSize,
                PageIndex = QueryResultGrid.PageIndex,
                SortBy    = e.SortField
            };
            deductFacade.QueryDeducts(queryRequest, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                var deductList             = args.Result.Rows;
                int totalCount             = args.Result.TotalCount;
                QueryResultGrid.TotalCount = totalCount;

                //作废扣款项只能查看
                foreach (var item in deductList)
                {
                    bool edtiVisibility    = false;
                    bool abandonVisibility = true;
                    bool viewVisibility    = false;
                    if (item.Status == Status.Effective)
                    {
                        edtiVisibility    = true;
                        abandonVisibility = true;
                        viewVisibility    = false;
                    }
                    else
                    {
                        abandonVisibility = false;
                        viewVisibility    = true;
                    }
                    item.ViewButtonVisibility    = viewVisibility;
                    item.AbandonButtonVisibility = abandonVisibility;
                    item.EditButtonVisibility    = edtiVisibility;
                }
                QueryResultGrid.ItemsSource = deductList;
            });
        }
コード例 #13
0
        private void BindCommissionItems()
        {
            //加载佣金信息:
            serviceFacade.GetCommissionInfoBySysNo(CommissionSysNo, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                this.masterVM    = EntityConverter <CommissionMaster, CommissionMasterVM> .Convert(args.Result);
                this.DataContext = masterVM;
                if (null != this.masterVM.ItemList)
                {
                    this.masterVM.ItemList.ForEach(x =>
                    {
                        if (x.SaleRule != null)
                        {
                            x.SaleRuleDisplayString = string.Format(ResCommissionItemView.Label_SaleRuleDisplayString, x.SaleRule.MinCommissionAmt.Value.ToString("f2"));
                            x.SaleRule.StagedSaleRuleItems.ForEach(j =>
                            {
                                if (j.StartAmt == 0.00m && j.EndAmt == 0.00m)
                                {
                                    x.SaleRuleDisplayString += "\r\n" + string.Format(ResCommissionItemView.Label_SaleRuleDisplayString2, j.Percentage.Value.ToString("f2"));
                                }
                                else if (j.StartAmt == 0.00m)
                                {
                                    x.SaleRuleDisplayString += "\r\n" + string.Format(ResCommissionItemView.Label_SaleRuleDisplayString3, j.EndAmt.Value.ToString("f2"), j.Percentage.Value.ToString("f2"));
                                }
                                else if (j.EndAmt == 0.00m)
                                {
                                    x.SaleRuleDisplayString += "\r\n" + string.Format(ResCommissionItemView.Label_SaleRuleDisplayString4, j.StartAmt.Value.ToString("f2"), j.Percentage.Value.ToString("f2"));
                                }
                                else
                                {
                                    x.SaleRuleDisplayString += "\r\n" + string.Format(ResCommissionItemView.Label_SaleRuleDisplayString5, j.StartAmt.Value.ToString("f2"), j.EndAmt.Value.ToString("f2"), j.Percentage.Value.ToString("f2"));
                                }
                            });
                        }
                    });
                }

                BindItemGrid();
            });
        }
コード例 #14
0
        public void AddLog(CustomerVisitMaintainView view, System.Action action)
        {
            string relativeUrl = "/CustomerService/Visit/AddLog";

            view.Log.CompanyCode = CPApplication.Current.CompanyCode;
            VisitLog log = EntityConverter <VisitLogVM, VisitLog> .Convert(view.Log);

            restClient.Create <VisitLog>(relativeUrl, log, (sender, e) =>
            {
                if (e.FaultsHandle())
                {
                    return;
                }
                if (action != null)
                {
                    action();
                }
            });
        }
コード例 #15
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (!ValidationManager.Validate(this))
            {
                return;
            }
            if (string.IsNullOrEmpty(newVM.SettleSysNo))
            {
                Window.Alert("请先匹配可调整的结算单!");
                return;
            }

            ConsignAdjustInfo Info = EntityConverter <ConsignAdjustVM, ConsignAdjustInfo> .Convert(newVM);

            if (Info.ItemList.Count == 0)
            {
                Window.Alert("请至少添加一条扣款项信息");
                return;
            }
            Info.TotalAmt = Info.ItemList.Sum(p => p.DeductAmt);
            serviceFacade.Add(Info, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                if (args.Result.SysNo > 0)
                {
                    Window.Alert(ResConsignAdjustNew.Msg_Title, ResConsignAdjustNew.Msg_CreateSuc, MessageType.Information, (objj, argss) =>
                    {
                        if (argss.DialogResult == DialogResultType.Cancel)
                        {
                            Window.Navigate(string.Format("/ECCentral.Portal.UI.PO/ConsignAdjustMaintain/{0}", args.Result.SysNo), true);
                        }
                    });
                }
                else
                {
                    Window.Alert(ResConsignAdjustNew.Msg_CreateFailed);
                    return;
                }
            });
        }
コード例 #16
0
        public void ConvertWithDefaultValueForToEntityProperty()
        {
            CustomerNullableInt customer = new CustomerNullableInt
            {
                Address     = "Address1",
                City        = "City1",
                Name        = "Name1",
                State       = null,
                Telephone   = "555-1212",
                TerritoryId = 0,
                ZipCode     = 12345
            };

            EntityConverter <CustomerNullableInt, ContactNullableInt> converter = new EntityConverter <CustomerNullableInt, ContactNullableInt>((cu, co) => co.Phone = cu.Telephone);
            ContactNullableInt contact = converter.Convert(customer);

            Assert.IsNotNull(contact);
            Assert.AreEqual("WA", contact.State);
        }
コード例 #17
0
 public void GetVisitOrderByCustomerSysNo(int customerSysNo, System.Action <List <VisitOrderVM> > action)
 {
     if (customerSysNo > 0)
     {
         string relativeUrl = string.Format("/CustomerService/Visit/LoadSoSysNo/{0}/{1}", customerSysNo, CPApplication.Current.CompanyCode);
         restClient.Query <List <VisitOrder> >(relativeUrl, (obj, args) =>
         {
             if (args.FaultsHandle())
             {
                 return;
             }
             List <VisitOrderVM> vm = EntityConverter <List <VisitOrder>, List <VisitOrderVM> > .Convert(args.Result);
             if (action != null)
             {
                 action(vm);
             }
         });
     }
 }
コード例 #18
0
ファイル: StoreManager.cs プロジェクト: sanlonezhang/ql
        /// <summary>
        /// 获得商铺前台类别
        /// </summary>
        /// <param name="sellerSysNo"></param>
        /// <returns></returns>
        public List <FrontProductCategoryInfoModel> GetFrontProductCategoryByVendorSysNo(int sellerSysNo)
        {
            List <FrontProductCategoryInfo>      category = ProductFacade.GetFrontProductCategoryByVendorSysNo(sellerSysNo);
            List <FrontProductCategoryInfoModel> List     = EntityConverter <List <FrontProductCategoryInfo>, List <FrontProductCategoryInfoModel> > .Convert(category);

            List.ForEach(p1 =>
            {
                p1.N = (ConstValue.Product_SINGLE_STORECATE_DMSID_SEED + p1.SysNo).ToString();
                p1.Children.ForEach(p2 =>
                {
                    p2.N = (ConstValue.Product_SINGLE_STORECATE_DMSID_SEED + p2.SysNo).ToString();
                    p2.Children.ForEach(p3 =>
                    {
                        p3.N = (ConstValue.Product_SINGLE_STORECATE_DMSID_SEED + p3.SysNo).ToString();
                    });
                });
            });
            return(List);
        }
コード例 #19
0
        public void ProductMaintainBasicEntryInfo_Loaded(showbutton showProductEntryButton)
        {
            vm      = new ProductEntryInfoVM();
            facades = new ProductEntryFacade(CPApplication.Current.CurrentPage);
            string tempSysNo = string.Empty;

            if (CurrentPage.Context.Request.QueryString != null)
            {
                tempSysNo = CurrentPage.Context.Request.QueryString["ProductSysNo"];
            }
            if (!string.IsNullOrEmpty(CurrentPage.Context.Request.Param))
            {
                tempSysNo = CurrentPage.Context.Request.Param;
            }
            int productSysNo;

            if (Int32.TryParse(tempSysNo, out productSysNo))
            {
                facades.LoadProductEntryInfo(productSysNo, (obj, args) =>
                {
                    if (args.Result == null)
                    {
                        CPApplication.Current.CurrentPage.Context.Window.Alert("商品信息错误!");
                        return;
                    }

                    vm = EntityConverter <ProductEntryInfo, ProductEntryInfoVM> .Convert(
                        args.Result,
                        (s, t) =>
                        { });
                    EntryBizcmb.SelectedIndex  = 0;
                    StoreTypecmb.SelectedIndex = 0;
                    showProductEntryButton();
                    this.DataContext = vm;
                });
            }
            else
            {
                StoreTypecmb.SelectedIndex = 0;
                EntryBizcmb.SelectedIndex  = 0;
                this.DataContext           = vm;
            }
        }
コード例 #20
0
        public static ProductReviewListViewModel GetProductReviewList(int productSysNo, int productGroupSysNo, List <ReviewScoreType> searchType, int pageIndex, int pageSize)
        {
            Product_ReviewQueryInfo queryInfo = new Product_ReviewQueryInfo()
            {
                ProductSysNo = productSysNo, ProductGroupSysNo = productGroupSysNo, SearchType = searchType, PagingInfo = new PageInfo()
                {
                    PageSize = pageSize, PageIndex = pageIndex
                }
            };


            var originReviewResult = ReviewFacade.GetProductReviewListByProductGroupSysNoForProduct(queryInfo);
            var result             = EntityConverter <Product_ReviewList, ProductReviewListViewModel> .Convert(originReviewResult, (s, t) =>
            {
                t.ProductReviewDetailList.PageIndex       = s.ProductReviewDetailList.PageNumber - 1;
                t.ProductReviewDetailList.PageSize        = s.ProductReviewDetailList.PageSize;
                t.ProductReviewDetailList.TotalRecords    = s.ProductReviewDetailList.TotalRecords;
                t.ProductReviewDetailList.CurrentPageData = EntityConverter <List <Product_ReviewDetail>, List <ProductReviewDetailItemViewModel> > .Convert(s.ProductReviewDetailList.CurrentPageData);
                t.TotalCount1 = s.TotalCount1 + s.TotalCount2;
                t.TotalCount3 = s.TotalCount3 + s.TotalCount4;


                if (t.ProductReviewDetailList != null && t.ProductReviewDetailList.CurrentPageData != null && t.ProductReviewDetailList.CurrentPageData.Count > 0)
                {
                    for (int i = 0; i < t.ProductReviewDetailList.CurrentPageData.Count; i++)
                    {
                        t.ProductReviewDetailList.CurrentPageData[i].NickName = s.ProductReviewDetailList.CurrentPageData[i].CustomerInfo.NickName;
                    }
                }

                t.ProductReviewDetailList.PageIndex    = pageIndex - 1;
                t.ProductReviewDetailList.PageSize     = pageSize;
                t.ProductReviewDetailList.TotalRecords = searchType.Contains(ReviewScoreType.ScoreType11) ? t.TotalCount1 : (searchType.Contains(ReviewScoreType.ScoreType13) ? t.TotalCount3 : (searchType.Contains(ReviewScoreType.ScoreType15) ? t.TotalCount5 : t.TotalCount1));
                t.ProductReviewDetailList.TotalPages   = t.ProductReviewDetailList.TotalRecords <= 0 ? 0 : (t.ProductReviewDetailList.TotalRecords % t.ProductReviewDetailList.PageSize == 0 ? t.ProductReviewDetailList.TotalRecords / t.ProductReviewDetailList.PageSize : t.ProductReviewDetailList.TotalRecords / t.ProductReviewDetailList.PageSize + 1);
                if (null != t.ProductReviewScore && t.ProductReviewScore.ProductSysNo == 0)
                {
                    t.ProductReviewScore.ProductSysNo = productSysNo;
                }
            });

            return(result);
        }
コード例 #21
0
        private void Button_Save_Click(object sender, RoutedEventArgs e)
        {
            // 添加顾客加积分申请操作:
            if (!ValidateInput())
            {
                return;
            }
            CustomerPointsAddRequest newRequestInfo = new CustomerPointsAddRequest();

            newRequestInfo.CustomerID      = viewModel.CustomerID;
            newRequestInfo.CustomerSysNo   = viewModel.CustomerSysNo.Value;
            newRequestInfo.PointType       = Convert.ToInt32((Combo_Memo.SelectedItem as CodeNamePair).Code);
            newRequestInfo.NewEggAccount   = (Combo_SysAccount.SelectedItem as CodeNamePair).Name;
            newRequestInfo.Memo            = Combo_Memo.SelectedItem != null ? (Combo_Memo.SelectedItem as CodeNamePair).Name : string.Empty;
            newRequestInfo.OwnByDepartment = Combo_OwnByDepartment.SelectedItem != null ? (Combo_OwnByDepartment.SelectedItem as CodeNamePair).Name : string.Empty;
            if (!string.IsNullOrEmpty(viewModel.SOSysNo))
            {
                newRequestInfo.SOSysNo = Convert.ToInt32(viewModel.SOSysNo);
            }
            newRequestInfo.Point          = Convert.ToInt32(viewModel.Point);
            newRequestInfo.PointsItemList = EntityConverter <CustomerPointsAddItemVM, CustomerPointsAddRequestItem> .Convert(viewModel.PointsItemList);

            newRequestInfo.Note      = viewModel.Note;
            newRequestInfo.ProductID = txtProductID.Text.Length > 0 ? txtProductID.Text : null;

            serviceFacade.CreateCustomerPointsAddRequest(newRequestInfo, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                else
                {
                    if (Dialog != null)
                    {
                        Dialog.ResultArgs.Data         = args;
                        Dialog.ResultArgs.DialogResult = DialogResultType.OK;
                        Dialog.Close();
                    }
                }
            });
        }
コード例 #22
0
        public void LoadBasicInfo()
        {
            serviceFacade.LoadInfo(getSysNo, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    Window.Alert(args.Error.Faults[0].ErrorDescription);
                    return;
                }

                if (null != args.Result)
                {
                    newVM = EntityConverter <ConsignAdjustInfo, ConsignAdjustVM> .Convert(args.Result);
                    newVM.SettleRangeDate       = Convert.ToDateTime(newVM.SettleRange);
                    this.DataContext            = newVM;
                    this.DeductGrid.ItemsSource = newVM.ItemList;

                    //已审核过和作废的单据仅能查看,待审核的可编辑
                    if (this.newVM.Status == ConsignAdjustStatus.WaitAudit)
                    {
                        this.btnSave.IsEnabled      = true;
                        this.btnAddDeduct.IsEnabled = true;
                        this.btnDel.IsEnabled       = true;
                        this.btnAudit.IsEnabled     = true;
                        this.btnAbandon.IsEnabled   = true;
                    }
                    else
                    {
                        this.btnSave.IsEnabled      = false;
                        this.btnAddDeduct.IsEnabled = false;
                        this.btnDel.IsEnabled       = false;
                        this.btnAudit.IsEnabled     = false;
                        this.btnAbandon.IsEnabled   = false;
                    }
                }
                else
                {
                    Window.Alert("无效的单据号");
                    return;
                }
            });
        }
コード例 #23
0
 private void btnAuditDenied_Click(object sender, RoutedEventArgs e)
 {
     //审核拒绝操作 :
     Window.Confirm(ResVendorRMARefundMaintain.AlertMsg_ConfirmAuditDinied, (obj, args) =>
     {
         if (args.DialogResult == DialogResultType.OK)
         {
             VendorRefundInfo info = EntityConverter <VendorRefundInfoVM, VendorRefundInfo> .Convert(viewVM);
             serviceFacade.RejectVendorRefundInfo(info, (obj2, args2) =>
             {
                 if (args2.FaultsHandle())
                 {
                     return;
                 }
                 Window.Alert(ResVendorRMARefundMaintain.AlertMsg_AuditSuc);
                 Window.Refresh();
             });
         }
     });
 }
コード例 #24
0
ファイル: GatherNew.xaml.cs プロジェクト: sanlonezhang/ql
        private void SettledProductsGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e)
        {
            filter.PageInfo = new QueryFilter.Common.PagingInfo()
            {
                PageIndex = e.PageIndex,
                PageSize  = e.PageSize,
                SortBy    = e.SortField
            };
            serviceFacade.QueryGatherSettlementItemList(filter, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                this.SettledProductsGrid.TotalCount = args.Result.TotalCount;

                this.gatherInfoVM.GatherSettlementItemInfoList = EntityConverter <List <GatherSettlementItemInfo>, List <GatherSettlementItemInfoVM> > .Convert(args.Result.ResultList);
                this.SettledProductsGrid.ItemsSource           = this.gatherInfoVM.GatherSettlementItemInfoList;
            });
        }
コード例 #25
0
        public void GetVisitDetailByVisitSysNo(int visitSysNo, System.Action <CustomerVisitDetailView> action)
        {
            if (visitSysNo > 0)
            {
                string relativeUrl = String.Format("/CustomerService/Visit/Load/{0}", visitSysNo);

                restClient.Query <CustomerVisitDetailReq>(relativeUrl, (sender, e) =>
                {
                    if (e.FaultsHandle())
                    {
                        return;
                    }
                    CustomerVisitDetailView detail = EntityConverter <CustomerVisitDetailReq, CustomerVisitDetailView> .Convert(e.Result);
                    if (action != null)
                    {
                        action(detail);
                    }
                });
            }
        }
コード例 #26
0
 private void LoadGatherInfo()
 {
     serviceFacade.LoadGatherSettlementInfo(GatherSysNo, (obj, args) =>
     {
         if (args.FaultsHandle())
         {
             return;
         }
         GetherInfoVM = EntityConverter <GatherSettlementInfo, GatherSettlementInfoVM> .Convert(args.Result, (s, t) =>
         {
             t.StockID   = s.SourceStockInfo.SysNo.ToString();
             t.StockName = s.SourceStockInfo.StockName;
             t.VendorInfo.VendorBasicInfo.PaySettleCompany = s.VendorInfo.VendorBasicInfo.PaySettleCompany;
             txtPaySettleCompany.Text = EnumConverter.GetDescription(t.VendorInfo.VendorBasicInfo.PaySettleCompany);
         });
         this.DataContext = GetherInfoVM;
         SettledProductsGrid.Bind();
         ShowActionButtons(GetherInfoVM.SettleStatus.Value);
     });
 }
コード例 #27
0
        public void QueryVisitLog(bool visitForOrder, int customerSysNo, System.Action <List <VisitLogVM> > action)
        {
            if (customerSysNo > 0)
            {
                string relativeUrl = String.Format("/CustomerService/Visit/Load/{0}/{1}", visitForOrder ? "OrderVisitLogs" : "CustomerVisitLogs", customerSysNo);

                restClient.Query <List <VisitLog> >(relativeUrl, (sender, e) =>
                {
                    if (e.FaultsHandle())
                    {
                        return;
                    }
                    List <VisitLogVM> vm = EntityConverter <List <VisitLog>, List <VisitLogVM> > .Convert(e.Result);
                    if (action != null)
                    {
                        action(vm);
                    }
                });
            }
        }
コード例 #28
0
        /// <summary>
        /// 加载代销结算单信息
        /// </summary>
        private void LoadConsignInfo()
        {
            serviceFacade.GetConsignSettlementInfo(ConsignSysNo, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }

                consignSettleVM = new CollectionPaymentInfoVM();
                consignSettleVM = EntityConverter <CollectionPaymentInfo, CollectionPaymentInfoVM> .Convert(args.Result, (s, t) =>
                {
                    if (s.SourceStockInfo != null)
                    {
                        t.StockSysNo = s.SourceStockInfo.SysNo;
                        t.StockID    = s.SourceStockInfo.SysNo.Value.ToString();
                        t.StockName  = s.SourceStockInfo.StockName.ToString();
                    }

                    t.PMSysNo         = s.PMInfo.SysNo.HasValue ? s.PMInfo.SysNo.Value.ToString() : null;
                    t.SettleUserSysNo = s.SettleUser.SysNo;
                    t.SettleUserName  = s.SettleUser.UserName;
                    t.SettleItems.ForEach(x =>
                    {
                        x.ConsignToAccLogInfo.SettleType    = x.SettleType;
                        x.IsSettleCostTextBoxReadOnly       = (t.Status != POCollectionPaymentSettleStatus.Origin || x.SettleType != SettleType.O) ? true : false;
                        x.IsSettlePercentageTextBoxReadOnly = (t.Status != POCollectionPaymentSettleStatus.Origin || x.SettleType != SettleType.P) ? true : false;
                        x.SettlePercentageTextBoxVisibility = x.SettleType == SettleType.P ? Visibility.Visible : Visibility.Collapsed;
                    });
                    txtPaySettleCompany.Text = EnumConverter.GetDescription(t.VendorInfo.VendorBasicInfo.PaySettleCompany);
                });


                CountConsignSettleItems();
                this.DataContext = consignSettleVM;
                this.SettleProductsQueryResultGrid.Bind();
                CalcSettleProducts();
                ShowActionButton(consignSettleVM.Status.Value);
                this.consignSettleVM.ValidationErrors.Clear();
            });
        }
コード例 #29
0
ファイル: GroupBuyingFacade.cs プロジェクト: sanlonezhang/ql
        public void LoadMarginRateInfo(GroupBuyingMaintainVM vm, EventHandler <RestClientEventArgs <List <GroupBuySaveInfoVM> > > callback)
        {
            GroupBuyingInfo entity = VtoE(vm);

            string relativeUrl = "/MKTService/GroupBuying/LoadMarginRateInfo";

            restClient.Query <List <GroupBuySaveInfo> >(relativeUrl, entity, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }

                List <GroupBuySaveInfoVM> infoVMList = new List <GroupBuySaveInfoVM>();
                foreach (GroupBuySaveInfo info in args.Result)
                {
                    infoVMList.Add(EntityConverter <GroupBuySaveInfo, GroupBuySaveInfoVM> .Convert(info));
                }
                callback(obj, new RestClientEventArgs <List <GroupBuySaveInfoVM> >(infoVMList, _Page));
            });
        }
コード例 #30
0
        private void LoaVSPOInfo()
        {
            serviceFacade.LoadVirtualPurchaseOrderInfo(VSPOSysNo, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                infoVM           = EntityConverter <VirtualStockPurchaseOrderInfo, VirtualStockPurchaseOrderInfoVM> .Convert(args.Result);
                this.DataContext = infoVM;
                infoVM.ValidationErrors.Clear();

                if (args.Result.EstimateArriveTime.HasValue)
                {
                    this.dpkEstimateArriveDate.Text = args.Result.EstimateArriveTime.Value.ToShortDateString();
                    this.tpEstimateArriveTime.Value = args.Result.EstimateArriveTime.Value;
                }
                ShowActionButtons(args.Result.Status);
                SetAccessControl();
            });
        }