public OrderlistController()
 {
     svBizType  = new BizTypeService();
     svMember   = new MemberService();
     svAddress  = new AddressService();
     svCompany  = new CompanyService();
     svProduct  = new ProductService();
     svShipment = new ShipmentService();
     svOrderPur = new OrderPurchaseService();
 }
예제 #2
0
        public void MyB2BStatus(int CompID)
        {
            var    svProduct   = new ProductService();
            var    svBuylead   = new BuyleadService();
            var    svMessage   = new MessageService();
            var    svQuotation = new QuotationService();
            var    svOrderPur  = new OrderPurchaseService();
            string sqlwhere    = string.Empty;
            //string sqlwhere = svProduct.CreateWhereAction(ProductAction.All, CompID);
            var count = 0;

            //var sqlwherein = "";
            //    switch (res.Common.lblWebsite)
            //    {
            //        case "B2BThai": sqlwherein = " AND CategoryType IN (1,2)"; break;
            //        case "AntCart": sqlwherein = " AND CategoryType IN (3)"; break;
            //        case "myOtopThai": sqlwherein = " AND CategoryType IN (5)"; break;
            //        case "AppstoreThai": sqlwherein = " AND CategoryType IN (6)"; break;
            //        default: sqlwherein = ""; break;
            //    }sqlwhere += sqlwherein;
            sqlwhere = svProduct.CreateWhereAction(ProductAction.All, CompID);

            count = svProduct.CountData <view_SearchProduct>("ProductID", sqlwhere);
            ViewBag.CountProduct = count;

            sqlwhere = svProduct.CreateWhereAction(ProductAction.All, CompID) + " AND RowFlag = 3";
            count    = svProduct.CountData <view_SearchProduct>("ProductID", sqlwhere);
            ViewBag.CountProductReject = count;

            sqlwhere = svProduct.CreateWhereAction(ProductAction.All, CompID) + " AND RowFlag IN (2)";
            count    = svProduct.CountData <view_SearchProduct>("ProductID", sqlwhere);
            ViewBag.CountProductWait = count;

            sqlwhere = svProduct.CreateWhereAction(ProductAction.All, CompID) + " AND RowFlag IN (4,5)";
            count    = svProduct.CountData <view_SearchProduct>("ProductID", sqlwhere);
            ViewBag.CountProductApprove = count;
            //sqlwhere = svBuylead.CreateWhereAction(BuyleadAction.All, CompID);
            //count = svProduct.CountData<b2bBuylead>("BuyleadID", sqlwhere);
            //ViewBag.CountBuylead = count;

            //sqlwhere = svBuylead.CreateWhereAction(BuyleadAction.All, CompID) + " AND RowFlag = 3 ";
            //count = svBuylead.CountData<b2bBuylead>("BuyleadID", sqlwhere);
            //ViewBag.CountBuyleadReject = count;

            //sqlwhere = svMessage.CreateWhereAction(MessageStatus.Inbox, CompID);
            //count = svMessage.CountData<emMessage>("MessageID", sqlwhere);
            //ViewBag.Inbox = count;

            sqlwhere       = svMessage.CreateWhereAction(MessageStatus.UnRead, CompID);
            count          = svMessage.CountData <emMessage>("MessageID", sqlwhere);
            ViewBag.UnRead = count;
        }
        // GET: MyB2B/OrderPurchase
        public ActionResult Index()
        {
            var svOrderPur = new OrderPurchaseService();

            RememberURL();
            if (!CheckIsLogin())
            {
                return(Redirect(res.Pageviews.PvMemberSignIn));
            }
            else
            {
                GetStatusUser();
                return(View());
            }
        }
        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 }));
        }
예제 #7
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;
        }
예제 #8
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());
        }
예제 #9
0
        public CartController()
        {
            svCart           = new CartService();
            svProduct        = new ProductService();
            svCompany        = new CompanyService();
            svAddress        = new AddressService();
            svMember         = new MemberService();
            svShipment       = new ShipmentService();
            svCommon         = new CommonService();
            svOrderPur       = new OrderPurchaseService();
            svWeb            = new WebService();
            AppName          = res.Common.lblWebsite;
            RememberAppName  = string.Concat("Remember", AppName);
            svAuthentication = new AuthenticationService();

            emailManager = new EmailManager(res.Config.SMTP_Server, res.Config.SMTP_UserName, res.Config.SMTP_Password, Convert.ToBoolean(res.Config.SMTP_IsAuthentication));
            mail         = new Mail();
        }
        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 }));
        }