Exemplo n.º 1
0
    /// <summary>
    /// 添加,修改
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        if (btnUpdate.Text == "结算")
        {
            Live model = LiveBLL.GetIdByLive(Convert.ToInt32(Request.QueryString["id"]));
            model.L_OutTime = Convert.ToDateTime(txtOutTime.Value.Trim());
            model.L_Pay     = Convert.ToDecimal(txtPay.Value.Trim());
            model.L_State   = "已结算";
            model.L_Total   = model.L_Deposit + model.L_Pay;//总消费金额=入住定金+欠付金额
            model.U_Id      = users.U_Id;

            if (LiveBLL.UpdateLive(model) > 0)
            {
                Room room = RoomBLL.GetIdByRoom(model.R_Id);
                room.R_State = "空";
                RoomBLL.UpdateRoom(room);
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('结算成功!');window.location.replace('LiveSettlement.aspx');</script>");
                return;
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('结算失败!');</script>");
                return;
            }
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// 加载绑定
    /// </summary>
    public void BindLoad()
    {
        if (txtL_No.Value.Trim().Length != 0)
        {
            strWhere += " and L_No like '%" + txtL_No.Value.Trim() + "%'";
        }
        if (txtR_No.Value.Trim().Length != 0)
        {
            strWhere += " and R_No like '%" + txtR_No.Value.Trim() + "%'";
        }
        if (txtName.Value.Trim().Length != 0)
        {
            strWhere += " and L_Name like '%" + txtName.Value.Trim() + "%'";
        }
        if (txtTel.Value.Trim().Length != 0)
        {
            strWhere += " and L_Tel like '%" + txtTel.Value.Trim() + "%'";
        }
        if (txtIdCard.Value.Trim().Length != 0)
        {
            strWhere += " and L_IdCard like '%" + txtIdCard.Value.Trim() + "%'";
        }

        strWhere += " and L_State='未结算'";


        int DataCount = LiveBLL.CountNumber2(strWhere);                                                                                                               //共多少条记录
        int hPageSize = (DataCount % Convert.ToInt32(HCount.Value)) != 0 ? DataCount / Convert.ToInt32(HCount.Value) + 1 : DataCount / Convert.ToInt32(HCount.Value); //共多少页

        HPageSize.Value        = DataCount.ToString();
        HAllPage.Value         = hPageSize.ToString();
        this.RpNews.DataSource = LiveBLL.PageSelectLive2(Convert.ToInt32(HCount.Value), Convert.ToInt32(HNowPage.Value), strWhere, "L_Time", "asc");
        this.RpNews.DataBind();
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Users"] != null)
        {
            users = (Users)Session["Users"];
        }
        else
        {
            users = null;
            Response.Write("<script>parent.window.location.href='Login.aspx'</script>");
        }
        if (!IsPostBack)
        {
            txtUserName.Value = users.U_Name.Trim();
            if (Request.QueryString["id"] != null)
            {
                Live model = LiveBLL.GetIdByLive(Convert.ToInt32(Request.QueryString["id"]));

                txtTime.Value = model.L_Time.ToString("yyyy-MM-dd");
                if (model != null && model.L_Id != 0)
                {
                    txtNo.Value   = model.L_No.Trim();
                    txtL_Id.Value = model.L_Id.ToString();
                }
            }
        }
    }
Exemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["Users"] != null)
     {
         users = (Users)Session["Users"];
     }
     else
     {
         users = null;
         Response.Write("<script>parent.window.location.href='Login.aspx'</script>");
     }
     if (!IsPostBack)
     {
         txtUserName.Value = users.U_Name.Trim();
         if (Request.QueryString["id"] != null)
         {
             Live live = LiveBLL.GetIdByLive(Convert.ToInt32(Request.QueryString["id"]));
             if (live != null && live.L_Id != 0)
             {
                 txtNo.Value       = live.L_No.Trim();
                 RpNews.DataSource = ConsumptionBLL.AllData(" and L_Id=" + live.L_Id + " order by C_Time desc");
                 RpNews.DataBind();
             }
         }
     }
 }
Exemplo n.º 5
0
    /// <summary>
    /// 添加,修改
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        if (btnUpdate.Text == "添加")
        {
            Live model = new Live();
            model.L_Deposit = Convert.ToDecimal(txtDeposit.Value.Trim());
            model.L_IdCard  = txtIdCard.Value.Trim();
            model.L_Name    = txtName.Value.Trim();
            model.L_No      = txtNo.Value.Trim();
            model.L_OutTime = Convert.ToDateTime("1900-01-01");
            model.L_Pay     = 0;
            model.L_State   = "未结算";
            model.L_Tel     = txtTel.Value.Trim();
            model.L_Time    = Convert.ToDateTime(txtTime.Value);
            model.L_Total   = 0;
            model.R_Id      = Convert.ToInt32(ddlR_Id.SelectedValue);
            model.U_Id      = users.U_Id;

            if (LiveBLL.AddLive(model) > 0)
            {
                Room room = RoomBLL.GetIdByRoom(Convert.ToInt32(ddlR_Id.SelectedValue));
                room.R_State = "入住";
                RoomBLL.UpdateRoom(room);
                Orders ord = OrdersBLL.GetIdByOrders(Convert.ToInt32(Request.QueryString["id"]));
                ord.O_State = "已入住";
                OrdersBLL.UpdateOrders(ord);
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('添加成功!');window.location.replace('OrdersJoin.aspx');</script>");
                return;
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('添加失败!');</script>");
                return;
            }
        }
    }
Exemplo n.º 6
0
    /// <summary>
    /// 添加,修改
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        if (btnUpdate.Text == "添加")
        {
            Consumption model = new Consumption();
            model.C_Name  = txtName.Value.Trim();
            model.C_Price = Convert.ToDecimal(txtPrice.Value.Trim());
            model.C_Time  = Convert.ToDateTime(txtTime.Value.Trim());
            Live live = LiveBLL.GetIdByLive(Convert.ToInt32(Request.QueryString["id"]));
            model.L_Id = live.L_Id;
            model.U_Id = users.U_Id;

            if (ConsumptionBLL.AddConsumption(model) > 0)
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('添加成功!');window.location.replace('ConsumptionAdd.aspx?id=" + Request.QueryString["id"] + "');</script>");
                return;
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('添加失败!');</script>");
                return;
            }
        }
    }
Exemplo n.º 7
0
    //分页查找
    private void BindData(string strClass)
    {
        int nowPage = 1;

        switch (strClass)
        {
        case "next":
            nowPage = Convert.ToInt32(HNowPage.Value) + 1;
            break;

        case "up":
            nowPage = Convert.ToInt32(HNowPage.Value) - 1;
            break;

        case "end":
            nowPage = Convert.ToInt32(HAllPage.Value);
            break;

        default:
            nowPage = 1;
            break;
        }

        if (Convert.ToInt32(HAllPage.Value) <= 1)
        {
            LBEnd.Enabled  = false;
            LBHome.Enabled = false;
            LBNext.Enabled = false;
            LBUp.Enabled   = false;
        }
        else if (nowPage == 1)
        {
            LBHome.Enabled = false;
            LBUp.Enabled   = false;
            LBNext.Enabled = true;
            LBEnd.Enabled  = true;
        }
        else if (nowPage == Convert.ToInt32(HAllPage.Value))
        {
            LBHome.Enabled = true;
            LBUp.Enabled   = true;
            LBNext.Enabled = false;
            LBEnd.Enabled  = false;
        }
        else
        {
            LBEnd.Enabled  = true;
            LBHome.Enabled = true;
            LBNext.Enabled = true;
            LBUp.Enabled   = true;
        }


        if (txtL_No.Value.Trim().Length != 0)
        {
            strWhere += " and L_No like '%" + txtL_No.Value.Trim() + "%'";
        }
        if (txtR_No.Value.Trim().Length != 0)
        {
            strWhere += " and R_No like '%" + txtR_No.Value.Trim() + "%'";
        }
        if (txtName.Value.Trim().Length != 0)
        {
            strWhere += " and L_Name like '%" + txtName.Value.Trim() + "%'";
        }
        if (txtTel.Value.Trim().Length != 0)
        {
            strWhere += " and L_Tel like '%" + txtTel.Value.Trim() + "%'";
        }
        if (txtIdCard.Value.Trim().Length != 0)
        {
            strWhere += " and L_IdCard like '%" + txtIdCard.Value.Trim() + "%'";
        }

        strWhere += " and L_State='未结算'";

        this.RpNews.DataSource = LiveBLL.PageSelectLive2(Convert.ToInt32(HCount.Value), nowPage, strWhere, "L_Time", "asc");
        this.RpNews.DataBind();
        HNowPage.Value = nowPage.ToString();
        PageMes.Text   = string.Format("每页{0}条 第{1}页/共{2}页 共{3}条", HCount.Value, nowPage.ToString(), HAllPage.Value, HPageSize.Value);
    }