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 }));
        }
        public ActionResult Index(FormCollection form)
        {
            var svOrderlist = new OrderPurchaseService();

            SelectList_PageSize();
            SetPager(form);
            var GetOrder = svOrderlist.SelectData <View_HistoryOrder>("*", "IsDelete = 0 and CompID = " + LogonCompID, "CreatedDate DESC", (int)ViewBag.PageIndex, (int)ViewBag.PageSize);

            ViewBag.GetOrder  = GetOrder;
            ViewBag.TotalPage = svOrderlist.TotalPage;
            ViewBag.TotalRow  = svOrderlist.TotalRow;
            //var products = svProduct.SelectData<view_SearchProduct>("ProductID,ProductName", "IsDelete = 0 and CompID =" + LogonCompID);
            //ViewBag.Products = products;

            return(PartialView("UC/ListGrid"));
        }
        public ActionResult Index(FormCollection form)
        {
            var svOrderPur = new OrderPurchaseService();

            SelectList_PageSize();
            SetPager(form);
            var getOrderDetail = svOrderPur.SelectData <View_OuikumOrderDetailSC>("*", "StatusProduct != 'D' AND IsDelete = 0 and CompSCID = " + LogonCompID, "StatusProduct,ModifiedDate asc", (int)ViewBag.PageIndex, (int)ViewBag.PageSize);

            ViewBag.OrderDetail = getOrderDetail;
            ViewBag.TotalPage   = svOrderPur.TotalPage;
            ViewBag.TotalRow    = svOrderPur.TotalRow;
            //var products = svProduct.SelectData<view_SearchProduct>("ProductID,ProductName", "IsDelete = 0 and CompID =" + LogonCompID);
            //ViewBag.Products = products;

            return(PartialView("Grid/GridOrderPurchase"));
        }
        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 }));
        }
Exemple #5
0
        public void CountQuotation()
        {
            string SQLWhere    = "";
            var    svQuotation = new QuotationService();
            var    svOrderPur  = new OrderPurchaseService();

            SQLWhere         = svQuotation.CreateWhereAction(QuotationAction.CountQuotation, LogonCompID);
            SQLWhere        += " AND (IsRead = 0)";
            ViewBag.QuoCount = svQuotation.SelectData <b2bQuotation>("QuotationID", SQLWhere, "QuotationID", 1, 0).Count;

            var SQLWhereList = svQuotation.CreateWhereAction(QuotationAction.BackEnd, LogonCompID);

            ViewBag.QuoCountList = svQuotation.SelectData <b2bQuotation>("QuotationID", SQLWhereList, "QuotationID", 1, 0).Count;

            SQLWhere         = svOrderPur.CreateWhereAction(OrderPurchaseAction.CountOrderPurchase, LogonCompID);
            ViewBag.CountOrP = svOrderPur.SelectData <OuikumOrderDetail>("OrDetailID", SQLWhere, "OrDetailID", 1, 0).Count;
        }
Exemple #6
0
        public ActionResult Index()
        {
            //if (RedirectToProduction())
            //    return Redirect(UrlProduction);

            LoadProductShowcase();
            LoadHotProduct();
            LoadRecently();
            LoadCategory();
            LoadFeatureProduct();
            LoadRandomCompany();
            LoadRandomBanner();
            GetStatusUser();
            LoadDataBidProduct();
            LoadSuccessStory();
            GetEnumServiceType();
            //search
            LoadProvinces();
            LoadBiztype();

            #region CheckIsLogin
            if (CheckIsLogin())
            {
                MessageService       svMessage   = new MessageService();
                QuotationService     svQuotation = new QuotationService();
                OrderPurchaseService svOrderPur  = new OrderPurchaseService();
                string SQLWhere = "";

                string sqlwhere = svMessage.CreateWhereAction(MessageStatus.UnRead, LogonCompID);
                int    count    = svMessage.CountData <emMessage>("MessageID", sqlwhere);
                ViewBag.UnRead = count;

                SQLWhere         = svQuotation.CreateWhereAction(QuotationAction.CountQuotation, LogonCompID);
                ViewBag.CountQuo = svQuotation.SelectData <b2bQuotation>("QuotationID", SQLWhere, "QuotationID", 1, 0).Count;

                SQLWhere         = svOrderPur.CreateWhereAction(OrderPurchaseAction.CountOrderPurchase, LogonCompID);
                ViewBag.CountOrP = svOrderPur.SelectData <OuikumOrderDetail>("OrDetailID", SQLWhere, "OrDetailID", 1, 0).Count;
            }
            #endregion

            ViewBag.FBAccessToken = GetAppSetting("FBPageAccessToken");
            ViewBag.Page          = "Home";

            return(View());
        }