예제 #1
0
        public void SaveRemark()
        {
            var comment = new OPC_Comment();

            comment.RelationId = id;
            comment.Content    = RemarkContent;
            comment.CreateUser = 1;
            comment.CreateDate = DateTime.Now;

            bool isSuccess = false;

            switch (enumSetRemarkType)
            {
            case EnumSetRemarkType.SetSaleRemark:
                OPC_SaleComment salecomment = Mapper.Map <OPC_Comment, OPC_SaleComment>(comment);
                salecomment.SaleOrderNo = comment.RelationId;
                isSuccess = AppEx.Container.GetInstance <IRemarkService>().WriteSaleRemark(salecomment);
                break;

            case EnumSetRemarkType.SetSaleDetailRemark:
                OPC_SaleDetailsComment saledetailscomment = Mapper.Map <OPC_Comment, OPC_SaleDetailsComment>(comment);
                saledetailscomment.SaleDetailId = id;
                isSuccess = AppEx.Container.GetInstance <IRemarkService>().WriteSaleDetailsRemark(saledetailscomment);
                break;

            case EnumSetRemarkType.SetOrderRemark:
                OPC_OrderComment orderComment = Mapper.Map <OPC_Comment, OPC_OrderComment>(comment);
                orderComment.OrderNo = id;
                isSuccess            = AppEx.Container.GetInstance <IRemarkService>().WriteOrderRemark(orderComment);
                break;

            case EnumSetRemarkType.SetShipSaleRemark:
                OPC_ShipComment shipSaleComment = Mapper.Map <OPC_Comment, OPC_ShipComment>(comment);
                shipSaleComment.ShippingCode = comment.RelationId;
                isSuccess = AppEx.Container.GetInstance <IRemarkService>().WriteShippingRemark(shipSaleComment);
                break;

            case EnumSetRemarkType.SetSaleRMARemark:
                OPC_SaleRMAComment rmaSaleRemark = Mapper.Map <OPC_Comment, OPC_SaleRMAComment>(comment);
                rmaSaleRemark.RMANo = comment.RelationId;
                isSuccess           = AppEx.Container.GetInstance <IRemarkService>().WriteSaleRmaRemark(rmaSaleRemark);
                break;

            case EnumSetRemarkType.SetRMARemark:
                OPC_SaleRMAComment rmaRemark = Mapper.Map <OPC_Comment, OPC_SaleRMAComment>(comment);
                rmaRemark.RMANo = comment.RelationId;
                isSuccess       = AppEx.Container.GetInstance <IRemarkService>().WriteRmaRemark(rmaRemark);
                break;
            }
            if (!isSuccess)
            {
                MvvmUtility.ShowMessageAsync("保存备注失败", "提示", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                RemarkContent = "";
                OpenWinSearch(id, enumSetRemarkType);
            }
        }
예제 #2
0
 public bool WriteRmaRemark(OPC_SaleRMAComment RmaComment)
 {
     try
     {
         bool bResult = RestClient.Post("rma/AddRmaComment", RmaComment);
         return(bResult);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
예제 #3
0
 public IHttpActionResult AddSaleRmaComment([FromBody] OPC_SaleRMAComment comment, [UserId] int uid)
 {
     return(DoAction(() =>
     {
         _saleRmaService.UserId = uid;
         comment.CreateDate = DateTime.Now;
         comment.CreateUser = uid;
         comment.UpdateDate = comment.CreateDate;
         comment.UpdateUser = comment.CreateUser;
         _saleRmaService.AddComment(comment);
     }, "增加退货单备注失败"));
 }
예제 #4
0
 public void AddComment(OPC_SaleRMAComment comment)
 {
     _saleRmaCommentRepository.Create(comment);
 }