Пример #1
0
        public ActionResult Edit(int id)
        {
            DisputeType obj = GetById(id);

            ViewData["OrderNo"]       = obj.OrderNo;
            ViewData["SKU"]           = obj.SKU;
            ViewData["LogisticsMode"] = obj.LogisticsMode;
            obj.Status = "解决中";
            return(View(obj));
        }
Пример #2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            order = OrderType.find(" OrderExNo = '" + txtOrderExNo.Value.Trim() + "'").first();
            if (order == null)
            {
                return;
            }
            DisputeType di = new DisputeType();
            DateTime createTime = new DateTime();
            string strCreateDate = Request.Form[txtCreateOn.ID].Trim();
            if (string.IsNullOrEmpty(strCreateDate) || !DateTime.TryParse(strCreateDate, out createTime))
            {
                return;
            }
            di.CreateOn = createTime;
            di.PlatformName = order.OrderForm;
            di.SaleAccountName = order.UserNameForm;
            di.SendOrderDate = order.AddTime;
            di.ItemNo = GetOrderItemNo(order);
            di.TrackCode = txtTrackCode.Value.Trim();
            di.TransportMode = txtTransportMode.Value.Trim();
            di.OrderId = order.OrderExNo;
            di.OrderNo = order.OrderNo;
            double refoundAmount = 0;
            if (!string.IsNullOrEmpty(txtRefundAmount.Value) && double.TryParse(txtRefundAmount.Value, out refoundAmount))
            {
                di.RefundAmount = refoundAmount;
            }
            if (refoundAmount > 0)
            {
                di.CurrencyCode = ddlCurrencyType.SelectedItem.Value;
            }
            di.Remark = txtRemark.Value.Trim();
            DateTime approachDate = DateTime.Now;
            if (!string.IsNullOrEmpty(txtApproachOn.Value) && DateTime.TryParse(txtApproachOn.Value, out approachDate))
            {
                di.ResolutionTime = approachDate;
            }
            di.DisputeStatus = Request.Form["state"].Trim();
            di.DisputeCategory = ddlDisputeCategory.SelectedItem.Value;
            di.DisputeSolutionType = ddlDisputeApproach.SelectedItem.Value;

            if (dId != 0 || oId != 0)
            {
                di.Id = dId;
                di.update();
            }
            else
            {
                di.insert();
            }
        }
Пример #3
0
        /// <summary>
        /// 根据Id获取
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public DisputeType GetById(int Id)
        {
            DisputeType obj = NSession.Get <DisputeType>(Id);

            if (obj == null)
            {
                throw new Exception("返回实体为空");
            }
            else
            {
                return(obj);
            }
        }
Пример #4
0
 public JsonResult DeleteConfirmed(int id)
 {
     try
     {
         DisputeType obj = GetById(id);
         NSession.Delete(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
Пример #5
0
 public JsonResult ToDispute(int id)
 {
     try
     {
         DisputeType obj = GetById(id);
         obj.DisputesType = "纠纷";
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }, JsonRequestBehavior.AllowGet));
     }
     return(Json(new { IsSuccess = true, ErrorMsg = "转换成功" }, JsonRequestBehavior.AllowGet));
 }
Пример #6
0
        public void SaveAmount(DisputeType obj)
        {
            RefundAmountType amount = new RefundAmountType
            {
                DId           = obj.Id,
                OrderNo       = obj.OrderNo,
                OrderExNo     = obj.OrderExNo,
                Platform      = obj.Platform,
                Account       = obj.Account,
                Amount        = obj.Amount,
                CreateBy      = CurrentUser.Realname,
                CreateOn      = DateTime.Now,
                EmailAccount  = obj.EmailAccount,
                TransactionNo = obj.TransactionNo,
                Status        = "未审核",
                AmountType    = obj.AmountType,
                AuditOn       = Convert.ToDateTime("2000-01-01")
            };

            NSession.Save(amount);
            NSession.Flush();
        }
Пример #7
0
 public ActionResult Edit(DisputeType obj)
 {
     try
     {
         DisputeType obj2 = GetById(obj.Id);
         NSession.Clear();
         obj.SolveBy = CurrentUser.Realname;
         obj.SolveOn = DateTime.Now;
         string str = Utilities.GetObjEditString(obj2, obj);
         NSession.Update(obj);
         NSession.Flush();
         if (obj.Status == "已解决" && obj.RefundAmount != 0)
         {
             SaveAmount(obj);
         }
         LoggerUtil.GetDisputeRecord(obj, "处理纠纷", str, CurrentUser, NSession);
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
Пример #8
0
        private void BtnGetDispute_Click(object sender, System.EventArgs e)
        {
            try
            {
                LstMessages.Items.Clear();
                TxtItemId.Text      = "";
                TxtTitle.Text       = "";
                TxtSeller.Text      = "";
                TxtBuyer.Text       = "";
                TxtCreatedTime.Text = "";

                GetDisputeCall apicall = new GetDisputeCall(Context);
                DisputeType    dispute = apicall.GetDispute(TxtDisputeId.Text);

                TxtItemId.Text      = dispute.Item.ItemID;
                TxtTitle.Text       = dispute.Item.Title;
                TxtSeller.Text      = dispute.SellerUserID;
                TxtBuyer.Text       = dispute.BuyerUserID;
                TxtCreatedTime.Text = dispute.DisputeCreatedTime.ToString();

                foreach (DisputeMessageType message in dispute.DisputeMessage)
                {
                    string[] listparams = new string[5];
                    listparams[0] = message.MessageSource.ToString();
                    listparams[1] = message.MessageCreationTime.ToString();
                    listparams[2] = message.MessageText;

                    ListViewItem vi = new ListViewItem(listparams);
                    this.LstMessages.Items.Add(vi);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #9
0
 public JsonResult Create(DisputeType obj)
 {
     try
     {
         object count = NSession.CreateQuery("select Count(Id) from DisputeType where OrderNo='" + obj.OrderNo + "'").UniqueResult();
         if (Convert.ToInt32(count) > 0)
         {
             return(Json(new { IsSuccess = false, ErrorMsg = "该订单已经存在纠纷列表中" }));
         }
         obj.SolveOn   = Convert.ToDateTime("2000-01-01");
         obj.DisputeOn = DateTime.Now;
         obj.Status    = "未解决";
         obj.CreateOn  = DateTime.Now;
         obj.CreateBy  = CurrentUser.Realname;
         NSession.SaveOrUpdate(obj);
         NSession.Flush();
         LoggerUtil.GetDisputeRecord(obj, "发生纠纷", " 创建纠纷信息", CurrentUser, NSession);
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
Пример #10
0
 //纠纷日志
 public static void GetDisputeRecord(DisputeType obj, string recordType, string Content, UserType CurrentUser, ISession NSession)
 {
     GetDisputeRecord(obj.Id, recordType, Content, CurrentUser, NSession);
 }