コード例 #1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (CheckEmpty())
            {
                DeskInfoBLL dkBll = new DeskInfoBLL();
                DeskInfo dk = new DeskInfo();
                dk.DeskName = txtDeskName.Text;
                dk.DeskRegion = txtDeskRegion.Text;//描述信息
                dk.DeskRemark = txtDeskRemark.Text;//备注
                dk.RoomId = Convert.ToInt32(cmbRoom.SelectedValue);//房间的id

                if (Temp == 1)//新增
                {
                    dk.DelFlag = 0;
                    dk.DeskState = 0;//空闲===1===就餐
                    dk.SubBy = 1;
                    dk.SubTime = System.DateTime.Now;
                }
                else if (Temp == 2)//修改操作
                {
                    dk.DeskId = Convert.ToInt32(labId.Text);
                }
                md.MsgDivShow(dkBll.AddOrUpdateDeskInfo(dk, Temp) ? "操作成功" : "操作失败", 1, Bind);
            }
        }