Exemplo n.º 1
0
        private void btnCheckIn_Click(object sender, EventArgs e)
        {
            if (CheckInupt())
            {
                if (new CustoService().SelectCardInfoByCustoNo(txtCustoNo.Text) != null)
                {
                    using (TransactionScope scope = new TransactionScope())
                    {
                        Room r = new Room()
                        {
                            CheckTime    = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")),
                            CustoNo      = txtCustoNo.Text,
                            RoomStateId  = 1,
                            RoomNo       = txtRoomNo.Text,
                            datachg_usr  = LoginInfo.WorkerNo,
                            datachg_date = DateTime.Now,
                        };

                        bool n = new RoomService().UpdateRoomInfo(r);
                        if (n == true)
                        {
                            MessageBox.Show("登记入住成功!", "登记提示");
                            txtCustoNo.Text = "";
                            FrmRoomManager.Reload();
                            #region 获取添加操作日志所需的信息
                            OperationLog o = new OperationLog();
                            o.OperationTime    = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd,HH:mm:ss"));
                            o.Operationlog     = LoginInfo.WorkerClub + LoginInfo.WorkerPosition + LoginInfo.WorkerName + "于" + DateTime.Now + "帮助" + r.CustoNo + "进行了入住操作!";
                            o.OperationAccount = LoginInfo.WorkerClub + LoginInfo.WorkerPosition + LoginInfo.WorkerName;
                            o.datains_usr      = LoginInfo.WorkerNo;
                            o.datains_date     = DateTime.Now;
                            #endregion
                            new OperationlogService().InsertOperationLog(o);
                            scope.Complete();
                            this.Close();
                        }
                        else
                        {
                            MessageBox.Show("登记入住失败!", "登记提示");
                        }
                    }
                }
                else
                {
                    MessageBox.Show("客户编号不存在!", "来自小T的提示");
                }
            }
        }
Exemplo n.º 2
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     if (cboState.SelectedIndex != 1)
     {
         if (RoomManager.UpdateRoomStateByRoomNo(txtRoomNo.Text, cboState.SelectedIndex) > 0)
         {
             MessageBox.Show("房间" + txtRoomNo.Text + "成功修改为" + cboState.Text, "修改提示");
             FrmRoomManager.Reload();
             this.Close();
         }
         else
         {
             MessageBox.Show("修改失败", "来自小T的提示");
         }
     }
     else
     {
         MessageBox.Show("不能设置已住状态", "来自小T的提示");
     }
 }
Exemplo n.º 3
0
        private void btnCheckIn_Click(object sender, EventArgs e)
        {
            if (CheckInupt())
            {
                if (CustoManager.SelectCustoByCustoNo(txtCustoNo.Text) != null)
                {
                    Room r = new Room();
                    r.CheckTime   = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                    r.CustoNo     = txtCustoNo.Text;
                    r.PersonNum   = txtPersonNum.Text;
                    r.RoomStateId = 1;
                    r.RoomNo      = txtRoomNo.Text;

                    int n = RoomManager.UpdateRoomInfo(r);
                    if (n > 0)
                    {
                        MessageBox.Show("登记入住成功!", "登记提示");
                        //SpendManager.InsertSpendInfo(s);
                        txtCustoNo.Text = "";
                        FrmRoomManager.Reload();
                        this.Close();
                        #region 获取添加操作日志所需的信息
                        Operation o = new Operation();
                        o.OperationTime    = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd,HH:mm:ss"));
                        o.Operationlog     = LoginInfo.WorkerClub + LoginInfo.WorkerPosition + LoginInfo.WorkerName + "于" + DateTime.Now + "帮助" + r.CustoNo + "进行了入住操作!";
                        o.OperationAccount = LoginInfo.WorkerClub + LoginInfo.WorkerPosition + LoginInfo.WorkerName;
                        #endregion
                        OperationManager.InsertOperationLog(o);
                    }
                    else
                    {
                        MessageBox.Show("登记入住失败!", "登记提示");
                    }
                }
                else
                {
                    MessageBox.Show("客户编号不存在!", "来自小T的提示");
                }
            }
        }
        private void btnChangeRoom_Click(object sender, EventArgs e)
        {
            using (TransactionScope scope = new TransactionScope())
            {
                double sum         = 0;
                string lbu         = LoginInfo.WorkerName;
                string rno         = ucRoomList.RoomNo.ToString();
                string nrno        = cboRoomList.Text;
                Room   checkInRoom = new Room()
                {
                    RoomNo       = nrno,
                    CustoNo      = ucRoomList.CustoNo,
                    RoomStateId  = 1,
                    CheckTime    = DateTime.Now,
                    datains_usr  = LoginInfo.WorkerNo,
                    datains_date = DateTime.Now
                };

                if (rno.Contains("BD"))
                {
                    sum = Convert.ToDouble(Convert.ToInt32(new RoomService().DayByRoomNo(rno).ToString()) * 300);
                }
                if (rno.Contains("BS"))
                {
                    sum = Convert.ToDouble(Convert.ToInt32(new RoomService().DayByRoomNo(rno).ToString()) * 425);
                }
                if (rno.Contains("HD"))
                {
                    sum = Convert.ToDouble(Convert.ToInt32(new RoomService().DayByRoomNo(rno).ToString()) * 625);
                }
                if (rno.Contains("HS"))
                {
                    sum = Convert.ToDouble(Convert.ToInt32(new RoomService().DayByRoomNo(rno).ToString()) * 660);
                }
                if (rno.Contains("QL"))
                {
                    sum = Convert.ToDouble(Convert.ToInt32(new RoomService().DayByRoomNo(rno).ToString()) * 845);
                }
                if (rno.Contains("ZT"))
                {
                    sum = Convert.ToDouble(Convert.ToInt32(new RoomService().DayByRoomNo(rno).ToString()) * 1080);
                    //sum = Convert.ToDouble(Convert.ToInt32(RoomManager.DayByRoomNo(rno).ToString()) * 1080);
                }
                Spend s = new Spend()
                {
                    RoomNo      = cboRoomList.Text,
                    SpendName   = "居住" + rno + "共" + Convert.ToInt32(new RoomService().DayByRoomNo(rno).ToString()) + "天",
                    SpendAmount = Convert.ToInt32(new RoomService().DayByRoomNo(rno).ToString()),
                    CustoNo     = ucRoomList.CustoNo,
                    SpendPrice  = Convert.ToDecimal(sum),
                    SpendMoney  = Convert.ToDecimal(sum),
                    SpendTime   = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")),
                    MoneyState  = "未结算",
                };

                bool result1 = new RoomService().UpdateRoomInfo(checkInRoom);
                bool result2 = new RoomService().UpdateRoomByRoomNo(rno);
                var  result3 = new SpendService().SelectSpendByCustoNo(rno);
                if (result3.Count != 0)
                {
                    bool result4 = new SpendService().UpdateSpendInfoByRoomNo(result3, nrno, ucRoomList.CustoNo);
                }
                if (result1 == true && result2 == true)
                {
                    MessageBox.Show("转房成功");
                    bool m = new SpendService().InsertSpendInfo(s);
                    FrmRoomManager.Reload();
                    #region 获取添加操作日志所需的信息
                    OperationLog o = new OperationLog();
                    o.OperationTime    = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd,HH:mm:ss"));
                    o.Operationlog     = ucRoomList.CustoNo + "于" + DateTime.Now + "进行了换房,请记得到后台修改消费价格!";
                    o.OperationAccount = LoginInfo.WorkerNo;
                    o.datains_usr      = LoginInfo.WorkerNo;
                    o.datains_date     = DateTime.Now;
                    #endregion
                    new OperationlogService().InsertOperationLog(o);
                    scope.Complete();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("转房失败");
                }
            }
        }
        private void btnChangeRoom_Click(object sender, EventArgs e)
        {
            double sum  = 0;
            string lbu  = LoginInfo.WorkerName;
            string cno  = ucRoomList.CustoNo;
            string rno  = ucRoomList.RoomNo;
            string rte  = ucRoomList.RoomState;
            string rct  = ucRoomList.co_CheckTime;
            string rpm  = ucRoomList.co_PersonNum;
            string nrno = cboRoomList.Text;
            string sql1 = string.Format("update ROOM set RoomStateId='3',CustoNo=null,CheckTime=null,PersonNum=null where RoomNo='{0}'", rno);
            string sql2 = string.Format("update ROOM set RoomStateId='1',CustoNo='{0}',CheckTime='{1}',CheckOutTime=null,PersonNum='{2}' where RoomNo='{3}'", cno, rct, rpm, nrno);

            if (rno.Contains("BD"))
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(rno).ToString()) * 300));
            }
            if (rno.Contains("BS"))
            {
                sum = Convert.ToDouble(Convert.ToInt32(RoomManager.DayByRoomNo(rno).ToString()) * 425);
            }
            if (rno.Contains("HD"))
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(rno).ToString()) * 625));
            }
            if (rno.Contains("HS"))
            {
                sum = Convert.ToDouble(Convert.ToInt32(RoomManager.DayByRoomNo(rno).ToString()) * 660);
            }
            if (rno.Contains("QL"))
            {
                sum = Convert.ToDouble(Convert.ToInt32(RoomManager.DayByRoomNo(rno).ToString()) * 845);
            }
            if (rno.Contains("ZT"))
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(rno).ToString()) * 1080));
                //sum = Convert.ToDouble(Convert.ToInt32(RoomManager.DayByRoomNo(rno).ToString()) * 1080);
            }
            Spend s = new Spend()
            {
                RoomNo      = cboRoomList.Text,
                SpendName   = "居住" + rno + Convert.ToInt32(RoomManager.DayByRoomNo(rno).ToString()) + "天",
                SpendAmount = Convert.ToInt32(RoomManager.DayByRoomNo(rno).ToString()),
                CustoNo     = cno,
                SpendPrice  = Convert.ToDecimal(sum),
                SpendMoney  = Convert.ToDecimal(sum),
                SpendTime   = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")),
                MoneyState  = "未结算",
            };

            if (DBHelper.ExecuteNonQuery(sql1) > 0 && DBHelper.ExecuteNonQuery(sql2) > 0)
            {
                MessageBox.Show("转房成功");
                int m = SpendManager.InsertSpendInfo(s);
                FrmRoomManager.Reload();
                #region 获取添加操作日志所需的信息
                Operation o = new Operation();
                o.OperationTime    = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd,HH:mm:ss"));
                o.Operationlog     = cno + "于" + DateTime.Now + "进行了换房,请记得到后台修改消费价格!";
                o.OperationAccount = lbu;
                #endregion
                OperationManager.InsertOperationLog(o);
                this.Close();
            }
            else
            {
                MessageBox.Show("转房失败");
            }
        }
Exemplo n.º 6
0
        private void btnBalance_Click(object sender, EventArgs e)
        {
            if (txtReceipts.Text != "")                                                  //判断实收金额是否为空
            {
                Room   r         = new RoomService().SelectRoomByRoomNo(txtRoomNo.Text); //根据房间编号查询房间信息
                string checktime = r.CheckTime.ToString();                               //获取入住时间
                if (dgvSpendList.Rows.Count == 0)
                {
                    bool n = new RoomService().UpdateRoomByRoomNo(txtRoomNo.Text);
                    if (n == true)
                    {
                        new WtiService().InsertWtiInfo(w);//添加水电费信息
                        this.Close();
                    }
                    else
                    {
                        return;
                    }
                    MessageBox.Show("结算成功!", "系统提示");
                    FrmRoomManager.Reload();

                    #region 获取添加操作日志所需的信息
                    OperationLog o = new OperationLog();
                    o.OperationTime    = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd,HH:mm:ss"));
                    o.Operationlog     = LoginInfo.WorkerClub + LoginInfo.WorkerPosition + LoginInfo.WorkerName + "于" + DateTime.Now + "帮助" + txtCustoNo.Text + "进行了退房结算操作!";
                    o.OperationAccount = LoginInfo.WorkerNo;
                    o.datains_usr      = LoginInfo.WorkerNo;
                    o.datains_date     = DateTime.Now;
                    #endregion
                    new OperationlogService().InsertOperationLog(o);
                }
                else
                {
                    if (new SpendService().UpdateMoneyState(txtRoomNo.Text, checktime) == true)
                    {
                        bool n = new RoomService().UpdateRoomByRoomNo(txtRoomNo.Text);
                        if (n == true)
                        {
                            new WtiService().InsertWtiInfo(w);//添加水电费信息
                            this.Close();
                        }
                        else
                        {
                            return;
                        }
                        MessageBox.Show("结算成功!", "系统提示");
                        FrmRoomManager.Reload();
                        #region 获取添加操作日志所需的信息
                        OperationLog o = new OperationLog();
                        o.OperationTime    = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd,HH:mm:ss"));
                        o.Operationlog     = LoginInfo.WorkerClub + LoginInfo.WorkerPosition + LoginInfo.WorkerName + "于" + DateTime.Now + "帮助" + txtCustoNo.Text + "进行了退房结算操作!";
                        o.OperationAccount = LoginInfo.WorkerNo;
                        o.datains_usr      = LoginInfo.WorkerNo;
                        o.datains_date     = DateTime.Now;
                        #endregion
                        new OperationlogService().InsertOperationLog(o);
                    }
                    else
                    {
                        MessageBox.Show("结算失败!", "系统提示");
                    }
                }
            }
            else
            {
                MessageBox.Show("实收金额不能为空!", "系统提示");
            }
        }