Esempio n. 1
0
        /// <summary>
        /// 更新入库单状态
        /// </summary>
        /// <param name="stockInSysNo">入库单系统编号</param>
        /// <param name="status">入库单状态</param>
        /// <param name="user">操作人</param>
        /// <returns>返回结果</returns>
        /// <remarks>2013-06-27 周唐炬 创建</remarks>
        public void UpdateStockInStatus(int stockInSysNo, WarehouseStatus.入库单状态 status, SyUser user)
        {
            var model = InStockBo.Instance.GetStockIn(stockInSysNo);

            if (null == model || model.Status == WarehouseStatus.入库单状态.作废.GetHashCode())
            {
                throw new HytException("入库不存在或已经作废,不能操作,请检查!");
            }
            else
            {
                model.Status         = status.GetHashCode();
                model.LastUpdateBy   = user.SysNo;
                model.LastUpdateDate = DateTime.Now;
                IInStockDao.Instance.UpdateWhStockIn(model);
                if (model.Status == (int)WarehouseStatus.入库单状态.已入库)
                {
                    //更新取件单
                    var pickup = ILgPickUpDao.Instance.GetEntityByStockIn(stockInSysNo);
                    if (pickup != null)
                    {
                        pickup.Status = (int)LogisticsStatus.取件单状态.已入库;
                        ILgPickUpDao.Instance.Update(pickup);
                    }
                    if (model.SourceType == (int)WarehouseStatus.入库单据类型.RMA单)
                    {
                        var rma = RmaBo.Instance.GetRMA(model.SourceSysNO);
                        if (rma != null && rma.RmaType == RmaStatus.RMA类型.售后换货.GetHashCode())
                        {
                            var crCustomer = CrCustomerBo.Instance.GetCrCustomerItem(rma.CustomerSysNo);
                            if (crCustomer != null)
                            {
                                Task.Factory.StartNew(
                                    () =>
                                {
                                    Extras.SmsBO.Instance.发送换货完成短信(crCustomer.MobilePhoneNumber,
                                                                   rma.SysNo.ToString(
                                                                       CultureInfo.InvariantCulture));
                                });
                                Task.Factory.StartNew(() =>
                                {
                                    Extras.EmailBo.Instance.发送换货完成邮件(crCustomer.EmailAddress,
                                                                     crCustomer.SysNo.ToString(
                                                                         CultureInfo.InvariantCulture),
                                                                     rma.SysNo.ToString(
                                                                         CultureInfo.InvariantCulture),
                                                                     rma.OrderSysNo.ToString(
                                                                         CultureInfo.InvariantCulture),
                                                                     rma.CreateDate.ToString(
                                                                         CultureInfo.InvariantCulture));
                                });
                            }
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        public override bool UpdateStatus(int SysNo, WarehouseStatus.入库单状态 Status, int AuditorSysNo)
        {
            int result = Context.Update("PdProductStockIn")
                         .Column("Status", (int)Status)
                         .Column("AuditorSysNo", (int)AuditorSysNo)
                         .Column("AuditDate", DateTime.Now)
                         .Column("LastUpdateBy", AuditorSysNo)
                         .Column("LastUpdateDate", DateTime.Now)
                         .Where("SysNo", SysNo)
                         .Execute();

            return(result > 0);
        }
Esempio n. 3
0
 /// <summary>
 /// 更新状态
 /// </summary>
 /// <param name="entity">数据实体</param>
 /// <remarks>2015-08-21  王耀发 创建</remarks>
 public abstract bool UpdateStatus(int SysNo, WarehouseStatus.入库单状态 Status, int AuditorSysNo);
Esempio n. 4
0
 /// <summary>
 /// 更新状态
 /// </summary>
 /// <param name="entity">数据实体</param>
 /// <remarks>2015-08-21  王耀发 创建</remarks>
 public bool UpdateStatus(int SysNo, WarehouseStatus.入库单状态 Status, SyUser user)
 {
     return(IPdProductStockInDao.Instance.UpdateStatus(SysNo, Status, user.SysNo));
 }