示例#1
0
 public ActionResult Edit(NoStockType obj)
 {
     try
     {
         NSession.Update(obj);
         NSession.Flush();
         List <NoStockLinkType> list1 = Newtonsoft.Json.JsonConvert.DeserializeObject <List <NoStockLinkType> >(obj.rowse);
         NSession.Delete("from NoStockLinkType where PId='" + obj.Id + "'");
         NSession.Flush();
         NSession.Clear();
         foreach (NoStockLinkType link in list1)
         {
             link.OldSKU   = obj.OldSKU;
             link.SKU      = obj.SKU;
             link.PId      = obj.Id;
             link.CreateBy = CurrentUser.Realname;
             link.CreateOn = DateTime.Now;
             NSession.Save(link);
             NSession.Flush();
         }
     }
     catch (Exception ee)
     {
         return(Json(new { errorMsg = "出错了" }));
     }
     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 JsonResult DeleteConfirmed(int id)
 {
     try
     {
         PlanDaoType      obj  = GetById(id);
         PurchasePlanType plan =
             NSession.Get <PurchasePlanType>(obj.PlanId);
         if (plan != null)
         {
             plan.Status = "已发货";
             plan.DaoQty = plan.DaoQty - obj.RealQty;
             NSession.Update(plan);
             NSession.Flush();
         }
         NSession.Delete("from SKUCodeType where PlanNo='" + obj.PlanNo + "' and Code >=" + obj.SKUCode + " and Code < " + (obj.SKUCode + obj.RealQty));
         NSession.Flush();
         NSession.Delete(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
        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" }));
        }
示例#5
0
        public JsonResult IsReceived(int id)
        {
            NoStockType obj = GetById(id);

            obj.Enabled = 0;
            NSession.Update(obj);
            NSession.Flush();
            return(Json(""));
        }
示例#6
0
        public JsonResult PrintSave(string Id)
        {
            NSession.Clear();
            PrintTemplateType obj = NSession.Get <PrintTemplateType>(Convert.ToInt32(Id));

            byte[] FormData = Request.BinaryRead(Request.TotalBytes);
            obj.Content = System.Text.Encoding.Default.GetString(FormData);
            NSession.Update(obj);
            NSession.Flush();
            return(Json(new { IsSuccess = 1 }));
        }
 public ActionResult Edit(ProductIsInfractionType obj)
 {
     try
     {
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { errorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = "true" }));
 }
示例#8
0
 public ActionResult Edit(SerialNumberType obj)
 {
     try
     {
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
示例#9
0
 public ActionResult Edit(OrderReturnRecordType obj)
 {
     try
     {
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { errorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = "true" }));
 }
 public ActionResult Edit(LogisticsAreaCountryType obj)
 {
     try
     {
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
 public ActionResult Edit(EbayType obj)
 {
     try
     {
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { ErrorMsg = "出错了", IsSuccess = false }));
     }
     return(Json(new { IsSuccess = "true" }));
 }
 public ActionResult Details(ProjectType obj)
 {
     try
     {
         obj.Content = Session["Content"] + DateTime.Now.Date.ToShortDateString() + ": " + obj.Content + "<br>";
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
示例#13
0
        public ActionResult Edit(LogisticsAreaType obj)
        {
            obj.LId = int.Parse(Session["lid"].ToString());

            try
            {
                NSession.Update(obj);
                NSession.Flush();
            }
            catch (Exception ee)
            {
                return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
            }
            return(Json(new { IsSuccess = true }));
        }
示例#14
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));
 }
示例#15
0
 public JsonResult DeleteConfirmed(int id)
 {
     try
     {
         NoStockType obj = GetById(id);
         obj.Enabled = 0;
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { errorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = "true" }));
 }
 public ActionResult Edit(LanguageType obj)
 {
     try
     {
         NSession.Clear();
         NSession.Update(obj);
         NSession.Flush();
         Language.ReLoadLanguage();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
 public ActionResult Edit(PurchaseTroubleType obj)
 {
     try
     {
         obj.DealBy = CurrentUser.Realname;
         obj.DealOn = DateTime.Now;
         obj.Status = "已解决";
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { errorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = "true" }));
 }
 public ActionResult Edit(MachineType obj)
 {
     try
     {
         if (IsOk(obj.Id, obj.Code))
         {
             return(Json(new { errorMsg = "编号已经存在" }));
         }
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
示例#19
0
 public ActionResult Edit(LogisticsType obj)
 {
     try
     {
         if (IsOk(obj.Id, obj.LogisticsCode))
         {
             return(Json(new { errorMsg = "此代码已存在,请检查后再作修改!" }));
         }
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
示例#20
0
 public ActionResult Edit(DictionaryClassType obj)
 {
     try
     {
         DictionaryClassType c = GetById(obj.Id);
         NSession.CreateSQLQuery("update Dictionarys set DicCode='" + obj.Code + "' where DicCode='" + c.Code + "' ")
         .UniqueResult();
         NSession.Clear();
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
示例#21
0
        public ActionResult DoNo(int o)
        {
            QuestionOrderType obj       = GetById(o);
            OrderType         orderType = NSession.Get <OrderType>(obj.OId);

            if (orderType != null)
            {
                orderType.Enabled = 0;
                NSession.Update(orderType);
                NSession.Flush();
                obj.Status = 2;
                NSession.Update(obj);
                NSession.Flush();
                OrderHelper.GetOrderRecord(orderType, "拒绝问题订单", "" + CurrentUser.Realname + "将订单设为隐藏!", CurrentUser.Realname, NSession);
            }
            return(Json(new { IsSuccess = "true" }));
        }
 public ActionResult Edit(PurchasePlanType obj)
 {
     try
     {
         string           str  = "";
         PurchasePlanType obj2 = GetById(obj.Id);
         str += Utilities.GetObjEditString(obj2, obj) + "<br>";
         NSession.Clear();
         NSession.Update(obj);
         NSession.Flush();
         LoggerUtil.GetPurchasePlanRecord(obj, "修改采购计划", str, CurrentUser, NSession);
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
示例#23
0
 public ActionResult Edit(AccountType obj)
 {
     try
     {
         //EBayUtil.GetMyeBaySelling(obj);
         if (!IsOk(obj.Id, obj.AccountName, obj.Platform))
         {
             return(Json(new { errorMsg = "此账号已存在!" }));
         }
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
示例#24
0
        public ActionResult EditStatus(string p, string s)
        {
            List <ProductType> products =
                NSession.CreateQuery("from ProductType where Id in(" + p + ")").List <ProductType>().ToList();

            foreach (ProductType productType in products)
            {
                productType.Status = s;
                NSession.Update(productType);
                NSession.Flush();
                LoggerUtil.GetProductRecord(productType, "订单产品属性修改",
                                            "产品:" + productType.SKU + "状态修改为“" + s + "”",
                                            CurrentUser, NSession);
                if (s == "停产")
                {
                    int              count      = 0;
                    string           orderid    = "";
                    List <OrderType> orderTypes =
                        NSession.CreateQuery(
                            "from OrderType where Id in(select OId from OrderProductType where SKU='" + productType.SKU + "') and Status='已处理' and Enabled=1")
                        .List <OrderType>().ToList();
                    foreach (OrderType orderType in orderTypes)
                    {
                        orderType.IsStop = 1;
                        NSession.Update(orderType);
                        NSession.Flush();
                        LoggerUtil.GetOrderRecord(orderType, "订单产品属性修改",
                                                  "产品:" + productType.SKU + "状态修改为“" + s + "”,同时订单属性设置为停售订单", CurrentUser, NSession);
                        orderid += orderType.OrderNo + "  ";
                        count++;
                    }
                    NSession.CreateQuery("update OrderProductType set IsQue=2 where SKU='" + productType.SKU + "'").UniqueResult();
                    PlacardType placard = new PlacardType {
                        CardType = "产品", Title = productType.SKU + " 停产", Content = "相关" + count + "条订单编号: " + orderid, CreateBy = "系统自动", CreateOn = DateTime.Now, IsTop = 1
                    };
                    NSession.Save(placard);
                    NSession.Flush();
                }
            }
            return(Json(new { IsSuccess = true }));
        }
示例#25
0
        public JsonResult ReOrder(string o)
        {
            List <QuestionOrderType> orders = NSession.CreateQuery("from QuestionOrderType where OrderNo='" + o + "' and Status=0").List <QuestionOrderType>().ToList();

            if (orders.Count > 0)
            {
                QuestionOrderType order = orders[0];
                if (order.Status == 0)
                {
                    OrderType orderType = NSession.Get <OrderType>(order.OId);
                    if (orderType != null)
                    {
                        orderType.IsAudit    = 1;
                        orderType.IsError    = 0;
                        orderType.CutOffMemo = "";

                        if (order.Subjest.IndexOf("重置") != -1)
                        {
                            if (order.Subjest.IndexOf("作废") == -1 && orderType.Status.IndexOf("作废") == -1)
                            {
                                orderType.Status  = "已处理";
                                orderType.IsPrint = 0;
                            }
                            NSession.CreateQuery("update SKUCodeType set IsOut=1,IsSend=1,SendOn='" + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "',OrderNo='拦截报废出库' where OrderNo='" + orderType.OrderNo + "'")
                            .ExecuteUpdate();
                        }

                        NSession.Update(orderType);
                        NSession.Flush();
                        order.Status = 1;
                        NSession.Update(order);
                        NSession.Flush();
                        OrderHelper.GetOrderRecord(orderType, "取消拦截订单!", "仓库人员:" + CurrentUser.Realname + "确认", CurrentUser.Realname, NSession);
                    }
                    return(Json(new { IsSuccess = true, Result = "订单:" + order.OrderNo + "取消拦截成功" }));
                }
                return(Json(new { IsSuccess = false, Result = "此订单已经确认过了,请不要重复操作。" }));
            }
            return(Json(new { IsSuccess = false, Result = "这个不是问题订单,请联系客服人员核实" }));
        }
示例#26
0
        public ActionResult DoAudit(int o)
        {
            QuestionOrderType obj = GetById(o);

            if (obj.Subjest.IndexOf("重发") != -1)
            {
                OrderType orderType = NSession.Get <OrderType>(obj.OId);
                if (orderType != null)
                {
                    orderType.IsAudit    = 1;
                    orderType.IsError    = 0;
                    orderType.CutOffMemo = "";
                    NSession.Update(orderType);
                    NSession.Flush();
                    obj.Status = 1;
                    NSession.Update(obj);
                    NSession.Flush();
                    OrderHelper.GetOrderRecord(orderType, "重发订单审核!", "" + CurrentUser.Realname + "确认该订单的审核", CurrentUser.Realname, NSession);
                }
            }
            return(Json(new { IsSuccess = "true" }));
        }
示例#27
0
        public JsonResult ReturnOrder(string o, string p)
        {
            List <OrderType> orders =
                NSession.CreateQuery("from OrderType where OrderNo='" + o + "'").List <OrderType>().ToList();

            if (orders.Count > 0)
            {
                OrderType order = orders[0];
                order.Status    = OrderStatusEnum.退货订单.ToString();
                order.BuyerMemo = p + "  " + order.BuyerMemo;
                NSession.Update(order);
                NSession.Flush();
                OrderReturnRecordType record = new OrderReturnRecordType();
                record.Account             = order.Account;
                record.Platform            = order.Platform;
                record.ReturnLogisticsMode = order.LogisticMode;
                record.OrderExNO           = order.OrderExNo;
                record.OrderNo             = order.OrderNo;
                record.OrderSendOn         = order.ScanningOn;
                record.ReturnType          = p;
                record.OldTrackCode        = order.TrackCode;
                record.CreateOn            = DateTime.Now;
                record.Country             = order.Country;
                record.CurrencyCode        = order.CurrencyCode;
                record.Amount        = order.Amount;
                record.BuyerName     = order.BuyerName;
                record.OrderCreateOn = order.CreateOn;
                record.OId           = order.Id;


                NSession.Save(record);
                NSession.Flush();

                LoggerUtil.GetOrderRecord(order, "订单退货扫描!", "订单设置为退货", CurrentUser, NSession);

                return(Json(new { IsSuccess = true, Result = "订单:" + order.OrderNo + "  已经添加到退货~!" }));
            }
            return(Json(new { IsSuccess = false, Result = "找不到该订单" }));
        }
示例#28
0
        public JsonResult EmailRe(EmailReturnType obj)
        {
            try
            {
                DateTime ReTime = DateTime.Now;
                SendMail(obj.REmail, obj.Subject, obj.Content);
                obj.CreateOn = ReTime;
                obj.CreateBy = ReTime;

                NSession.Save(obj);
                IList <EmailType> mail = NSession.CreateQuery("from EmailType c where c.Id=:id").SetInt32("id", obj.EId).List <EmailType>();
                mail[0].IsReply = 1;
                mail[0].ReplyOn = ReTime;
                NSession.Update(mail[0]);
                NSession.Flush();
            }
            catch (Exception ee)
            {
                return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
            }
            return(Json(new { IsSuccess = true }));
        }
示例#29
0
 public ActionResult Edit(SupplierType obj)
 {
     try
     {
         List <SuppliersProductType> list1 = Newtonsoft.Json.JsonConvert.DeserializeObject <List <SuppliersProductType> >(obj.rows);
         NSession.Update(obj);
         NSession.Flush();
         NSession.Delete("from SuppliersProductType where SId='" + obj.Id + "'");
         NSession.Flush();
         NSession.Clear();
         foreach (SuppliersProductType product in list1)
         {
             product.SId = obj.Id;
             NSession.Save(product);
             NSession.Flush();
         }
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
示例#30
0
 public ActionResult Edit(UserType obj)
 {
     try
     {
         OrganizeType obj1 = NSession.Get <OrganizeType>(obj.DId);
         if (obj1 != null)
         {
             obj.DepartmentName = obj1.ShortName;
         }
         OrganizeType obj2 = NSession.Get <OrganizeType>(obj.CId);
         if (obj2 != null)
         {
             obj.CompanyName = obj2.ShortName;
         }
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }