Beispiel #1
0
 /// <summary>
 /// 更新餐台信息
 /// </summary>
 /// <param name="paramBuffetControl">餐台控件</param>
 /// <param name="paramBuffetStatus">餐台状态</param>
 /// <param name="paramMarkID">订单号</param>
 /// <returns></returns>
 /// 创建人:桂书丛
 /// 创建日期:2013-2-28
 public static bool UpdateBuffetInfo(ListViewItem paramBuffetControl, VariedEnum.BuffetStatus paramBuffetStatus, string paramMarkID)
 {
     try
     {
         ModelCMS_Buffets tempModelCMS_Buffets = new ModelCMS_Buffets();
         paramBuffetControl.ImageIndex = Convert.ToInt32(paramBuffetStatus);
         paramBuffetControl.SubItems["StateID"].Text = Convert.ToInt32(paramBuffetStatus).ToString();
         if (paramMarkID.Length != 0)
         {
             paramBuffetControl.SubItems["MarkID"].Text = paramMarkID;
         }
         tempModelCMS_Buffets = GetBuffetModel(paramBuffetControl);
         tempModelCMS_Buffets.ModifyPerson = frmAssist.frmLogin.SysUser.UserName;
         tempModelCMS_Buffets.ModifyDate   = DateTime.Now;
         if (new BUCMS_Buffets().Update(tempModelCMS_Buffets) == VariedEnum.OperatorStatus.Successed)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         XtraMessageBox.Show("下面的操作可能会出错,请谨慎操作", "发生未知错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return(false);
     }
 }
Beispiel #2
0
        /// <summary>
        /// 由一个餐台得到其具体实例
        /// </summary>
        /// <param name="paramListViewItem">餐台控件</param>
        public static ModelCMS_Buffets GetBuffetModel(ListViewItem paramListViewItem)
        {
            ModelCMS_Buffets returnModelCMS_Buffets = new ModelCMS_Buffets();
            ListViewItem     tempaListViewItem      = paramListViewItem;

            try
            {
                if (tempaListViewItem.Name == string.Empty)
                {
                    returnModelCMS_Buffets.StateID = Convert.ToInt32(VariedEnum.BuffetStatus.未定义);
                    return(returnModelCMS_Buffets);
                }
                returnModelCMS_Buffets.ID             = Convert.ToInt32(tempaListViewItem.Name);
                returnModelCMS_Buffets.Name           = tempaListViewItem.Text;
                returnModelCMS_Buffets.AccommodateNum = Convert.ToInt32(tempaListViewItem.SubItems["AccommodateNum"].Text);
                returnModelCMS_Buffets.RoomTypeID     = Convert.ToInt32(tempaListViewItem.SubItems["RoomTypeID"].Text);
                returnModelCMS_Buffets.StateID        = Convert.ToInt32(tempaListViewItem.SubItems["StateID"].Text);
                returnModelCMS_Buffets.MarkID         = tempaListViewItem.SubItems["MarkID"].Text;
                returnModelCMS_Buffets.InfoNote       = tempaListViewItem.SubItems["InfoNote"].Text;
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "GetBuffetModel");
            }
            return(returnModelCMS_Buffets);
        }
Beispiel #3
0
 /// <summary>
 /// 根据餐台控件获得餐台信息
 /// </summary>
 /// <param name="paramModelCMS_Buffets">The param model CM s_ buffets.</param>
 /// <param name="paramDislayControls">The param dislay controls.</param>
 public static void ShowBuffetInfo(ModelCMS_Buffets paramModelCMS_Buffets, Control[] paramDislayControls)
 {
     if (paramModelCMS_Buffets == null)
     {
         return;
     }
     try
     {
         LabelControl ID       = (LabelControl)paramDislayControls[0];
         LabelControl Name     = (LabelControl)paramDislayControls[1];
         LabelControl AvaNum   = (LabelControl)paramDislayControls[2];
         LabelControl Status   = (LabelControl)paramDislayControls[3];
         LabelControl InfoNote = (LabelControl)paramDislayControls[4];
         ID.Text     = paramModelCMS_Buffets.ID.ToString();
         Name.Text   = paramModelCMS_Buffets.Name;
         AvaNum.Text = paramModelCMS_Buffets.AccommodateNum.ToString();
         VariedEnum.BuffetStatus CurrentBuffetStatus = (VariedEnum.BuffetStatus)paramModelCMS_Buffets.StateID;
         Status.Text   = CurrentBuffetStatus.ToString();
         InfoNote.Text = paramModelCMS_Buffets.InfoNote;
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message, "InitedBuffetDate");
     }
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="frmCheckOut"/> class.
 /// </summary>
 /// <param name="paramBuffetControl">The param control.</param>
 /// 创建人:桂书丛
 /// 创建日期:2013-02-23
 public frmCheckOut(ListViewItem paramBuffetControl)
 {
     InitializeComponent();
     this.BuffetControl      = paramBuffetControl;
     this.myModelCMS_Buffets = ClassAssist.BuffetOperator.GetBuffetModel(paramBuffetControl);
     InitializeControls();
 }
Beispiel #5
0
 /// <summary>
 /// 重载构造函数
 /// </summary>
 /// <param name="paramBuffetControl">The param list view item.</param>
 public frmBuffetRegister(ListViewItem paramBuffetControl)
 {
     InitializeComponent();
     this.BuffetControl      = paramBuffetControl;
     this.myModelCMS_Buffets = ClassAssist.BuffetOperator.GetBuffetModel(paramBuffetControl);
     this.lblID.Text         = myModelCMS_Buffets.ID.ToString();
     DisplayBuffetInfo();
 }
Beispiel #6
0
 /// <summary>
 /// 重载构造函数
 /// </summary>
 /// <param name="paramBuffetControl">The param buffet control.</param>
 public frmDineRegister(ListViewItem paramBuffetControl)
 {
     InitializeComponent();
     this.myModelCMS_Buffets = ClassAssist.BuffetOperator.GetBuffetModel(paramBuffetControl);
     this.lblID.Text         = myModelCMS_Buffets.ID.ToString();
     this.Text          = "增加消费";
     this.MarkID        = myModelCMS_Buffets.MarkID;
     this.BuffetControl = paramBuffetControl;
     InitializeControls();
     LoadBillInfo();
 }
Beispiel #7
0
        /// <summary>
        /// 显示餐台信息
        /// </summary>
        private void DisplayBuffetInfo()
        {
            ModelCMS_Buffets tempModelCMS_Buffets = new ModelCMS_Buffets();

            tempModelCMS_Buffets = ClassAssist.BuffetOperator.GetBuffetModel(this.BuffetControl);
            Control[] tempShowControl = new Control[5];
            tempShowControl[0] = this.lblID;
            tempShowControl[1] = this.lblName;
            tempShowControl[2] = this.lblStatus;
            tempShowControl[3] = this.lblStatus;
            tempShowControl[4] = this.lblInfoNote;
            ClassAssist.BuffetOperator.ShowBuffetInfo(tempModelCMS_Buffets, tempShowControl);
        }
Beispiel #8
0
 /// <summary>
 /// 使用实体类传递参数
 /// </summary>
 /// <returns></returns>
 /// <remarks></remarks>
 private ModelCMS_Buffets GetModel()
 {
     try
     {
         ModelCMS_Buffets tempModelCMS_Buffets = new ModelCMS_Buffets();
         tempModelCMS_Buffets.ID             = this.ItemID;
         tempModelCMS_Buffets.Name           = this.txtName.Text.Trim().ToString();
         tempModelCMS_Buffets.AccommodateNum = Convert.ToInt32(this.spinEditPeopleContain.EditValue);
         tempModelCMS_Buffets.RoomTypeID     = Convert.ToInt32(this.EditRoomTypeID.EditValue);
         tempModelCMS_Buffets.StateID        = Convert.ToInt32(VariedEnum.BuffetStatus.空闲);
         tempModelCMS_Buffets.InfoNote       = this.txtInfoNote.Text.Trim();
         tempModelCMS_Buffets.CreateDate     = tempModelCMS_Buffets.ModifyDate = DateTime.Now;
         tempModelCMS_Buffets.CreatePerson   = tempModelCMS_Buffets.ModifyPerson = frmAssist.frmLogin.SysUser.UserName;
         return(tempModelCMS_Buffets);
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message);
     }
     return(null);
 }