Esempio n. 1
0
        public AjaxMessage UpdateLabel(int labelId, string name)
        {
            AjaxMessage ajax = new AjaxMessage();

            ajax.IsSuccess = false;
            ajax.Message   = "";
            try
            {
                FD_HotelLabel m_label = _labelService.GetByID(labelId);
                if (m_label != null)
                {
                    m_label.LabelName = name;
                    int result = _labelService.Update(m_label);
                    if (result > 0)
                    {
                        ajax.IsSuccess = true;
                        ajax.Message   = "修改成功";
                    }
                }
            }
            catch (Exception e)
            {
                ajax.Message = e.Message;
            }

            return(ajax);
        }
Esempio n. 2
0
        public AjaxMessage InsertLabel(string name, int empId)
        {
            AjaxMessage ajax = new AjaxMessage();

            ajax.IsSuccess = false;
            ajax.Message   = "";
            try
            {
                if (name != "")
                {
                    FD_HotelLabel m_label = new FD_HotelLabel();
                    m_label.LabelName      = name;
                    m_label.CreateEmployee = empId.ToString().ToInt32();
                    m_label.CreateDate     = DateTime.Now;
                    m_label.Status         = (byte)SysStatus.Enable;
                    int result = _labelService.Insert(m_label);
                    if (result > 0)
                    {
                        ajax.IsSuccess = true;
                        ajax.Message   = "添加成功";
                    }
                }
            }
            catch (Exception e)
            {
                ajax.Message = e.Message;
            }

            return(ajax);
        }
Esempio n. 3
0
        public AjaxMessage SetHotelSingleStatus(int labelId)
        {
            AjaxMessage ajax = new AjaxMessage();

            ajax.IsSuccess = false;
            ajax.Message   = "";
            try
            {
                FD_HotelLabel m_label = _labelService.GetByID(labelId);
                if (m_label != null)
                {
                    if (m_label.Status == (byte)SysStatus.Enable)
                    {
                        m_label.Status = (byte)SysStatus.Disable;
                        ajax.Message   = "禁用成功";
                    }
                    else
                    {
                        m_label.Status = (byte)SysStatus.Enable;
                        ajax.Message   = "启用成功";
                    }
                    int result = _labelService.Update(m_label);
                    if (result > 0)
                    {
                        ajax.IsSuccess = true;
                    }
                }
            }
            catch (Exception e)
            {
                ajax.Message = e.Message;
            }

            return(ajax);
        }
Esempio n. 4
0
        public AjaxMessage GetByLabelId(int labelId)
        {
            AjaxMessage ajax = new AjaxMessage();

            ajax.IsSuccess = false;
            ajax.Message   = "";
            try
            {
                FD_HotelLabel m_label = _labelService.GetByID(labelId);
                if (m_label != null)
                {
                    ajax.Value     = m_label.LabelName;
                    ajax.IsSuccess = true;
                }
            }
            catch (Exception e)
            {
                ajax.Message = e.Message;
            }

            return(ajax);
        }