public JsonResult EditProcessed(int Id)
        {
            EbayMessageType   ebaymessage = ebay.GetById(Id);
            EbayMessageReType obj         = new EbayMessageReType();

            obj.ItemId      = ebaymessage.ItemId;
            obj.EbayId      = ebaymessage.MessageId;
            obj.Account     = ebaymessage.Shop;
            obj.BodyRe      = "";
            obj.ItemId      = ebaymessage.ItemId;
            obj.SenderID    = ebaymessage.SenderID;
            obj.SenderEmail = ebaymessage.SenderEmail;
            obj.EbayId      = ebaymessage.MessageId;
            obj.ReplayBy    = CurrentUser.Realname;
            obj.SenderEmail = ebaymessage.SenderEmail;
            obj.SenderID    = ebaymessage.SenderID;
            obj.Account     = ebaymessage.Shop;
            obj.ReplayOn    = DateTime.Now;
            obj.UploadTime  = Convert.ToDateTime("2000-01-01");
            NSession.Save(obj);
            NSession.Flush();
            ebaymessage.ReplayBy      = CurrentUser.Realname;
            ebaymessage.ReplayOn      = DateTime.Now;
            ebaymessage.MessageStatus = "已回复";
            NSession.Update(ebaymessage);
            NSession.Flush();
            return(Json(new { IsSuccess = "true" }));
        }
        public JsonResult Create(EbayMessageReType obj)
        {
            try
            {
                EbayMessageType ebaymessage = ebay.GetById(obj.MessageId);

                obj.ItemId      = ebaymessage.ItemId;
                obj.EbayId      = ebaymessage.MessageId;
                obj.ReplayBy    = CurrentUser.Realname;
                obj.SenderEmail = ebaymessage.SenderEmail;
                obj.SenderID    = ebaymessage.SenderID;
                obj.Account     = ebaymessage.Shop;
                obj.ReplayOn    = DateTime.Now;
                obj.UploadTime  = Convert.ToDateTime("2000-01-01");
                NSession.Save(obj);
                NSession.Flush();
                ebaymessage.ReplayBy      = obj.ReplayBy;
                ebaymessage.ReplayOn      = obj.ReplayOn;
                ebaymessage.MessageStatus = "已回复";
                NSession.Update(ebaymessage);
                NSession.Flush();
            }
            catch (Exception ee)
            {
                return(Json(new { errorMsg = "出错了" }));
            }
            return(Json(new { IsSuccess = "true" }));
        }
 public ActionResult Edit(EbayMessageReType obj)
 {
     try
     {
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { errorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = "true" }));
 }
        /// <summary>
        /// 根据Id获取
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public EbayMessageReType GetById(int Id)
        {
            EbayMessageReType obj = NSession.Get <EbayMessageReType>(Id);

            if (obj == null)
            {
                throw new Exception("返回实体为空");
            }
            else
            {
                return(obj);
            }
        }
 public string ChangeStatus(EbayMessageReType obj)
 {
     try
     {
         NSession.Update(obj);
         NSession.Flush();
         return("状态修改成功");
     }
     catch (Exception e)
     {
         return("状态修改出错");
     }
 }
 public JsonResult DeleteConfirmed(int id)
 {
     try
     {
         EbayMessageReType obj = GetById(id);
         NSession.Delete(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { errorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = "true" }));
 }
        public JsonResult GetDetail(int id)
        {
            EbayMessageReType de = GetById(id);

            return(Json(de.BodyRe, JsonRequestBehavior.AllowGet));
        }