Exemple #1
0
        /// <summary>
        /// 修改开台时间
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void dltCloseTabie_TextChanged(object sender, EventArgs e)
        {
            tm_TabieUsingInfo entity = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);

            entity.ClearTime = DateTime.Parse(DateTime.Parse(dltCloseTabie.Text.Trim()).ToString("yyyy-MM-dd HH:mm:ss"));
            Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(entity);
        }
        public string GetPayType(string id)
        {
            string            strState   = string.Empty;
            tm_TabieUsingInfo tabieUsing = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(int.Parse(id));

            if (tabieUsing != null)
            {
                switch (tabieUsing.OrderState)
                {
                case "1":
                    strState = "就餐中";
                    break;

                case "2":
                    strState = "已结账";
                    break;

                case "3":
                    strState = string.Format("【免单】{0}", tabieUsing.FreeReason);
                    break;

                case "4":
                    strState = string.Format("【挂账】{0}", tabieUsing.Charge);
                    break;

                default:
                    strState = "就餐中";
                    break;
                }
            }
            return(strState);
        }
Exemple #3
0
        //改为团购
        protected void btnEnableGroup_Click(object sender, EventArgs e)
        {
            // 从每个选中的行中获取ID(在Grid1中定义的DataKeyNames)
            List <int>        ids         = GetSelectedDataKeyIDs(Grid1);
            tm_TabieUsingInfo Usingentity = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);

            // 执行数据库操作
            foreach (int ID in ids)
            {
                tm_TabieDishesInfo entity = Core.Container.Instance.Resolve <IServiceTabieDishesInfo>().GetEntity(ID);
                if (entity.IsFree == "1" || entity.DishesType == "2")
                {
                    Alert.ShowInTop("赠送菜品和退菜产品不可设置为团购套餐!");
                    continue;
                }
                if (entity.DishesType == "3" || entity.DishesType == "2")
                {
                    continue;
                }
                entity.DishesType = "3";
                Core.Container.Instance.Resolve <IServiceTabieDishesInfo>().Update(entity);
                Usingentity.Moneys    -= entity.Moneys;
                Usingentity.FactPrice -= entity.Moneys;
            }
            Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(Usingentity);
            // 重新绑定表格
            BindTabieDishesInfo();
        }
Exemple #4
0
        /// <summary>
        /// 菜品数量和价格变动处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Grid1_AfterEdit(object sender, GridAfterEditEventArgs e)
        {
            Dictionary <int, Dictionary <string, object> > modifiedDict = Grid1.GetModifiedDict();

            foreach (int rowIndex in modifiedDict.Keys)
            {
                int rowID = Convert.ToInt32(Grid1.DataKeys[rowIndex][0]);
                tm_TabieDishesInfo tabieDishesInfo = Core.Container.Instance.Resolve <IServiceTabieDishesInfo>().GetEntity(rowID);

                if (tabieDishesInfo.DishesType == "2" || tabieDishesInfo.IsFree == "1" || tabieDishesInfo.DishesType == "3")
                {
                    continue;
                }
                //更新菜品总价
                decimal Amount = tabieDishesInfo.Moneys;
                tabieDishesInfo.DishesCount = decimal.Parse(modifiedDict[rowIndex]["DishesCount"].ToString());
                tabieDishesInfo.Moneys      = tabieDishesInfo.DishesCount * tabieDishesInfo.Price;
                Core.Container.Instance.Resolve <IServiceTabieDishesInfo>().Update(tabieDishesInfo);
                //根据菜品变动前总价和变动后总价差异更新就餐信息消费金额
                tm_TabieUsingInfo tabieUsingInfo = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);
                tabieUsingInfo.Moneys    += (tabieDishesInfo.Moneys - Amount);
                tabieUsingInfo.FactPrice += (tabieDishesInfo.Moneys - Amount);
                Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(tabieUsingInfo);
            }
            //绑定餐台点菜信息
            BindTabieDishesInfo();
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            List <int> ids    = GetSelectedDataKeyIDs(Grid2);
            decimal?   Amount = 0;

            foreach (int id in ids)
            {
                tm_Dishes          entity = Core.Container.Instance.Resolve <IServiceDishes>().GetEntity(id);
                tm_TabieDishesInfo sb     = new tm_TabieDishesInfo();
                sb.DishesID     = entity.ID;
                sb.DishesCount  = 1;
                sb.Price        = entity.SellPrice;
                sb.Moneys       = 1 * entity.SellPrice;
                sb.DishesType   = "1";
                sb.IsFree       = "1";
                sb.TabieUsingID = _id;
                sb.DishesName   = entity.DishesName;
                sb.UnitName     = GetSystemEnumValue("CPDW", entity.DishesUnit.ToString());
                sb.IsPrint      = 0;
                sb.PrintID      = entity.PrinterID;
                Core.Container.Instance.Resolve <IServiceTabieDishesInfo>().Create(sb);
                Amount += sb.Moneys;
            }
            tm_TabieUsingInfo taieusing = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(_id);

            taieusing.Moneys    += Amount;
            taieusing.FactPrice += Amount;
            Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(taieusing);
            PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
        }
Exemple #6
0
        protected void btnDisableIsFree_Click(object sender, EventArgs e)
        {
            // 从每个选中的行中获取ID(在Grid1中定义的DataKeyNames)
            List <int> ids = GetSelectedDataKeyIDs(Grid1);
            // 执行数据库操作
            tm_TabieUsingInfo Usingentity = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);

            foreach (int ID in ids)
            {
                tm_TabieDishesInfo entity = Core.Container.Instance.Resolve <IServiceTabieDishesInfo>().GetEntity(ID);
                if (entity.DishesType == "2" || entity.DishesType == "3")
                {
                    Alert.ShowInTop("已退菜或团购套餐菜品不可赠送!");
                    continue;
                }
                if (entity.IsFree == "1")
                {
                    continue;
                }
                entity.IsFree = "1";
                Core.Container.Instance.Resolve <IServiceTabieDishesInfo>().Update(entity);
                Usingentity.PrePrice += entity.Moneys;
            }
            Usingentity.FactPrice = Usingentity.Moneys - Usingentity.PrePrice;
            Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(Usingentity);
            // 重新绑定表格
            BindTabieDishesInfo();
        }
        /// <summary>
        /// 退菜单打印
        /// </summary>
        /// <param name="listDish">退菜菜品信息</param>
        /// <param name="entity">开台信息</param>
        protected void LocalPrint(tm_TabieDishesInfo listDish, tm_TabieUsingInfo entity)
        {
            tm_Tabie      tabieEntity = Core.Container.Instance.Resolve <IServiceTabie>().GetEntity(entity.TabieID);
            StringBuilder sb          = new StringBuilder();
            StringBuilder count       = new StringBuilder();
            StringBuilder price       = new StringBuilder();

            sb.AppendFormat("{0}\n", tabieEntity.TabieName);
            sb.Append("##退菜单##\n");
            sb.Append(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\n");
            count.Append("\n");
            count.Append("\n");
            count.Append("\n");
            price.Append("\n");
            price.Append("\n");
            price.Append("\n");
            sb.Append("---------------------------------------------------------------------------\n");
            count.Append("\n");
            price.Append("\n");
            sb.AppendFormat("{0}\n", listDish.DishesName);
            count.Append("\n");
            price.AppendFormat("{0}{1}[退菜]\n", Math.Abs(listDish.DishesCount), listDish.UnitName);
            sb.Append("-----------------------------------------------------------------------------\n");
            count.Append("\n");
            price.Append("\n");
            sb.Append("服务员:002\n");
            count.Append("打印机:吧台\n");
            price.Append("\n");
            LocalPrint(sb.ToString(), count.ToString(), price.ToString());
        }
        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            int ID = GetSelectedDataKeyID(Grid1);

            if (e.CommandName == "viewField")
            {
                PageContext.Redirect(string.Format("~/Reports/DinnerOrderEdit.aspx?id={0}", ID));
            }
            if (e.CommandName == "stockField")
            {
                if (CheckPower("CoreCateringEdit"))
                {
                    //库存冲减
                    StockProcess(ID);
                }
                else
                {
                    Alert.Show("您没有反结算的权限!");
                }
            }
            if (e.CommandName == "stockBack")
            {
                if (CheckPower("CoreCateringEdit"))
                {
                    tm_TabieUsingInfo tm_tabieUsingInfo = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(ID);

                    //反结算-更新餐台信息状态
                    tm_Tabie tabieInfo = Core.Container.Instance.Resolve <IServiceTabie>().GetEntity(tm_tabieUsingInfo.TabieID);
                    if (tabieInfo.TabieState == 1)
                    {
                        tabieInfo.TabieState     = 4;
                        tabieInfo.CurrentUsingID = tm_tabieUsingInfo.ID;
                        Core.Container.Instance.Resolve <IServiceTabie>().Update(tabieInfo);
                        //反结算-更新就餐开台信息状态
                        tm_tabieUsingInfo.OrderState = "1";
                        Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(tm_tabieUsingInfo);

                        //反结算-删除结算信息
                        IList <ICriterion> qryList = new List <ICriterion>();
                        qryList.Add(Expression.Eq("TabieUsingID", ID));
                        tm_TabiePayInfo payInfo = Core.Container.Instance.Resolve <IServiceTabiePayInfo>().GetEntityByFields(qryList);
                        if (payInfo != null)
                        {
                            Core.Container.Instance.Resolve <IServiceTabiePayInfo>().Delete(payInfo);
                        }
                        Alert.Show("请返回营业管理进行反结算处理!");
                        //刷新
                        BindGrid();
                    }
                    else
                    {
                        Alert.Show("餐台当前使用中,不能进行反结算!");
                    }
                }
                else
                {
                    Alert.Show("您没有反结算的权限!");
                }
            }
        }
Exemple #9
0
        protected void nbZFB_Blur(object sender, EventArgs e)
        {
            tm_TabieUsingInfo entity = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);

            //指定子页面传回的值的去处并跳转至子页面
            PageContext.RegisterStartupScript(WindowOnlinePay.GetSaveStateReference(hfdPayTime.ClientID, hfdPayType.ClientID)
                                              + WindowOnlinePay.GetShowReference("~/Dinner/DOnlinePay.aspx?money=" + nbZFB.Text.Trim() + "&pay_type=020&terminal_trace=" + entity.OrderNO));
        }
Exemple #10
0
 /// <summary>
 /// 点菜单本地前台打印
 /// </summary>
 /// <param name="listDish"></param>
 /// <param name="entity"></param>
 protected void LocalPrint(IList <tm_TabieDishesInfo> listDish, tm_TabieUsingInfo entity)
 {
     if (listDish != null && listDish.Count > 0)
     {
         tm_Tabie      tabieEntity = Core.Container.Instance.Resolve <IServiceTabie>().GetEntity(entity.TabieID);
         StringBuilder sb          = new StringBuilder();
         StringBuilder count       = new StringBuilder();
         StringBuilder price       = new StringBuilder();
         sb.AppendFormat("{0}\n", tabieEntity.TabieName);
         sb.Append("点菜单\n");
         sb.Append(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\n");
         count.Append("\n");
         count.Append("\n");
         count.Append("\n");
         price.Append("\n");
         price.Append("\n");
         price.Append("\n");
         sb.Append("---------------------------------------------------------------------------\n");
         count.Append("\n");
         price.Append("\n");
         foreach (tm_TabieDishesInfo item in listDish)
         {
             //判断赠送
             if (item.IsFree.Equals("0"))
             {
                 //判断退菜
                 if (item.DishesType.Equals("1"))
                 {
                     sb.AppendFormat("{0}\n", item.DishesName);
                 }
                 //判断退菜
                 if (item.DishesType.Equals("2"))
                 {
                     sb.AppendFormat("{0}[退菜]\n", item.DishesName);
                 }
                 //团购菜品
                 if (item.DishesType.Equals("3"))
                 {
                     sb.AppendFormat("{0}[套餐]\n", item.DishesName);
                 }
             }
             else
             {
                 sb.AppendFormat("{0}[赠送]\n", item.DishesName);
             }
             count.AppendFormat("{0}{1}\n", item.DishesCount, item.UnitName);
             price.AppendFormat("{0}\n", item.Moneys);
         }
         sb.Append("-----------------------------------------------------------------------------\n");
         count.Append("\n");
         price.Append("\n");
         sb.Append("服务员:002\n");
         count.Append("打印机:吧台\n");
         price.Append("\n");
         LocalPrint(sb.ToString(), count.ToString(), price.ToString());
     }
 }
Exemple #11
0
        /// <summary>
        /// 折扣手工处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void tbxDiscount_Blur(object sender, EventArgs e)
        {
            tm_TabieUsingInfo entity = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);

            //获取所有点菜菜品金额信息
            entity.Discount  = !string.IsNullOrEmpty(txtDiscount.Text.Trim()) ? decimal.Parse(txtDiscount.Text.Trim()) : 0;
            entity.FactPrice = entity.Moneys - entity.PrePrice - decimal.Parse(txtDiscount.Text.Trim());
            Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(entity);
            labFactPrice.Text = Math.Round(entity.FactPrice, 2).ToString();
        }
Exemple #12
0
        /// <summary>
        /// 美团券号修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void tbGroup_Blur(object sender, EventArgs e)
        {
            string            txtGroup = tbGroup.Text;
            tm_TabieUsingInfo entity   = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);

            if (!string.IsNullOrEmpty(txtGroup))
            {
                entity.GroupCardNO = txtGroup;
                Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(entity);
            }
        }
Exemple #13
0
        /// <summary>
        /// 绑定就餐信息
        /// </summary>
        private void BindTabieUingInfo()
        {
            tm_TabieUsingInfo tabieUsing = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(_id);

            txbPopulation.Text = tabieUsing.Population.ToString();
            txbMoneys.Text     = string.Format("{0}元", tabieUsing.Moneys.ToString());
            txbClearTime.Text  = tabieUsing.ClearTime.ToString();
            txbOpenTime.Text   = tabieUsing.OpenTime.ToString();
            txbPrePrice.Text   = string.Format("{0}元", tabieUsing.PrePrice.ToString());
            txbFactPrice.Text  = string.Format("{0}元", tabieUsing.FactPrice.ToString());
            switch (tabieUsing.OrderState)
            {
            case "1":
                txtPayType.Text = "就餐中";
                break;

            case "2":
                txtPayType.Text = "已结账";
                break;

            case "3":
                txtPayType.Text = string.Format("【免单】{0}", tabieUsing.FreeReason);
                break;

            case "4":
                txtPayType.Text = string.Format("【挂账】{0}", tabieUsing.Charge);
                break;

            default:
                txtPayType.Text = "就餐中";
                break;
            }

            lblML.Text      = string.Format("{0}元", tabieUsing.Erasing.ToString());
            lblVipCard.Text = tabieUsing.VipID;
            IList <ICriterion> qryList = new List <ICriterion>();

            qryList.Add(Expression.Eq("TabieUsingID", _id));
            //获取支付信息
            tm_TabiePayInfo payInfo = Core.Container.Instance.Resolve <IServiceTabiePayInfo>().GetEntityByFields(qryList);

            if (payInfo != null)
            {
                lblCash.Text    = string.Format("{0}元", payInfo.CashMoneys.ToString());
                lblCard.Text    = string.Format("{0}元", payInfo.CreditMoneys.ToString());
                lblMember.Text  = string.Format("{0}元", payInfo.VipcardMoneys.ToString());
                lblWX.Text      = string.Format("{0}元", payInfo.OnlineMoneys.ToString());
                lblZFB.Text     = string.Format("{0}元", payInfo.ZFBMoneys.ToString());
                lblGroupNO.Text = payInfo.GroupCardNO;
                lblGroup.Text   = string.IsNullOrEmpty(payInfo.PayWayGroup) || !payInfo.PayWayGroup.Equals("1") ? "" : string.Format("【{0}】{1}元", tabieUsing.GroupName, payInfo.GroupMoneys);
            }
        }
Exemple #14
0
        private void LoadData()
        {
            //权限检查
            tm_TabieUsingInfo tm_tabieUsingInfo = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(_id);
            tm_Tabie          entity            = Core.Container.Instance.Resolve <IServiceTabie>().GetEntity(tm_tabieUsingInfo.TabieID);

            txbTitle.Text = entity.Diningarea_Tabie.AreaName + "区" + entity.TabieName;

            //绑定就餐信息
            BindTabieUingInfo();
            //绑定就餐点菜信息
            BindTabieDishesInfo();
        }
Exemple #15
0
 /// <summary>
 /// 餐台开台处理
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     string[] id = Hiddenid.Text.TrimEnd(',').Split(',');
     if (id.Length == 1 && !string.IsNullOrEmpty(id[0]))
     {
         //获取餐台信息
         tm_Tabie tabie = Core.Container.Instance.Resolve <IServiceTabie>().GetEntity(Int32.Parse(id[0]));
         //判断是否已经开台
         if (tabie.TabieState > 1)
         {
             Alert.ShowInTop("此餐台已开台!", "错误操作", MessageBoxIcon.Error);
         }
         else
         {
             //创建设置开台信息
             tm_TabieUsingInfo newUsingInfo = new tm_TabieUsingInfo();
             newUsingInfo.TabieID    = Int32.Parse(id[0]);
             newUsingInfo.OrderState = "1";                      //开台使用
             newUsingInfo.Moneys     = 0;
             newUsingInfo.PrePrice   = 0;
             newUsingInfo.Discount   = 0;
             newUsingInfo.FactPrice  = 0;
             newUsingInfo.Population = 0;
             newUsingInfo.ClearTime  = null;
             newUsingInfo.OpenTime   = DateTime.Now;
             newUsingInfo.OrderNO    = string.Format("XF{0}", newUsingInfo.OpenTime.ToString("yyyyMMddhhmmss"));
             Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Create(newUsingInfo);
             //获取当前创建的开台信息,主要是获取ID
             IList <ICriterion> qrylist = new List <ICriterion>();
             qrylist.Add(Expression.Eq("OrderState", "1"));
             qrylist.Add(Expression.Eq("TabieID", tabie.ID));
             tm_TabieUsingInfo CurrentUsingInfo = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntityByFields(qrylist);
             if (CurrentUsingInfo != null)
             {
                 //开台成功,修改餐台的状态信息
                 tabie.TabieState     = 2;                       //设置开台
                 tabie.CurrentUsingID = CurrentUsingInfo.ID;     //标识当前开台信息
                 Core.Container.Instance.Resolve <IServiceTabie>().Update(tabie);
                 PageContext.RegisterStartupScript(WindowSelectPeople.GetShowReference("~/Dinner/DSelectPeople.aspx?id=" + CurrentUsingInfo.ID + "&tabieid=" + tabie.ID, "就餐人数"));
             }
             else
             {
                 Alert.ShowInTop("餐台开台失败!", "错误操作", MessageBoxIcon.Error);
             }
         }
     }
     if (id.Length > 1)
     {
         Alert.ShowInTop("选择了" + id.Length + "个餐台,一次只能开一个!");
     }
 }
Exemple #16
0
        /// <summary>
        /// 就餐人数修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void tbxPeople_Blur(object sender, EventArgs e)
        {
            tm_TabieUsingInfo entity = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);

            if (string.IsNullOrEmpty(tbxPeople.Text))
            {
                entity.Population = 0;
            }
            else
            {
                entity.Population = Int32.Parse(tbxPeople.Text);
            }
            Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(entity);
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            //获取退菜菜品信息
            tm_TabieDishesInfo tabieDishesInfo = Core.Container.Instance.Resolve <IServiceTabieDishesInfo>().GetEntity(DishesID);

            if (tabieDishesInfo != null)
            {
                //获取开台信息
                tm_TabieUsingInfo usingEnitty = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(tabieDishesInfo.TabieUsingID);
                tm_Tabie          objTabie    = Core.Container.Instance.Resolve <IServiceTabie>().GetEntity(usingEnitty.TabieID);
                //获取菜品信息
                tm_Dishes dish = Core.Container.Instance.Resolve <IServiceDishes>().GetEntity((int)tabieDishesInfo.DishesID);
                //创建退菜菜品信息
                tm_TabieDishesInfo backEntity = new tm_TabieDishesInfo();
                backEntity.DishesID     = tabieDishesInfo.DishesID;
                backEntity.DishesCount  = -decimal.Parse(numCount.Text);
                backEntity.Price        = dish.SellPrice;
                backEntity.Moneys       = backEntity.DishesCount * tabieDishesInfo.Price;
                backEntity.DishesType   = "2";
                backEntity.IsFree       = "0";
                backEntity.IsDiscount   = dish.IsDiscount;
                backEntity.TabieUsingID = tabieDishesInfo.TabieUsingID;
                backEntity.UnitName     = GetSystemEnumValue("CPDW", dish.DishesUnit.ToString());
                backEntity.DishesName   = dish.DishesName;
                backEntity.PrintID      = dish.PrinterID;
                backEntity.IsPrint      = 1;
                Core.Container.Instance.Resolve <IServiceTabieDishesInfo>().Create(backEntity);
                //更新开台总价
                usingEnitty.Moneys    += backEntity.Moneys;
                usingEnitty.FactPrice += backEntity.Moneys;
                Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(usingEnitty);
                //打印退菜单据
                tm_Printer objPrinter = Core.Container.Instance.Resolve <IServicePrinter>().GetEntity(tabieDishesInfo.PrintID);
                bool       isPrint    = bool.Parse(ConfigurationManager.AppSettings["IsPrint"]);

                if (isPrint)
                {
                    //判断是否是后厨打印单据
                    if (objPrinter.PrinterType.Equals("2"))
                    {
                        //后厨打印单据
                        new NetPrintHelper().Printeg(backEntity.DishesName, backEntity.DishesCount, backEntity.UnitName, (int)usingEnitty.Population, objPrinter, 3, objTabie.TabieName);
                    }
                    //前台打印单据
                    LocalPrint(backEntity, usingEnitty);//默认打印机
                }
            }
            PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
        }
Exemple #18
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string people = tbxPeople.Text.Trim();

            if (!string.IsNullOrEmpty(people))
            {
                tm_TabieUsingInfo entity = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(_id);
                entity.Population = Int32.Parse(people);
                entity.VipID      = tbxVipCard.Text.Trim();
                Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(entity);
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }

            //PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(ddlSheng.SelectedValue) + ActiveWindow.GetHideReference());
        }
Exemple #19
0
        /// <summary>
        /// 绑定就餐点餐信息
        /// </summary>
        private void BindTabieDishesInfo()
        {
            IList <ICriterion> qryList = new List <ICriterion>();

            qryList.Add(Expression.Eq("TabieUsingID", TabieUsingID));
            Order[] orderList = new Order[1];
            Order   orderli   = new Order(Grid1.SortField, Grid1.SortDirection == "ASC" ? true : false);

            orderList[0] = orderli;
            IList <tm_TabieDishesInfo> list = Core.Container.Instance.Resolve <IServiceTabieDishesInfo>().GetAllByKeys(qryList, orderList);

            Grid1.DataSource = list;
            Grid1.DataBind();

            tm_TabieUsingInfo entity = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);

            labMoneys.Text = "¥" + (entity.Moneys - entity.PrePrice);
        }
Exemple #20
0
        /// <summary>
        /// 会员卡号修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void tbxVipID_Blur(object sender, EventArgs e)
        {
            string            vip    = tbxVipID.Text;
            tm_TabieUsingInfo entity = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);

            if (!string.IsNullOrEmpty(vip))
            {
                //此处需添加代码验证VIP账号
                //
                //
                entity.VipID = vip;
            }
            else
            {
                entity.VipID = "";
            }
            Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(entity);
        }
Exemple #21
0
        //合台合并支付
        protected void btnMontage_Click(object sender, EventArgs e)
        {
            string[]   id  = Hiddenid.Text.TrimEnd(',').Split(',');
            List <int> ids = new List <int>();

            foreach (string z in id)
            {
                tm_Tabie tm_Tabie = Core.Container.Instance.Resolve <IServiceTabie>().GetEntity(Int32.Parse(z));
                //判断餐台状态是否未就餐中
                if (tm_Tabie.TabieState < 4)
                {
                    Alert.ShowInTop("未就餐的餐台不能进行合台付款!", "错误操作", MessageBoxIcon.Error);
                    return;
                }
                else
                {
                    ids.Add(tm_Tabie.ID);
                }
            }
            if (ids.Count > 1)
            {
                //创建合并付款编号
                string MergeNO = string.Format("XSHT{0}", DateTime.Now.ToString("yyyyMMddHHmmss"));
                foreach (int u in ids)
                {
                    //获取餐台信息
                    tm_Tabie tabieInfo = Core.Container.Instance.Resolve <IServiceTabie>().GetEntity(u);
                    //获取餐台当前就餐信息
                    if (tabieInfo.CurrentUsingID > 0)
                    {
                        //更新就餐信息的合并付款编号信息
                        tm_TabieUsingInfo tabieUsingInfo = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(tabieInfo.CurrentUsingID);
                        tabieUsingInfo.MergeNO = MergeNO;
                        Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(tabieUsingInfo);
                    }
                }
                //跳转到合并付款页面
                PageContext.RegisterStartupScript(WindowPay.GetShowReference("~/Dinner/DMergePay.aspx?id=" + MergeNO, "合台付款"));
            }
            else
            {
                Alert.ShowInTop("至少选择两个未结算的餐台进行合台!", "错误操作", MessageBoxIcon.Error);
            }
        }
Exemple #22
0
        /// <summary>
        /// 清台处理(暂时不用)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            string[] id = Hiddenid.Text.TrimEnd(',').Split(',');
            if (id.Length >= 1 && !string.IsNullOrEmpty(id[0]))
            {
                foreach (string i in id)
                {
                    tm_Tabie entity = Core.Container.Instance.Resolve <IServiceTabie>().GetEntity(Int32.Parse(i));
                    if (entity.TabieState == 1)
                    {
                        continue;
                    }
                    if (entity.TabieState == 3)
                    {
                        entity.TabieState = 1;
                        Core.Container.Instance.Resolve <IServiceTabie>().Update(entity);
                        continue;
                    }

                    IList <ICriterion> qrylist = new List <ICriterion>();
                    qrylist.Add(Expression.Eq("TabieID", Int32.Parse(i)));
                    qrylist.Add(Expression.Lt("OrderState", "3"));
                    tm_TabieUsingInfo sb = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntityByFields(qrylist);
                    if (sb == null)
                    {
                        Alert.ShowInTop("餐桌已上菜,不可清台", "错误操作", MessageBoxIcon.Error);
                        return;
                    }
                    else
                    {
                        entity.TabieState = 1;
                        sb.OrderState     = "4";
                        sb.ClearTime      = DateTime.Now;
                        Core.Container.Instance.Resolve <IServiceTabie>().Update(entity);
                        Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(sb);
                    }
                }
            }
            BindTabieInfo();
        }
Exemple #23
0
        /// <summary>
        /// 折扣授权码处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void tbxKey_Blur(object sender, EventArgs e)
        {
            tm_TabieUsingInfo entity = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);
            //获取所有点菜参与打折菜品金额信息
            //更新就餐信息菜品信息打印状态
            string  sql      = string.Format("SELECT SUM(Moneys) as Moneys FROM tm_tabiedishesinfo WHERE TabieUsingID={0} and DishesType=1 AND IsFree=0 AND IsDiscount=1 ", TabieUsingID);
            DataSet dsMoneys = DbHelperMySQL.Query(sql);

            if (dsMoneys.Tables[0] != null)
            {
                entity.Discount  = (1 - decimal.Parse(ddlDiscount.SelectedValue)) * decimal.Parse(dsMoneys.Tables[0].Rows[0]["Moneys"].ToString());
                entity.DisPoint  = decimal.Parse(ddlDiscount.SelectedValue);
                entity.FactPrice = entity.Moneys - entity.PrePrice - entity.Discount;
                Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(entity);
                txtDiscount.Text  = Math.Round(entity.Discount, 2).ToString();
                labFactPrice.Text = Math.Round(entity.FactPrice, 2).ToString();
            }
            else
            {
                Alert.Show("菜品消费总金额获取失败");
            }
        }
Exemple #24
0
        /// <summary>
        /// 会员号变化处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void txtVip_Blur(object sender, EventArgs e)
        {
            lblVipMoney.Text = "0";
            tm_TabieUsingInfo entity = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);

            //获取会员信息
            IList <ICriterion> qryList = new List <ICriterion>();

            qryList.Add(Expression.Eq("VIPPhone", txtVip.Text.Trim()));
            tm_vipinfo vipInfo = Core.Container.Instance.Resolve <IServiceVipInfo>().GetEntityByFields(qryList);

            if (vipInfo != null)
            {
                lblVipMoney.Text = vipInfo.VIPCount.ToString();
                //更新会员信息
                entity.VipID = txtVip.Text.Trim();
                Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(entity);
            }
            else
            {
                Alert.Show("会员号不存在!");
            }
        }
Exemple #25
0
        protected void btnEnableIsFree_Click(object sender, EventArgs e)
        {
            // 从每个选中的行中获取ID(在Grid1中定义的DataKeyNames)
            List <int>        ids         = GetSelectedDataKeyIDs(Grid1);
            tm_TabieUsingInfo Usingentity = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);

            // 执行数据库操作
            foreach (int ID in ids)
            {
                tm_TabieDishesInfo entity = Core.Container.Instance.Resolve <IServiceTabieDishesInfo>().GetEntity(ID);
                if (entity.IsFree == "0")
                {
                    continue;
                }
                entity.IsFree = "0";
                Core.Container.Instance.Resolve <IServiceTabieDishesInfo>().Update(entity);
                Usingentity.PrePrice -= entity.Moneys;
            }
            Usingentity.FactPrice = Usingentity.Moneys - Usingentity.PrePrice;
            Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(Usingentity);
            // 重新绑定表格
            BindTabieDishesInfo();
        }
Exemple #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GPPayWay.Hidden       = false;
            GPvip.Hidden          = false;
            GPFreeReason.Hidden   = true;
            GPChargeReason.Hidden = true;

            tm_TabieUsingInfo entity = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);

            if (!IsPostBack)
            {
                if (entity.ClearTime == null)
                {
                    //设置结算时间
                    dltCloseTabie.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    //更新结算时间
                    entity.ClearTime = DateTime.Parse(DateTime.Parse(dltCloseTabie.Text.Trim()).ToString("yyyy-MM-dd HH:mm:ss"));
                    Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(entity);
                }
                else
                {
                    dltCloseTabie.Text = ((DateTime)entity.ClearTime).ToString("yyyy-MM-dd HH:mm:ss");
                }
                txtVip.Text = entity.VipID;
                //获取会员余额信息
                if (!string.IsNullOrEmpty(entity.VipID))
                {
                    IList <ICriterion> qryList = new List <ICriterion>();
                    qryList.Add(Expression.Eq("VIPPhone", entity.VipID));
                    tm_vipinfo vipInfo = Core.Container.Instance.Resolve <IServiceVipInfo>().GetEntityByFields(qryList);
                    lblVipMoney.Text = vipInfo != null?vipInfo.VIPCount.ToString() : "0";
                }
            }
            labMoneys.Text    = entity.Moneys.ToString();
            labPrePrice.Text  = entity.PrePrice.ToString();
            labFactPrice.Text = entity.FactPrice.ToString();
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            tm_TabieUsingInfo  usingenitty = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(_usingid);
            tm_Dishes          dish        = Core.Container.Instance.Resolve <IServiceDishes>().GetEntity(_id);
            tm_TabieDishesInfo entity      = new tm_TabieDishesInfo();

            entity.DishesID     = _id;
            entity.DishesCount  = decimal.Parse(numCount.Text);
            entity.Price        = dish.SellPrice;
            entity.Moneys       = entity.DishesCount * entity.Price;
            entity.DishesType   = "1";
            entity.IsFree       = "0";
            entity.IsDiscount   = dish.IsDiscount;
            entity.TabieUsingID = _usingid;
            entity.UnitName     = GetSystemEnumValue("CPDW", dish.DishesUnit.ToString());
            entity.DishesName   = dish.DishesName;
            entity.PrintID      = dish.PrinterID;
            entity.IsPrint      = 0;
            Core.Container.Instance.Resolve <IServiceTabieDishesInfo>().Create(entity);
            usingenitty.Moneys    += entity.Moneys;
            usingenitty.FactPrice += entity.Moneys;
            Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(usingenitty);
            PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
        }
Exemple #28
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            //获取当前餐台信息
            tm_Tabie tabieInfo = Core.Container.Instance.Resolve <IServiceTabie>().GetEntity(TabieID);
            //获取就餐信息
            tm_TabieUsingInfo tabieUsingInfo = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);
            //获取转台餐台
            int      tabieID         = int.Parse(ddlTabie.SelectedValue);
            tm_Tabie tabieChangeInfo = Core.Container.Instance.Resolve <IServiceTabie>().GetEntity(tabieID);

            //更新就餐信息
            tabieUsingInfo.TabieID = tabieID;
            Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().Update(tabieUsingInfo);
            //更新转台餐台信息
            tabieChangeInfo.CurrentUsingID = TabieUsingID;
            tabieChangeInfo.TabieState     = tabieInfo.TabieState;
            Core.Container.Instance.Resolve <IServiceTabie>().Update(tabieChangeInfo);
            //更新原餐台信息
            tabieInfo.CurrentUsingID = 0;
            tabieInfo.TabieState     = 1;
            Core.Container.Instance.Resolve <IServiceTabie>().Update(tabieInfo);

            PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
        }
Exemple #29
0
        /// <summary>
        /// 加载就餐相关信息
        /// </summary>
        private void LoadData()
        {
            //权限检查
            CheckPowerWithButton("CoreCateringView", btnNew);

            tm_TabieUsingInfo Usingentity = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);

            //绑定开台时间
            dltStart.Text = Usingentity.OpenTime.ToString();
            //绑定团购信息
            ddlGroup.SelectedValue = Usingentity.GroupMoneys.ToString();
            tbGroup.Text           = Usingentity.GroupCardNO;

            tbxPeople.Text = Usingentity.Population.ToString();
            tbxVipID.Text  = Usingentity.VipID;
            tm_Tabie entity = Core.Container.Instance.Resolve <IServiceTabie>().GetEntity(TabieID);

            groupTabie.Title              = string.Format("{0}区{1}【消费单号:{2}】", entity.Diningarea_Tabie.AreaName, entity.TabieName, Usingentity.OrderNO);
            btnPay.OnClientClick          = WindowPay.GetShowReference("~/Dinner/DPay.aspx?id=" + TabieUsingID + "&TabieId=" + TabieID, "付款");
            Grid1.PageSize                = ConfigHelper.PageSize;
            ddlGridPageSize.SelectedValue = ConfigHelper.PageSize.ToString();
            //绑定就餐点餐信息
            BindTabieDishesInfo();
        }
Exemple #30
0
        /// <summary>
        /// 结算留存单打印
        /// </summary>
        protected void LocalPrint()
        {
            tm_TabieUsingInfo  tabieUsingInfo = Core.Container.Instance.Resolve <IServiceTabieUsingInfo>().GetEntity(TabieUsingID);
            tm_Tabie           tabieEntity    = Core.Container.Instance.Resolve <IServiceTabie>().GetEntity(tabieUsingInfo.TabieID);
            IList <ICriterion> qrylist        = new List <ICriterion>();

            qrylist.Add(Expression.Eq("TabieUsingID", tabieUsingInfo.ID));
            tm_TabiePayInfo PayEntity = Core.Container.Instance.Resolve <IServiceTabiePayInfo>().GetEntityByFields(qrylist);
            StringBuilder   sb        = new StringBuilder();
            StringBuilder   count     = new StringBuilder();
            StringBuilder   price     = new StringBuilder();

            sb.Append("农投良品生活馆\n");
            sb.Append("结算单\n");
            sb.AppendFormat("桌  位:{0}\n", tabieEntity.TabieName);
            sb.AppendFormat("账单编号:{0}\n", tabieUsingInfo.OrderNO);
            sb.AppendFormat("营业日期:{0}\n", DateTime.Now.ToShortDateString());
            sb.AppendFormat("开台时间:{0}\n", tabieUsingInfo.OpenTime.ToString("yyyy-MM-dd HH:mm:ss"));
            sb.AppendFormat("结账时间:{0}\n", DateTime.Parse(dltCloseTabie.Text).ToString("yyyy-MM-dd HH:mm:ss"));
            sb.AppendFormat("客  数:{0}\n", tabieUsingInfo.Population);
            sb.AppendFormat("收款机号 \n");
            count.Append("\n");
            count.Append("\n");
            count.Append("\n");
            count.Append("\n");
            count.Append("\n");
            count.Append("\n");
            count.Append("\n");
            count.Append("\n");
            count.AppendFormat("收银员:{0} \n", User.Identity.Name);
            price.Append("\n");
            price.Append("\n");
            price.Append("\n");
            price.Append("\n");
            price.Append("\n");
            price.Append("\n");
            price.Append("\n");
            price.Append("\n");
            price.Append("\n");
            sb.Append("---------------------------------------------------------------------------\n");
            count.Append("\n");
            price.Append("\n");
            sb.Append("菜品名称\n");
            count.Append("数量 \n");
            price.Append("金额 \n");
            sb.Append("---------------------------------------------------------------------------\n");
            count.Append("\n");
            price.Append("\n");

            //获取点菜信息
            string sql = string.Format("SELECT DishesName,sum(DishesCount) as DishesCount,SUM(Moneys) as Moneys,UnitName,IsFree,DishesType FROM tm_tabiedishesinfo WHERE TabieUsingID={0} GROUP BY DishesName,UnitName,IsFree,DishesType ORDER BY DishesName "
                                       , tabieUsingInfo.ID);
            DataSet ds = DbHelperMySQL.Query(sql);

            if (ds.Tables[0] != null)
            {
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    //判断赠送
                    if (!row["IsFree"].ToString().Equals("1"))
                    {
                        //判断退菜
                        if (row["DishesType"].ToString().Equals("1"))
                        {
                            sb.AppendFormat("{0}\n", row["DishesName"].ToString());
                        }
                        if (row["DishesType"].ToString().Equals("2"))
                        {
                            sb.AppendFormat("{0}[退菜]\n", row["DishesName"].ToString());
                        }
                        //团购菜品
                        if (row["DishesType"].ToString().Equals("3"))
                        {
                            sb.AppendFormat("{0}[套餐]\n", row["DishesName"].ToString());
                        }
                    }
                    else
                    {
                        sb.AppendFormat("{0}[赠送]\n", row["DishesName"].ToString());
                    }
                    count.AppendFormat("{0}{1}\n", row["DishesCount"].ToString(), row["UnitName"].ToString());
                    price.AppendFormat("{0}\n", row["Moneys"].ToString());
                }
            }

            sb.Append("-----------------------------------------------------------------------------\n");
            count.Append("\n");
            price.Append("\n");

            sb.Append("消费合计:\n");
            count.Append("\n");
            price.AppendFormat("{0}\n", tabieUsingInfo.Moneys);
            sb.Append("赠送金额:\n");
            count.Append("\n");
            price.AppendFormat("{0}\n", tabieUsingInfo.PrePrice);
            sb.Append("抹零金额:\n");
            count.Append("\n");
            price.AppendFormat("{0}\n", tabieUsingInfo.Erasing);
            sb.Append("应付金额:\n");
            count.Append("\n");
            price.AppendFormat("{0}\n", tabieUsingInfo.FactPrice);
            sb.AppendFormat("折扣[{0}折]\n", tabieUsingInfo.DisPoint);
            count.Append("\n");
            price.AppendFormat("{0}\n", tabieUsingInfo.Discount);
            sb.Append("-----------------------------------------------------------------------------\n");
            count.Append("\n");
            price.Append("\n");
            //买单支付
            if (rblPayType.SelectedValue == "1")
            {
                if (!string.IsNullOrEmpty(PayEntity.PayWayCash))
                {
                    sb.Append("现金支付:\n");
                    count.Append("\n");
                    price.AppendFormat("{0}\n", PayEntity.CashMoneys);
                }
                if (!string.IsNullOrEmpty(PayEntity.PayWayCredit))
                {
                    sb.Append("刷卡支付:\n");
                    count.Append("\n");
                    price.AppendFormat("{0}\n", PayEntity.CreditMoneys);
                }
                if (!string.IsNullOrEmpty(PayEntity.PayWayVipcard))
                {
                    sb.Append("会员卡支付:\n");
                    count.Append("\n");
                    price.AppendFormat("{0}\n", PayEntity.VipcardMoneys);

                    //获取会员卡信息和余额
                    IList <ICriterion> qryList = new List <ICriterion>();
                    qryList.Add(Expression.Eq("VIPPhone", tabieUsingInfo.VipID));
                    tm_vipinfo vipInfo = Core.Container.Instance.Resolve <IServiceVipInfo>().GetEntityByFields(qryList);

                    if (vipInfo != null)
                    {
                        sb.AppendFormat("会员卡:{0}\n", tabieUsingInfo.VipID);
                        count.AppendFormat("余额:{0}\n", vipInfo.VIPCount);
                        price.AppendFormat("\n");
                    }
                }
                if (!string.IsNullOrEmpty(PayEntity.PayWayOnline))
                {
                    sb.Append("微信支付:\n");
                    count.Append("\n");
                    price.AppendFormat("{0}\n", PayEntity.OnlineMoneys);
                }
                if (!string.IsNullOrEmpty(PayEntity.PayWayZFB))
                {
                    sb.Append("支付宝支付:\n");
                    count.Append("\n");
                    price.AppendFormat("{0}\n", PayEntity.ZFBMoneys);
                }
                sb.Append("-----------------------------------------------------------------------------\n");
                count.Append("\n");
                price.Append("\n");
            }
            //美团
            if (!string.IsNullOrEmpty(tabieUsingInfo.GroupCardNO))
            {
                sb.AppendFormat("美团【{0}】:\n", tabieUsingInfo.GroupName);
                count.AppendFormat("{0}\n", tabieUsingInfo.GroupCardNO);
                price.Append("\n");
                sb.Append("-----------------------------------------------------------------------------\n");
                count.Append("\n");
                price.Append("\n");
            }
            //免单
            if (rblPayType.SelectedValue == "2")
            {
                sb.Append("免单:\n");
                price.AppendFormat("{0}\n", tabieUsingInfo.FreeReason);
                count.Append("\n");
                sb.Append("-----------------------------------------------------------------------------\n");
                count.Append("\n");
                price.Append("\n");
            }
            //挂账
            if (rblPayType.SelectedValue == "3")
            {
                sb.Append("挂账:\n");
                count.AppendFormat("{0}\n", tabieUsingInfo.Charge);
                price.Append("\n");
                sb.Append("-----------------------------------------------------------------------------\n");
                count.Append("\n");
                price.Append("\n");
            }
            sb.Append("地址:渝北区冉家坝龙山路301号\n");
            count.Append(" \n");
            price.Append("\n");
            sb.Append("电话:02367364577\n");
            count.Append(" \n");
            price.Append("\n");
            sb.Append("欢迎光临\n");
            count.Append("\n");
            price.Append("\n");
            LocalPrint(sb.ToString(), count.ToString(), price.ToString());
        }