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; }
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()); }