Esempio n. 1
0
        /// <summary>
        /// 获取订单中的死信息
        /// </summary>
        /// <param name="UserId"></param>
        /// <param name="BusinessId"></param>
        /// <returns></returns>
        public OrderShow GetOrderShow(int UserId, int BusinessId)
        {
            this.UserId = UserId;
            this.UserId = BusinessId;

            OrderShow order = OrmDBHelper.GetToList <OrderShow>(@"SELECT 
SUM(cd.ToPrice) AS TotalPrice,
c.Id,
u.NickName,
b.Name,
u.PhoneNumber,
b.PhoneNumber AS BusinessNumber,
b.Merchataddress
FROM dbo.CartInfo AS c
JOIN dbo.CartDetails AS cd
ON c.Id = cd.CartId
JOIN dbo.BusinessInfo AS b
ON b.Id = c.BusinessInfo
JOIN dbo.UserInfo AS u
ON c.UserId = u.Id
WHERE c.UserId = " + UserId + " AND c.BusinessInfo = " + BusinessId + " AND c.Sates = 1 GROUP BY b.Name, b.PhoneNumber, c.Id, u.NickName, u.PhoneNumber, b.Merchataddress").FirstOrDefault();

            order.list = GetListOrders(UserId, BusinessId);
            return(order);
        }
Esempio n. 2
0
        private void LoadInfo(string st)
        {
            OrderInfoModel om = new OrderInfoModel();

            om.OrderID = Convert.ToInt32(st);
            oh         = new OrderPayBLL().LoadInfo(om);
        }
Esempio n. 3
0
        public OrderShow Change(OrderShow oh)
        {
            for (int k = 0; k < oh.SeatSum.Length; k++)
            {
                var i      = Convert.ToInt32(oh.SeatSum[k]);
                var zuowei = "";
                if (i % 160 % 16 < oh.NullColOne)
                {
                    zuowei = (int.Parse((i % 160 / 16).ToString()) + 1).ToString() + "排" + (i % 160 % 16).ToString() + "座";
                    if (i % 160 % 16 == 0)
                    {
                        zuowei = int.Parse((i % 160 / 16).ToString()).ToString() + "排" + "14" + "座";
                    }
                }
                else if (i % 160 % 16 < oh.NullColTwo)
                {
                    zuowei = (int.Parse((i % 160 / 16).ToString()) + 1).ToString() + "排" + (i % 160 % 16 - 1).ToString() + "座";
                }
                else if (i % 160 % 16 < 16)
                {
                    zuowei = (int.Parse((i % 160 / 16).ToString()) + 1).ToString() + "排" + (i % 160 % 16 - 2).ToString() + "座";
                }
                oh.SeatSum[k] = zuowei;
            }

            return(oh);
        }
Esempio n. 4
0
    private void Display1String(int i, ProductInfo pInfo, string root)
    {
        var orderShow = OrderShow.Create(root, _products.transform, pInfo);

        orderShow.ShowToSetCurrentProduct(pInfo);

        orderShow.Reset(i);
        _showProducts.Add(orderShow);
    }
Esempio n. 5
0
    static public OrderShow Create(string root, Transform container, ProductInfo prod)
    {
        OrderShow obj = null;

        obj = (OrderShow)Resources.Load(root, typeof(OrderShow));
        obj = (OrderShow)Instantiate(obj, new Vector3(), Quaternion.identity);

        obj.transform.SetParent(container);
        obj.ProductInfo = prod;
        return(obj);
    }
Esempio n. 6
0
        private void btnQueryOrderMarkArrived_Click(object sender, RoutedEventArgs e)
        {
            OrderShow orderShow = dataGridOrderInfoShow.SelectedItem as OrderShow;

            if (orderShow == null)
            {
                MessageBox.Show("请选择一条订单");
                return;
            }
            Order order = new Order();

            order.objectId = orderShow.objectId;
            order.status   = OrderStatus.已送达;
            _presenter.UpdateOrderToArrived(order);
        }
Esempio n. 7
0
        /// <summary>
        /// 生成订单信息
        /// </summary>
        /// <returns></returns>
        public int GenerateOrder(OrderParameter parameter)
        {
            int       res   = 0;
            OrderShow order = GetOrderShow(UserId, BusinessId);

            parameter.OrderId        = order.Id;
            parameter.TotalPrice     = order.TotalPrice;
            parameter.NickName       = order.NickName;
            parameter.Name           = order.Name;
            parameter.PhoneNumber    = order.PhoneNumber;
            parameter.BusinessNumber = order.BusinessNumber;
            parameter.Merchataddress = order.Merchataddress;
            parameter.Consignee      = parameter.Consignee == "" ? order.NickName : parameter.Consignee;
            parameter.ActivityId     = 1;

            using (IDbConnection conn = new SqlConnection()
            {
                ConnectionString = "Data Source =.; Initial Catalog = TakeOutDB; Integrated Security = True"
            })
            {
                res = conn.Execute("GenerateOrder", parameter, commandType: CommandType.StoredProcedure);
            }
            return(res);
        }
    //UPDATE DATA from TABLES
    protected void OnUpdate_Click(object sender, EventArgs e)
    {
        Call_Database updateEntry = new Call_Database();
        RepeaterItem  item        = (sender as LinkButton).Parent as RepeaterItem;

        if (LeadershipDisplay.Items.FindByValue("OutdoorsInfo").Selected == true)
        {
            string Action         = "OutdoorsInfoUPDATE";
            int    updateId       = int.Parse((item.FindControl("idLabel") as Label).Text);
            string EditLocation   = (item.FindControl("EditLocation") as TextBox).Text;
            string EditName       = (item.FindControl("EditName") as TextBox).Text;
            string EditArea       = (item.FindControl("EditArea") as TextBox).Text;
            string EditPlaque     = (item.FindControl("EditPlaque") as TextBox).Text;
            string EditDedication = (item.FindControl("EditDedication") as TextBox).Text;
            updateEntry.FormUPDATE(Action, EditLocation, EditName, EditArea, EditPlaque, EditDedication, updateId, 0, 0, 0);
            Call_Database update = new Call_Database();
            RepeaterNum1.DataSource = update.dbOutdoors;
            RepeaterNum1.DataBind();
        }
        else if (LeadershipDisplay.Items.FindByValue("ChapelInfo").Selected == true)
        {
            string Action     = "ChapelInfoUPDATE";
            int    updateId   = int.Parse((item.FindControl("idLabel") as Label).Text);
            float  EditOrder  = float.Parse((OrderShow.FindControl("EditOrder") as TextBox).Text);
            string EditLevel  = (item.FindControl("EditLevel") as TextBox).Text;
            string EditPlaque = (item.FindControl("EditPlaque") as TextBox).Text;
            string EditSort   = (item.FindControl("EditSort") as TextBox).Text;
            updateEntry.FormUPDATE(Action, EditLevel, EditPlaque, EditSort, null, null, updateId, 0, 0, EditOrder);
            Call_Database update = new Call_Database();
            RepeaterNum2.DataSource = update.dbChapel;
            RepeaterNum2.DataBind();
        }
        else if (LeadershipDisplay.Items.FindByValue("CommonsInfo").Selected == true)
        {
            string Action     = "CommonsInfoUPDATE";
            int    updateId   = int.Parse((item.FindControl("idLabel") as Label).Text);
            string EditRoomId = (item.FindControl("EditRoomId") as TextBox).Text;
            string EditName   = (item.FindControl("EditName") as TextBox).Text;
            string EditPlaque = (item.FindControl("EditPlaque") as TextBox).Text;
            string EditDate   = (item.FindControl("EditDate") as TextBox).Text;
            updateEntry.FormUPDATE(Action, EditRoomId, EditName, EditPlaque, EditDate, null, updateId, 0, 0, 0);
            Call_Database update = new Call_Database();
            RepeaterNum3.DataSource = update.dbCommons;
            RepeaterNum3.DataBind();
        }
        else if (LeadershipDisplay.Items.FindByValue("FisherHallInfo").Selected == true)
        {
            string Action     = "FisherHallInfoUPDATE";
            int    updateId   = int.Parse((item.FindControl("idLabel") as Label).Text);
            string EditRoomId = (item.FindControl("EditRoomId") as TextBox).Text;
            string EditName   = (item.FindControl("EditName") as TextBox).Text;
            string EditPlaque = (item.FindControl("EditPlaque") as TextBox).Text;
            string EditDate   = (item.FindControl("EditDate") as TextBox).Text;
            updateEntry.FormUPDATE(Action, EditRoomId, EditName, EditPlaque, EditDate, null, updateId, 0, 0, 0);
            Call_Database update = new Call_Database();
            RepeaterNum3.DataSource = update.dbFisherHall;
            RepeaterNum3.DataBind();
        }
        else if (LeadershipDisplay.Items.FindByValue("FitnessCenterInfo").Selected == true)
        {
            string Action     = "FitnessCenterInfoUPDATE";
            int    updateId   = int.Parse((item.FindControl("idLabel") as Label).Text);
            string EditRoomId = (item.FindControl("EditRoomId") as TextBox).Text;
            string EditName   = (item.FindControl("EditName") as TextBox).Text;
            string EditPlaque = (item.FindControl("EditPlaque") as TextBox).Text;
            string EditDate   = (item.FindControl("EditDate") as TextBox).Text;
            updateEntry.FormUPDATE(Action, EditRoomId, EditName, EditPlaque, EditDate, null, updateId, 0, 0, 0);
            Call_Database update = new Call_Database();
            RepeaterNum3.DataSource = update.dbFitnessCenter;
            RepeaterNum3.DataBind();
        }
        else if (LeadershipDisplay.Items.FindByValue("LibraryInfo").Selected == true)
        {
            string Action     = "LibraryInfoUPDATE";
            int    updateId   = int.Parse((item.FindControl("idLabel") as Label).Text);
            string EditRoomId = (item.FindControl("EditRoomId") as TextBox).Text;
            string EditName   = (item.FindControl("EditName") as TextBox).Text;
            string EditPlaque = (item.FindControl("EditPlaque") as TextBox).Text;
            string EditDate   = (item.FindControl("EditDate") as TextBox).Text;
            updateEntry.FormUPDATE(Action, EditRoomId, EditName, EditPlaque, EditDate, null, updateId, 0, 0, 0);
            Call_Database update = new Call_Database();
            RepeaterNum3.DataSource = update.dbLibrary;
            RepeaterNum3.DataBind();
        }
        else if (LeadershipDisplay.Items.FindByValue("ResHallInfo").Selected == true)
        {
            string Action     = "ResHallInfoUPDATE";
            int    updateId   = int.Parse((item.FindControl("idLabel") as Label).Text);
            string EditRoomId = (item.FindControl("EditRoomId") as TextBox).Text;
            string EditName   = (item.FindControl("EditName") as TextBox).Text;
            string EditPlaque = (item.FindControl("EditPlaque") as TextBox).Text;
            string EditDate   = (item.FindControl("EditDate") as TextBox).Text;
            updateEntry.FormUPDATE(Action, EditRoomId, EditName, EditPlaque, EditDate, null, updateId, 0, 0, 0);
            Call_Database update = new Call_Database();
            RepeaterNum3.DataSource = update.dbResidence;
            RepeaterNum3.DataBind();
        }
        else if (LeadershipDisplay.Items.FindByValue("SwartsHallInfo").Selected == true)
        {
            string Action     = "SwartsHallInfoUPDATE";
            int    updateId   = int.Parse((item.FindControl("idLabel") as Label).Text);
            string EditRoomId = (item.FindControl("EditRoomId") as TextBox).Text;
            string EditName   = (item.FindControl("EditName") as TextBox).Text;
            string EditPlaque = (item.FindControl("EditPlaque") as TextBox).Text;
            string EditDate   = (item.FindControl("EditDate") as TextBox).Text;
            updateEntry.FormUPDATE(Action, EditRoomId, EditName, EditPlaque, EditDate, null, updateId, 0, 0, 0);
            Call_Database update = new Call_Database();
            RepeaterNum3.DataSource = update.dbSwartsHall;
            RepeaterNum3.DataBind();
        }
        else if (LeadershipDisplay.Items.FindByValue("BlaisdellHallInfo").Selected == true)
        {
            string Action     = "BlaisdellHallInfoUPDATE";
            int    updateId   = int.Parse((item.FindControl("idLabel") as Label).Text);
            string EditRoomId = (item.FindControl("EditRoomId") as TextBox).Text;
            string EditName   = (item.FindControl("EditName") as TextBox).Text;
            string EditPlaque = (item.FindControl("EditPlaque") as TextBox).Text;
            string EditDate   = (item.FindControl("EditDate") as TextBox).Text;
            updateEntry.FormUPDATE(Action, EditRoomId, EditName, EditPlaque, EditDate, null, updateId, 0, 0, 0);
            Call_Database update = new Call_Database();
            RepeaterNum3.DataSource = update.dbBlaisdellHall;
            RepeaterNum3.DataBind();
        }
    }
    //INSERT DATA into MAP Tables
    protected void SubButton_Click(object sender, EventArgs e)
    {
        Call_Database callDB = new Call_Database();

        if (LeadershipDisplay.Items.FindByValue("OutdoorsInfo").Selected == true)
        {
            string Action = "OutdoorsInfoINSERT";
            callDB.FormINSERT(Action, txtLocation.Text, txtName.Text, txtArea.Text, txtPlaque.Text, txtDedication.Text, 0, 0, 0, 0);
            Call_Database update = new Call_Database();
            RepeaterNum1.DataSource = update.dbOutdoors;
            RepeaterNum1.DataBind();
        }
        else if (LeadershipDisplay.Items.FindByValue("ChapelInfo").Selected == true)
        {
            string Action      = "ChapelInfoINSERT";
            float  ChapelFloat = float.Parse((OrderShow.FindControl("txtOrder") as TextBox).Text);
            callDB.FormINSERT(Action, txtLevel.Text, txtPlaque.Text, txtSort.Text, null, null, 0, 0, 0, ChapelFloat);
            Call_Database update = new Call_Database();
            RepeaterNum2.DataSource = update.dbChapel;
            RepeaterNum2.DataBind();
        }
        else if (LeadershipDisplay.Items.FindByValue("CommonsInfo").Selected == true)
        {
            string Action = "CommonsInfoINSERT";
            callDB.FormINSERT(Action, txtRoomId.Text, txtName.Text, txtPlaque.Text, txtDate.Text, null, 0, 0, 0, 0);
            Call_Database update = new Call_Database();
            RepeaterNum3.DataSource = update.dbCommons;
            RepeaterNum3.DataBind();
        }
        else if (LeadershipDisplay.Items.FindByValue("FisherHallInfo").Selected == true)
        {
            string Action = "FisherHallInfoINSERT";
            callDB.FormINSERT(Action, txtRoomId.Text, txtName.Text, txtPlaque.Text, txtDate.Text, null, 0, 0, 0, 0);
            Call_Database update = new Call_Database();
            RepeaterNum3.DataSource = update.dbFisherHall;
            RepeaterNum3.DataBind();
        }
        else if (LeadershipDisplay.Items.FindByValue("FitnessCenterInfo").Selected == true)
        {
            string Action = "FitnessCenterInfoINSERT";
            callDB.FormINSERT(Action, txtRoomId.Text, txtName.Text, txtPlaque.Text, txtDate.Text, null, 0, 0, 0, 0);
            Call_Database update = new Call_Database();
            RepeaterNum3.DataSource = update.dbFitnessCenter;
            RepeaterNum3.DataBind();
        }
        else if (LeadershipDisplay.Items.FindByValue("LibraryInfo").Selected == true)
        {
            string Action = "LibraryInfoINSERT";
            callDB.FormINSERT(Action, txtRoomId.Text, txtName.Text, txtPlaque.Text, txtDate.Text, null, 0, 0, 0, 0);
            Call_Database update = new Call_Database();
            RepeaterNum3.DataSource = update.dbLibrary;
            RepeaterNum3.DataBind();
        }
        else if (LeadershipDisplay.Items.FindByValue("ResHallInfo").Selected == true)
        {
            string Action = "ResHallInfoINSERT";
            callDB.FormINSERT(Action, txtRoomId.Text, txtName.Text, txtPlaque.Text, txtDate.Text, null, 0, 0, 0, 0);
            Call_Database update = new Call_Database();
            RepeaterNum3.DataSource = update.dbResidence;
            RepeaterNum3.DataBind();
        }
        else if (LeadershipDisplay.Items.FindByValue("SwartsHallInfo").Selected == true)
        {
            string Action = "SwartsHallInfoINSERT";
            callDB.FormINSERT(Action, txtRoomId.Text, txtName.Text, txtPlaque.Text, txtDate.Text, null, 0, 0, 0, 0);
            Call_Database update = new Call_Database();
            RepeaterNum3.DataSource = update.dbSwartsHall;
            RepeaterNum3.DataBind();
        }
        else if (LeadershipDisplay.Items.FindByValue("BlaisdellHallInfo").Selected == true)
        {
            string Action = "BlaisdellHallInfoINSERT";
            callDB.FormINSERT(Action, txtRoomId.Text, txtName.Text, txtPlaque.Text, txtDate.Text, null, 0, 0, 0, 0);
            Call_Database update = new Call_Database();
            RepeaterNum3.DataSource = update.dbBlaisdellHall;
            RepeaterNum3.DataBind();
        }
    }