Exemplo n.º 1
0
        /// <summary>
        /// 租凭单元
        /// </summary>
        /// <param name="keyValue">编号</param>
        /// <param name="room_id">房屋编号</param>
        /// <param name="IsTrue">是否添加 1未 2 是</param>
        public void UpdateRentcell(string keyValue, string room_id, int IsTrue, string rentcell)
        {
            try
            {
                // 锁定 房间状态
                if (!string.IsNullOrEmpty(keyValue))
                {
                    RentcontractEntity rentcontract = GetEntity(keyValue);
                    if (rentcontract != null && rentcontract.status == 1)
                    {
                        string roomids = string.Empty;
                        if (IsTrue == 1)
                        {
                            roomids = rentcell;
                        }
                        else
                        {
                            roomids = string.IsNullOrEmpty(rentcell) ? room_id : rentcell += "," + room_id;
                        }

                        roomService.UpdateRent(roomids, 1);
                    }
                }

                service.UpdateRentcell(keyValue, room_id, IsTrue, rentcell);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 保存表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        public void SaveForm(string keyValue, RentcontractEntity entity)
        {
            try
            {
                service.SaveForm(keyValue, entity);

                // 锁定房间状态
                if (!string.IsNullOrEmpty(keyValue))
                {
                    RentcontractEntity contractEntity = service.GetEntity(keyValue);
                    if (contractEntity != null && contractEntity.status == 1)
                    {
                        roomService.UpdateRent(contractEntity.rentcell, 1);
                    }
                    else
                    {
                        roomService.UpdateRent(contractEntity.rentcell, 0);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 3
0
 public ActionResult SaveForm(string keyValue, RentcontractEntity entity)
 {
     entity.property_id = Utils.GetCookie("property_id");
     entity.inputuser   = OperatorProvider.Provider.Current().Account;
     rentcontractbll.SaveForm(keyValue, entity);
     return(Success("操作成功。"));
 }
Exemplo n.º 4
0
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="keyValue">主键</param>
        public void RemoveForm(string keyValue)
        {
            try
            {
                // 释放 房间状态
                RentcontractEntity rentcontract = service.GetEntity(keyValue);
                if (rentcontract != null && !string.IsNullOrEmpty(rentcontract.rentcell) && rentcontract.status == 1)
                {
                    roomService.UpdateRent(rentcontract.rentcell, 0);
                }

                service.RemoveForm(keyValue);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 修改状态
        /// </summary>
        /// <param name="keyValue">编号</param>
        /// <param name="status">状态</param>
        public void UpdateStatus(string keyValue, int status)
        {
            try
            {
                // 终止合同要将对应的房号状态释放出来
                if (status != 1 && !string.IsNullOrEmpty(keyValue))
                {
                    RentcontractEntity rentcontract = service.GetEntity(keyValue);
                    if (rentcontract != null && !string.IsNullOrEmpty(rentcontract.rentcell))
                    {
                        roomService.UpdateRent(rentcontract.rentcell, 0);
                    }
                }

                service.UpdateStatus(keyValue, status);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 删除房间号
        /// </summary>
        /// <param name="keyValue"></param>
        /// <param name="room_id"></param>
        public void RemoveDYForm(string keyValue, string room_id, string rentcell)
        {
            try
            {
                // 释放房间状态
                if (!string.IsNullOrEmpty(keyValue))
                {
                    RentcontractEntity contractEntity = service.GetEntity(keyValue);
                    if (contractEntity != null && contractEntity.status == 1)
                    {
                        roomService.UpdateRent(room_id, 0);
                    }
                }

                // 更新房间
                service.RemoveDYForm(keyValue, room_id, rentcell);
            }
            catch (Exception)
            {
                throw;
            }
        }