예제 #1
0
        public void List(int ids)
        {
            //订单
            Dingdanlist = "";
            dingdanren  = "";

            DataSet dr = managebll.Getcommodity(cid);

            if (dr.Tables[0].Rows.Count > 0)
            {
                decimal amount = 0;

                if (dr.Tables[0].Rows[0]["status"].ToString() == "2")
                {
                    save_groupbase.Text        = "已验证";
                    save_groupbase.Enabled     = false;
                    save_groupbase.Style.Value = "";
                }
                Dingdanlist += "<tr><th>套餐名称</th><th class=\"cc\">购买份数</th><th class=\"cc\">单价</th><th class=\"rr\">总价</th> </tr>";
                for (int i = 0; i < dr.Tables[0].Rows.Count; i++)
                {
                    Dingdanlist += " <tr><td  class=\"cc\">" + dr.Tables[0].Rows[i]["cpName"] + "</td>";
                    Dingdanlist += "<td class=\"cc\">" + 1 + "</td>";
                    Dingdanlist += "<td class=\"cc\">" + dr.Tables[0].Rows[i]["price"] + "</td>";
                    Dingdanlist += "<td class=\"rr\">¥" + dr.Tables[0].Rows[i]["price"] + "</td></tr>";
                    amount      += Convert.ToDecimal(dr.Tables[0].Rows[i]["price"]);
                }

                Dingdanlist += "<tr><td></td><td ></td><td ></td><td class=\"rr\" style=\"color: red; font-weight:bold;\">总计:¥" + amount + "</td></tr>";
            }

            manage = managebll.GetModeldingdan(id);
            //获取菜品有效期
            string caipinRange   = string.Empty;
            bool   isInRange     = true;
            var    caipinManager = new BLL.wx_diancai_caipin_manage().GetModel(ids);

            if (caipinManager != null)
            {
                if (caipinManager.beginDate != null && caipinManager.endDate != null)
                {
                    caipinRange = string.Format("{0}至{1}", caipinManager.beginDate.Value.ToString("yyyy-MM-dd"), caipinManager.endDate.Value.ToString("yyyy-MM-dd"));
                    if (manage.createDate > caipinManager.endDate.Value)
                    {
                        isInRange = false;
                    }
                }
            }

            //订单信息
            if (manage != null)
            {
                dingdanren += "<tr><td width=\"70\">订单编号: " + manage.orderNumber + "</td></tr>";
                dingdanren += "<tr> <td>预订日期:" + manage.oderTime + "</td></tr>";

                if (!string.IsNullOrEmpty(caipinRange))
                {
                    dingdanren += "<tr> <td>订单有效期:" + caipinRange + "</td></tr>";
                }

                dingdanren += "<tr><td>预约人:" + manage.customerName + "</td></tr>";
                dingdanren += "<tr><td>电话:" + manage.customerTel + "</td></tr>";
                //dingdanren += "<tr><td>地址:" + manage.address + "</td></tr>";
                //dingdanren += "<tr><td>备注 :" + manage.oderRemark + "</td></tr>";
                if (manage.payStatus == StatusManager.PayStatus.Payed.StatusID)
                {
                    dingdanren += "<tr><td>订单状态:<em  style='width:70px;' class='ok'>等待使用</em></td></tr>";
                }
                else if (manage.payStatus == StatusManager.PayStatus.PartUsed.StatusID)
                {
                    dingdanren += "<tr><td>订单状态:<em  style='width:70px;' class='ok'>部分使用</em></td></tr>";
                }
                else if (manage.payStatus == StatusManager.PayStatus.PartRefund.StatusID)
                {
                    dingdanren += "<tr><td>订单状态:<em  style='width:70px;' class='ok'>部分退款</em></td></tr>";
                }
                else
                {
                    dingdanren += "<tr><td>订单状态:<em  style='width:70px;' class='no'>未使用</em></td></tr>";
                }

                //如果订单已经过期,提醒管理员
                if (!isInRange)
                {
                    dingdanren += "<tr><td>订单状态:<em  style='width:70px;font-size:1.3em' class='error'>当前订单已经过期</em></td></tr>";
                }
            }
            else
            {
                dingdanren += "<tr><td width=\"70\">订单编号:</td></tr>";
                dingdanren += "<tr> <td>预订日期:</td></tr>";
                dingdanren += "<tr><td>预约人:</td></tr>";
                dingdanren += "<tr><td>电话:</td></tr>";
                //dingdanren += "<tr><td>地址:</td></tr>";
                //dingdanren += "<tr><td>备注 :</td></tr>";

                dingdanren += "<tr><td>订单状态:<em  style='width:70px;' class='no'>未使用</em></td></tr>";
            }
        }