コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                dtfInfo = DateTimeFormatInfo.InvariantInfo;
                MODEL.Criteria.reqDashboard req = new MODEL.Criteria.reqDashboard();
                hdMemberID.Value     = getMemberID();
                hdRestaurantID.Value = getRestaurantID();
                //req.RestaurantID = HttpContext.Current.Application["app_memberID"].ToString().Trim();
                //req.RestaurantID = Session["session_restaurantID"].ToString().Trim();
                req.RestaurantID = hdRestaurantID.Value;

                req.DashboardDate = DateTime.Today.ToString("MM/dd/yyyy", dtfInfo);

                initDashBoard();

                DAL.Dashboard          sv    = new DAL.Dashboard();
                MODEL.DashboardCashier model = new MODEL.DashboardCashier();
                model = sv.getDashboardCashier(req);
                if (model.ResultOk == "true")
                {
                    //    lblFoodsOrder.InnerText = model.FoodsOrder;
                    //    lblCountTable.InnerText = model.CountTable;
                    //   lblSalesOrder.InnerText = model.CountSalesOrderPerDay;
                    //   lblNoticeBill.InnerText = model.CountNoticeBill;
                    repMain.DataSource = model.list;
                    repMain.DataBind();
                }
                else
                {
                }
            }
        }
コード例 #2
0
        private void initDashBoard()
        {
            MODEL.Criteria.reqDashboard req = new MODEL.Criteria.reqDashboard();
            BLL.DashBoard _BLL = new BLL.DashBoard();
            String        SumPrice;
            String        CountTable;
            String        CountUser;
            String        FoodPending;
            String        CountFood;
            String        CountDrink;

            hdMemberID.Value     = getMemberID();
            hdRestaurantID.Value = getRestaurantID();
            req.RestaurantID     = hdRestaurantID.Value;
            req.DashboardDate    = DateTime.Today.ToString("MM/dd/yyyy", dtfInfo);

            SumPrice = _BLL.getSumPrice(req);
            lblSumPrice.InnerText = SumPrice;

            CountTable = _BLL.getCountTable(req);
            lblCountTable.InnerText = CountTable;

            CountUser = _BLL.getUserBuy(req);
            lblCountUser.InnerText = CountUser;

            FoodPending = _BLL.getFoodPending(req);
            lblFoodPending.InnerText = FoodPending;

            CountDrink = _BLL.getCountDrink(req);
            lblCountDrink.InnerText = CountDrink;

            CountFood = _BLL.getCountFood(req);
            lblCountFood.InnerText = CountFood;
        }
コード例 #3
0
 public MODEL.DashboardCashier getDashboardCashier([FromBody] MODEL.Criteria.reqDashboard req)
 {
     MODEL.DashboardCashier result = new MODEL.DashboardCashier();
     result.ResultOk = "false";
     try
     {
         if (req != null)
         {
             result.ResultOk              = "true";
             result.ErrorMessage          = "";
             result.FoodsOrder            = "15";
             result.CountTable            = "2";
             result.CountSalesOrderPerDay = "45,000";
             List <Bill> listBill = new List <Bill>();
             Bill        mBill;
             mBill                = new Bill();
             mBill.billID         = "20191020002";
             mBill.billNo         = "20191020002";
             mBill.billCreateDate = "20-10-2019 08:30:00";
             mBill.billCreateName = "sombut";
             mBill.billTableName  = "10";
             mBill.billMenuCount  = "6";
             mBill.billTotalPrice = "4000";
             mBill.billStatusText = "Complete";
             listBill.Add(mBill);
             mBill                = new Bill();
             mBill.billID         = "20191020003";
             mBill.billNo         = "20191020003";
             mBill.billCreateDate = "20-10-2019 10:30:00";
             mBill.billCreateName = "nathan";
             mBill.billTableName  = "15";
             mBill.billMenuCount  = "4";
             mBill.billTotalPrice = "7500";
             mBill.billStatusText = "Complete";
             listBill.Add(mBill);
             result.list = listBill;
         }
     }
     catch (Exception e)
     {
         result.ErrorMessage = e.Message;
         result.ResultOk     = "false";
     }
     finally
     {
     }
     return(result);
 }
コード例 #4
0
        public string getCountDrink(MODEL.Criteria.reqDashboard req)
        {
            SqlConnection conn = new SqlConnection(DataHelper.GetConnectionString());
            DataSet       ds   = new DataSet();
            String        ret  = "0";
            DataTable     tb;


            try
            {
                conn.Open();

                string         Sql;
                SqlDataAdapter adp = new SqlDataAdapter("sp_GetCountDrink", conn);
                adp.SelectCommand.CommandType = CommandType.StoredProcedure;
                adp.SelectCommand.Parameters.Add(new SqlParameter("@restaurantID", req.RestaurantID));
                adp.SelectCommand.Parameters.Add(new SqlParameter("@StartDate", req.DashboardDate + " 00:00"));
                adp.SelectCommand.Parameters.Add(new SqlParameter("@EndDate", req.DashboardDate + " 23:59"));
                //adp.Fill(ds);
                adp.Fill(ds);
                tb = ds.Tables[0];
                if (tb.Rows.Count > 0)
                {
                    ret = tb.Rows[0][0].ToString();
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                conn.Close();
            }
            return(ret);
        }
コード例 #5
0
 public string getCountDrink(MODEL.Criteria.reqDashboard req)
 {
     return(DashboardDAL.getCountDrink(req));
 }
コード例 #6
0
 public string getFoodPending(MODEL.Criteria.reqDashboard req)
 {
     return(DashboardDAL.getFoodPending(req));
 }
コード例 #7
0
 public string getUserBuy(MODEL.Criteria.reqDashboard req)
 {
     return(DashboardDAL.getUserBuy(req));
 }
コード例 #8
0
 public string getSumPrice(MODEL.Criteria.reqDashboard req)
 {
     return(DashboardDAL.getSumPrice(req));
 }
コード例 #9
0
 public MODEL.DashboardCashier getDashboardCashier(MODEL.Criteria.reqDashboard req)
 {
     return(DashboardDAL.getDashboardCashier(req));
 }
コード例 #10
0
        public MODEL.DashboardCashier getDashboardCashier(MODEL.Criteria.reqDashboard req)
        {
            SqlConnection conn = new SqlConnection(DataHelper.GetConnectionString());
            DataSet       ds   = new DataSet();

            MODEL.DashboardCashier result = new MODEL.DashboardCashier();
            List <Bill>            bill   = new List <Bill>();

            try
            {
                conn.Open();

                string         Sql;
                SqlDataAdapter adp = new SqlDataAdapter("sp_getDashboard_Cashier", conn);
                adp.SelectCommand.CommandType = CommandType.StoredProcedure;
                adp.SelectCommand.Parameters.Add(new SqlParameter("@restaurantID", req.RestaurantID));
                adp.SelectCommand.Parameters.Add(new SqlParameter("@StartDate", req.DashboardDate + " 00:00"));
                adp.SelectCommand.Parameters.Add(new SqlParameter("@EndDate", req.DashboardDate + " 23:59"));
                //adp.Fill(ds);
                adp.Fill(ds);
                if (ds.Tables.Count > 0)
                {
                    result.ResultOk              = "true";
                    result.FoodsOrder            = ds.Tables[0].Rows[0][0].ToString().Trim();
                    result.CountTable            = ds.Tables[1].Rows[0][0].ToString().Trim();
                    result.CountSalesOrderPerDay = ds.Tables[2].Rows[0][0].ToString().Trim();
                    result.CountNoticeBill       = ds.Tables[3].Rows[0][0].ToString().Trim();
                    if (ds.Tables[4].Rows.Count > 0)
                    {
                        DataTable dt = new DataTable();
                        dt = ds.Tables[4];
                        Bill f;
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            f                = new Bill();
                            f.queue_no       = dt.Rows[i]["queue_no"].ToString().Trim();
                            f.billNo         = dt.Rows[i]["order_no"].ToString().Trim();
                            f.billTableName  = dt.Rows[i]["table_name"].ToString().Trim();
                            f.billMenuCount  = dt.Rows[i]["CountFoods2"].ToString().Trim();
                            f.billTotalPrice = dt.Rows[i]["SumPrice2"].ToString().Trim();
                            f.billStatusText = dt.Rows[i]["status_order"].ToString().Trim();
                            bill.Add(f);
                        }
                    }
                    result.list = bill;
                }
                else
                {
                    result.ResultOk = "false";
                }
            }
            catch (Exception ex)
            {
                result.ResultOk     = "false";
                result.ErrorMessage = ex.Message;
            }
            finally
            {
                conn.Close();
            }
            return(result);
        }
コード例 #11
0
        public DashboardKitchen getDashboardKitchen([FromBody] MODEL.Criteria.reqDashboard req)
        {
            DashboardKitchen result = new DashboardKitchen();

            result.resultOk = "false";
            try
            {
                if (req != null)
                {
                    result.resultOk          = "true";
                    result.errorMessage      = "";
                    result.CountFoodsPending = "15";
                    result.CountFoodPerDay   = "2";
                    result.MenuUrgent        = "10";
                    List <Food> listFood = new List <Food>();
                    Food        mFood;
                    mFood = new Food();
                    mFood.menuFoodsName = "Meet Steak";
                    mFood.tableName     = "Table 1";
                    mFood.menuStatus    = "Wait";
                    listFood.Add(mFood);
                    mFood = new Food();
                    mFood.menuFoodsName = "Pork Steak";
                    mFood.tableName     = "Table 1";
                    mFood.menuStatus    = "Wait";
                    listFood.Add(mFood);
                    //List<Bill> listBill = new List<Bill>();
                    //Bill mBill;
                    //mBill = new Bill();
                    //mBill.billID = "20191020002";
                    //mBill.billNo = "03";
                    //mBill.billCreateDate = "20-10-2019 08:30:00";
                    //mBill.billCreateName = "sombut";
                    //mBill.billTableName = "10";
                    //mBill.billMenuCount = "6";
                    //mBill.billTotalPrice = "750";
                    //mBill.billStatusText = "Complete";
                    //listBill.Add(mBill);
                    result.list = listFood;


                    //"billID": "20191020002",
                    //"billNo": "03",
                    //"billCreateDate": "20-10-2019 08:30:00",
                    //"billCreateName": "sombut",
                    //"billTableName": "10",
                    //"billMenuCount": "6",
                    //"billTotalPrice": "750",
                    //"billStatusText": "Complete"
                }
            }
            catch (Exception e)
            {
                result.errorMessage = e.Message;
                result.resultOk     = "false";
            }
            finally
            {
            }
            return(result);
        }