public void ShowRemarkWin(string id, EnumSetRemarkType type) { WindowStartupLocation = WindowStartupLocation.CenterScreen; ViewModel.OpenWinSearch(id, type); if (ShowDialog() == true) { //ViewModel.SaveRemark(id, type); } }
public void OpenWinSearch(string id, EnumSetRemarkType type) { this.id = id; this.enumSetRemarkType = type; switch (type) { case EnumSetRemarkType.SetSaleRemark: PageResult <OPC_SaleComment> saleRemark = AppEx.Container.GetInstance <IRemarkService>().GetSaleRemark(string.Format("saleId={0}", id)); Remark4List = Mapper.Map <OPC_SaleComment, OPC_Comment>(saleRemark.Result); break; case EnumSetRemarkType.SetSaleDetailRemark: PageResult <OPC_SaleDetailsComment> saleDetailRemark = AppEx.Container.GetInstance <IRemarkService>() .GetSaleDetailsRemark(string.Format("saledetailId={0}", id)); Remark4List = Mapper.Map <OPC_SaleDetailsComment, OPC_Comment>(saleDetailRemark.Result); break; case EnumSetRemarkType.SetOrderRemark: PageResult <OPC_OrderComment> orderRemark = AppEx.Container.GetInstance <IRemarkService>().GetOrderRemark(string.Format("orderNo={0}", id)); Remark4List = Mapper.Map <OPC_OrderComment, OPC_Comment>(orderRemark.Result); break; case EnumSetRemarkType.SetShipSaleRemark: PageResult <OPC_ShipComment> shipRemark = AppEx.Container.GetInstance <IRemarkService>() .GetShipRemark(string.Format("shippingSaleNo={0}", id)); Remark4List = Mapper.Map <OPC_ShipComment, OPC_Comment>(shipRemark.Result); break; case EnumSetRemarkType.SetSaleRMARemark: PageResult <OPC_SaleRMAComment> saleRmaRemark = AppEx.Container.GetInstance <IRemarkService>() .GetSaleRmaRemark(string.Format("rmaNo={0}", id)); Remark4List = Mapper.Map <OPC_SaleRMAComment, OPC_Comment>(saleRmaRemark.Result); break; case EnumSetRemarkType.SetRMARemark: PageResult <OPC_SaleRMAComment> rmaRemark = AppEx.Container.GetInstance <IRemarkService>() .GetRmaRemark(string.Format("rmaNo={0}", id)); Remark4List = Mapper.Map <OPC_SaleRMAComment, OPC_Comment>(rmaRemark.Result); break; } }