示例#1
0
        public ActionResult Delete(int salesOrderStatusId)
        {
            SalesOrderStatus deletedSalesOrderStatus = shoeStoreRepository.DeleteSalesOrderStatus(salesOrderStatusId);

            if (deletedSalesOrderStatus != null)
            {
                TempData["message"] = MessageHelper.BuildMessage(EnumSevereLevel.Success, string.Format("{0} was deleted!", deletedSalesOrderStatus.SalesOrderStatusName));
            }
            return(RedirectToAction("List"));
        }
        public SalesOrderStatus DeleteSalesOrderStatus(int salesOrderStatusId)
        {
            SalesOrderStatus dbEntry = context.SalesOrderStatuss.Find(salesOrderStatusId);

            if (dbEntry != null)
            {
                context.SalesOrderStatuss.Remove(dbEntry);
                context.SaveChanges();
            }
            return(dbEntry);
        }
示例#3
0
        public string GetOrderDetailsReasonInSOStatus(Stream Parameterdetails)
        {
            string JsonStringForSerialized = "";

            try
            {
                SalesOrderStatus objSalesOrderStatus = new SalesOrderStatus();
                JsonStringForSerialized = objSalesOrderStatus.GetOrderDetailsReasonInSOStatus(Parameterdetails);
            }
            catch { }
            return(JsonStringForSerialized);
        }
示例#4
0
        public SalesorderChangeInfo(string orderType, SalesOrderStatus status, bool isSuccessed)
        {
            this.SalesorderType = orderType;

            this.ChangeToStatus = status;
            this.IsSuccessed    = isSuccessed;

            ChangeInfo = new Dictionary <string, object>();
            ChangeInfo.Add("opTypeId", "");
            ChangeInfo.Add("opDesc", "");
            ChangeInfo.Add("opType", "");
        }
示例#5
0
        /// <summary>
        /// Convert SalesOrderStatus to SalesStatus
        /// </summary>
        /// <param name="salesOrderStatus">SalesOrderStatus</param>
        /// <returns>SalesStatus</returns>
        internal static DE.SalesStatus GetSalesStatus(SalesOrderStatus salesOrderStatus)
        {
            switch (salesOrderStatus)
            {
            case SalesOrderStatus.Backorder:    return(DE.SalesStatus.Created);

            case SalesOrderStatus.Delivered:    return(DE.SalesStatus.Delivered);

            case SalesOrderStatus.Invoiced:     return(DE.SalesStatus.Invoiced);

            case SalesOrderStatus.Canceled:     return(DE.SalesStatus.Canceled);

            default:                            return(DE.SalesStatus.Unknown);
            }
        }
示例#6
0
 public ActionResult Edit(SalesOrderStatus salesOrderStatus)
 {
     if (ModelState.IsValid)
     {
         shoeStoreRepository.SaveSalesOrderStatus(salesOrderStatus);
         TempData["message"] = MessageHelper.BuildMessage(EnumSevereLevel.Success, string.Format("{0} has been created!", salesOrderStatus.SalesOrderStatusName));
         return(RedirectToAction("List"));
     }
     else
     {
         //There is something wrong with the data values
         TempData["message"] = MessageHelper.BuildMessage(EnumSevereLevel.Error, "There is something wrong with the data values, please check!");
         return(View(salesOrderStatus));
     }
 }
        protected override void ExecuteWorkflowLogic()
        {
            var fulfillSalesOrderRequest = new FulfillSalesOrderRequest()
            {
                Status     = SalesOrderStatus.Get(Context.ExecutionContext),
                OrderClose = new Entity("orderclose")
                {
                    ["subject"]      = Subject.Get(Context.ExecutionContext),
                    ["salesorderid"] = SalesOrder.Get(Context.ExecutionContext),
                    ["actualend"]    = CloseDate.Get(Context.ExecutionContext),
                    ["description"]  = Description.Get(Context.ExecutionContext)
                }
            };

            Context.UserService.Execute(fulfillSalesOrderRequest);
        }
 public void SaveSalesOrderStatus(SalesOrderStatus salesOrderStatus)
 {
     if (salesOrderStatus.SalesOrderStatusId == 0)
     {
         context.SalesOrderStatuss.Add(salesOrderStatus);
     }
     else
     {
         SalesOrderStatus dbEntry = context.SalesOrderStatuss.Find(salesOrderStatus.SalesOrderStatusId);
         if (dbEntry != null)
         {
             dbEntry.SalesOrderStatusName = salesOrderStatus.SalesOrderStatusName;
             dbEntry.IsActivated          = salesOrderStatus.IsActivated;
             dbEntry.Sequence             = salesOrderStatus.Sequence;
         }
     }
     context.SaveChanges();
 }
        /// <summary>
        /// 获取对应销售单下相应状态的行项信息
        /// </summary>
        /// <param name="SOID"></param>
        /// <param name="Status"></param>
        /// <returns></returns>
        public List <ConSalesOrderRowInputDto> GetOrderRowsByStatus(string SOID, SalesOrderStatus Status)
        {
            var Rows   = _ConSalesOrderRowReposity.GetOrderRowsByStatus(SOID, (int)Status).AsNoTracking();
            var result = from Row in Rows
                         join Cons in _SMOWMSDbContext.Consumableses on Row.CID equals Cons.CID
                         select new ConSalesOrderRowInputDto()
            {
                CID            = Row.CID,
                NAME           = Cons.NAME,
                IMAGE          = Cons.IMAGE,
                SPECIFICATION  = Cons.SPECIFICATION,
                REALPRICE      = Row.REALPRICE,
                QUANTSALED     = Row.QUANTSALED,
                QUANTOUT       = Row.QUANTOUT,
                QUANTRETREATED = Row.QUANTRETREATED
            };

            return(result.AsNoTracking().ToList());
        }
        Color GetStatusColor(SalesOrderStatus status)
        {
            switch (status.description) {

                case "Pending" :
                    return Color.Orange;
                case "In Process" :
                    return Color.Yellow;
                case "Shipped" :
                    return Color.Cyan;
                case "Closed" :
                    return Color.Green;
                case "Canceled":
                    return Color.Red;
                default :
                    return Color.White;

            }
        }
示例#11
0
        /// <summary>
        /// Gets the SalesStatus from SalesOrderStatus and DocumentStatus
        /// </summary>
        /// <param name="docStatus"></param>
        /// <param name="salesOrderStatus"></param>
        /// <returns></returns>
        internal static SalesStatus GetSalesStatus(SalesOrderStatus salesOrderStatus, DocumentStatus docStatus)
        {
            SalesStatus salesStatus = GetSalesStatus(salesOrderStatus);

            switch (salesStatus)
            {
            case SalesStatus.Unknown:
            case SalesStatus.Created:
                SalesStatus documentStatus = GetSalesStatus(docStatus);
                if (documentStatus == SalesStatus.Unknown)
                {
                    return(salesStatus);
                }

                return(documentStatus);

            default:
                return(salesStatus);
            }
        }
示例#12
0
 /// <summary>
 /// 初始化一个<c>SalesOrder</c>类型实例。
 /// </summary>
 public SalesOrder()
 {
     dateCreated = DateTime.Now;
     status      = SalesOrderStatus.Created;
 }
示例#13
0
 /// <summary>
 /// 初始化一个<c>SalesOrder</c>类型实例。
 /// </summary>
 public SalesOrder()
 {
     dateCreated = DateTime.Now;
     status = SalesOrderStatus.Created;
 }
示例#14
0
 public SalesOrderBuilder Status(SalesOrderStatus status)
 {
     salesOrder.Status = status;
     return(this);
 }
示例#15
0
        public DataTable GetDataTable(bool isCreatedBy, SalesOrderStatus orderStatus, string incomePhoneNumber, string selectedPhoneNumber, Dictionary <string, QueryItemDomainModel> queryCollection)
        {
            #region MyRegion
            DataTable dt = new DataTable();


            StringBuilder       sqlBuilder = new StringBuilder();
            ParameterCollection pc         = new ParameterCollection();
            sqlBuilder.Append(@"
  customer_basic_info.created_on as customer_create_on,pay_card_number,pay_card_period,pay_card_securitycode
,order_source=(SELECT data_value FROM custom_data_value WHERE value_id=order_source),pay_card_bank_id=(SELECT data_value FROM custom_data_value where value_id=pay_card_bank_id)
 ,opening_time,collection_card_number,collection_customer_name,mobile_phone,home_phone,other_phone
 ,collection_bank_id  =(SELECT data_value FROM custom_data_value where value_id=package.collection_bank_id)
 ,package.idcard_number,package.owner_customer_name,charge_user_id=(select created_user_info.cn_name from user_info where user_id=charge_user_id)
,recover_time,sign_time,salesorder_basic_info.remark,need_invoice= case when pay_type='0' then '是' when pay_type='1' then '否' end 
,delivery_address,delivery_receive_phonenumber,delivery_receive_customer_name,charge_time, package.bind_main_phonenumber
,package.bind_subsidiary_phonenumber,category_name, sex= case when pay_type='0' then '男' when pay_type='1' then '女' end 
,salesorder_basic_info.delivery_time,salesorder_basic_info.approval_time,salesorder_basic_info.salesorder_code, customer_basic_info.customer_name
,custom_data_value.data_value,salesorder_basic_info.pay_price,pay_type= case when pay_type='0' then '分期' when pay_type='1' then '全额' when pay_type='2' then '到付' when pay_type='3' then '在线支付' end 
,created_user_info.cn_name,salesorder_basic_info.created_on
 FROM salesorder_basic_info

LEFT JOIN  customer_basic_info
 ON salesorder_basic_info.customer_id = customer_basic_info.customer_id
LEFT JOIN  custom_data_value
ON
 salesorder_basic_info.pay_idcard_type_id=custom_data_value.value_id
 
 LEFT JOIN
    user_info as created_user_info
ON
    salesorder_basic_info.created_by = created_user_info.user_id
    
LEFT JOIN
   salesorder_communiationpackage_info as package
ON
    salesorder_basic_info.salesorder_id = package.salesorder_id
    
LEFT JOIN
   product_category_info as product
ON
     package.bind_communiationpackage_id = product.product_category_id

WHERE 
    1 = 1
    
 ");
            if (orderStatus != SalesOrderStatus.All)
            {
                if (orderStatus == SalesOrderStatus.Exception)
                {
                    sqlBuilder.Append(@" AND is_exception = 0 ");
                }
                else
                {
                    sqlBuilder.Append(@" AND now_order_status_id = $orderStatus$ and is_exception<>0");
                    pc.Add("orderStatus", Convert.ToInt32(orderStatus));
                }
            }



            #region 根据用户名查询
            if (isCreatedBy == true)
            {
                sqlBuilder.Append(@" AND salesorder_basic_info.created_by = $created_by$  ");

                pc.Add("created_by", SessionUtil.Current.UserId);
            }
            #endregion
            #region 所选号码查询条件

            if (!string.IsNullOrEmpty(selectedPhoneNumber))
            {
                sqlBuilder.Append(@" AND salesorder_basic_info.salesorder_id IN (SELECT salesorder_basic_info.salesorder_id FROM salesorder_communiationpackage_info WHERE bind_main_phonenumber = $selectedPhoneNumber$ or bind_subsidiary_phonenumber = $selectedPhoneNumber$ ) ");

                pc.Add("selectedPhoneNumber", selectedPhoneNumber);
            }

            #endregion

            #region 来电号码查询条件

            if (string.IsNullOrEmpty(incomePhoneNumber) == false)
            {
                sqlBuilder.Append(@" AND customer_basic_info.customer_id IN (SELECT customer_basic_info.customer_id FROM customer_phone_info WHERE phone_number LIKE $incomePhoneNumber$)");

                pc.Add("incomePhoneNumber", string.Format("%{0}%", incomePhoneNumber));
            }

            #endregion

            #region 构造查询条件
            int count = 0;
            foreach (QueryItemDomainModel item in queryCollection.Values)
            {
                switch (item.Operation)
                {
                case "equal":
                    sqlBuilder.AppendFormat(@" AND {0} = $value{1}$", item.FieldType, count);
                    pc.Add("value" + count.ToString(), item.SearchValue);
                    break;

                case "notequal":
                    sqlBuilder.AppendFormat(@" AND {0} <> $value{1}$", item.FieldType, count);
                    pc.Add("value" + count.ToString(), item.SearchValue);
                    break;

                case "contain":
                    sqlBuilder.AppendFormat(@" AND {0} LIKE $value{1}$", item.FieldType, count);
                    pc.Add("value" + count.ToString(), "%" + item.SearchValue + "%");
                    break;

                case "greater":
                    sqlBuilder.AppendFormat(@" AND {0} > $value{1}$", item.FieldType, count);
                    pc.Add("value" + count.ToString(), item.SearchValue);
                    break;

                case "greaterequal":
                    sqlBuilder.AppendFormat(@" AND {0} >= $value{1}$", item.FieldType, count);
                    pc.Add("value" + count.ToString(), item.SearchValue);
                    break;

                case "less":
                    sqlBuilder.AppendFormat(@" AND {0} < $value{1}$", item.FieldType, count);
                    pc.Add("value" + count.ToString(), item.SearchValue);
                    break;

                case "lessequal":
                    sqlBuilder.AppendFormat(@" AND {0} <= $value{1}$", item.FieldType, count);
                    pc.Add("value" + count.ToString(), item.SearchValue);
                    break;

                case "between":
                    sqlBuilder.AppendFormat(@" AND {0} BETWEEN $begin{1}$ AND $end{1}$", item.FieldType, count);
                    pc.Add("begin" + count.ToString(), item.BeginTime);
                    pc.Add("end" + count.ToString(), item.EndTime);
                    break;

                case "today":
                    sqlBuilder.AppendFormat(@" AND DATEDIFF(DAY,{0},GETDATE()) = 0", item.FieldType);
                    break;

                case "week":
                    sqlBuilder.AppendFormat(@" AND DATEDIFF(WEEK,{0},GETDATE()) = 0", item.FieldType);
                    break;

                case "month":
                    sqlBuilder.AppendFormat(@" AND DATEDIFF(MONTH,{0},GETDATE()) = 0", item.FieldType);
                    break;

                case "quarter":
                    sqlBuilder.AppendFormat(@" AND DATEDIFF(QUARTER,{0},GETDATE()) = 0", item.FieldType);
                    break;

                case "year":
                    sqlBuilder.AppendFormat(@" AND DATEDIFF(YEAR,{0},GETDATE()) = 0", item.FieldType);
                    break;

                default:
                    break;
                }

                count++;
            }

            #endregion

            dt = ExecuteDataTable("SELECT  " + sqlBuilder.ToString(), pc);



            return(dt);

            #endregion
        }
示例#16
0
 /// <summary>
 /// 当客户完成收货后,对销售订单进行确认。
 /// </summary>
 public void Confirm()
 {
     this.status = SalesOrderStatus.Delivered;
     this.dateDelivered = DateTime.Now;
 }
示例#17
0
 public void Complete()
 {
     Status = SalesOrderStatus.Completed;
 }
 internal static Expression <Func <SalesOrder, bool> > ByCustomerOrderStatus(SalesOrderStatus status)
 {
     return(o => o.OrderStatus == status);
 }
示例#19
0
 public void ChangeStatus(SalesOrderStatus status)
 {
     Status = status;
 }
示例#20
0
        public void ApprovedSalesOrderLine()
        {
            if (OrderStatus == SalesOrderStatus.Waiting)
            {
                _ApprovedBy = CurrentUser;
                OnChanged("ApprovedBy");

                _ApprovedDate = ServerHelper.GetCurrentDateTime();
                OnChanged("ApprovedDate");

                _OrderStatus = SalesOrderStatus.Active;
                OnChanged("OrderStatus");

                AddHistory("核准销售单");

                SalesOrder.UpdateOrderStatus();
                SalesOrder.Save();
                Save();
            }
        }
示例#21
0
        public void CancelApprovedSalesOrderLine()
        {
            if (OrderStatus == SalesOrderStatus.Active)
            {
                _ApprovedBy = "";
                OnChanged("ApprovedBy");

                _ApprovedDate = Convert.ToDateTime(null);
                OnChanged("ApprovedDate");

                AddHistory("取消核准");
                _OrderStatus = SalesOrderStatus.Waiting;
                OnChanged("OrderStatus");

                SalesOrder.UpdateOrderStatus();
                SalesOrder.Save();
                Save();
            }
        }
示例#22
0
        public ViewResult Edit(int salesOrderStatusId)
        {
            SalesOrderStatus SalesOrderStatus = shoeStoreRepository.SalesOrderStatuss.FirstOrDefault(p => p.SalesOrderStatusId == salesOrderStatusId);

            return(View(SalesOrderStatus));
        }
示例#23
0
        public void UpdateBalQty()
        {
            if (IsLoading)
                return;

            _BalQty = _NeedQty - _ShipQty - _CancelQty;
            OnChanged("BalQty");

            if (_BalQty < 0)
            {
                throw new Exception(String.Format("销售单({0}), 产品({1}) 余数不能小于0.", SalesOrder.OrderNo, Item.ItemNo));
            }

            if (BalQty == 0 && OrderStatus != SalesOrderStatus.Complete)
            {
                _OrderStatus = SalesOrderStatus.Complete;
                OnChanged("OrderStatus");
                SalesOrder.UpdateOrderStatus();
                SalesOrder.Save();
            }

            if (BalQty > 0 && _OrderStatus == SalesOrderStatus.Complete)
            {
                _OrderStatus = SalesOrderStatus.Active;
                OnChanged("OrderStatus");
                SalesOrder.UpdateOrderStatus();
                SalesOrder.Save();
            }
        }