public JsonResult GetEditOrderStatus(string OrDetailID)
        {
            var           svOrderPurchase = new OrderPurchaseService();
            var           svOrderStauts   = new OrderStatusService();
            CommonService svCommon        = new CommonService();
            string        SQLWhere        = string.Empty;
            //var EnumHotFeatStatus = svCommon.SelectEnum(CommonService.EnumType.HotFeatStatus);
            //var orderIsShow = svOrder.SelectData<b2bPackage>("PackageID,PackageName,Price,Duratrion", "IsDelete = 0 AND IsShow = 0 AND CheckUpdate = 1", "PackageID ASC");
            var data = svOrderPurchase.SelectData <View_OuikumOrderDetailSC>("OrDetailID,OrDetailcode,ProductName,StatusProduct", "IsDelete = 0 AND OrDetailID = " + OrDetailID);

            SQLWhere = svOrderStauts.CreateWhereAction(OrderStatusAction.ConfirmBySC, LogonCompID);
            var Status = svOrderStauts.SelectData <OuikumStausOrder>("NameStatus", SQLWhere, "NameStatus", 1, 0);


            //return Json(new { IsResult = true, Price = (String.Format("{0:##,###.00}", data.First().PackagePrice)), Duration = data.First().Duration, PackageID = data.First().PackageID, EnumHotFeatStatus = EnumHotFeatStatus, orderIsShow = orderIsShow });
            return(Json(new { IsResult = true, OrDetailCode = data.First().OrDetailCode, ProductName = data.First().ProductName, StatusProduct = data.First().StatusProduct }));
        }
        public ActionResult SaveStatus(string OrDetailCode, string StatusProduct)
        {
            OuikumOrderDetail orDetial = new OuikumOrderDetail();
            var    svOrderPur          = new OrderPurchaseService();
            var    svOrderStauts       = new OrderStatusService();
            string SQLWhere            = string.Empty;

            try
            {
                var GetorderDetail = svOrderPur.SelectData <View_OuikumOrderDetailSC>("OrDetailID,OrDetailcode,ProductID,ProductName,StatusProduct", "IsDelete = 0 AND OrDetailCode = '" + OrDetailCode + "'").First();
                SQLWhere = svOrderStauts.CreateWhereAction(OrderStatusAction.ConfirmBySC, LogonCompID);
                var Status = svOrderPur.SelectData <OuikumStausOrder>("NameStatus", SQLWhere, "NameStatus", 1, 0);

                orDetial.OrDetailID = GetorderDetail.OrDetailID;
                if (GetorderDetail.StatusProduct == "A")
                {
                    orDetial.StatusProduct = "B";
                }
                else if (GetorderDetail.StatusProduct == "B")
                {
                    orDetial.StatusProduct = "C";
                }
                else
                {
                    orDetial.StatusProduct = "D";
                }
                orDetial.ProductID    = GetorderDetail.ProductID;
                orDetial.ModifiedDate = DateTime.Now;

                #region Update Satatus OrderDetail

                svOrderPur.UpdateStatusOrder(orDetial);
                #endregion
            }
            catch (Exception ex)
            {
                return(Json(new { IsSuccess = false }));
            }

            return(Json(new { IsSuccess = true }));
        }