コード例 #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);
            }
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (CheckEmpty())
            {
                DeskInfo desk = new DeskInfo();
                desk.DeskName   = txtName.Text;
                desk.DeskRegion = txtRegion.Text;
                desk.DeskRemark = txtRemark.Text;

                desk.RoomId = Convert.ToInt32(cmbRoom.SelectedValue);//房间的id
                if (Temp == 1)
                {
                    desk.DeskState = 0;
                    desk.SubBy     = 1;
                    desk.SubTime   = DateTime.Now;
                    desk.DelFlag   = 0;
                }
                else if (Temp == 2)
                {
                    desk.DeskId = Convert.ToInt32(labId.Text);
                }
                string strMsg = bll.AddOrUpdateDeskInfo(desk, Temp) ? "操作成功" : "操作失败";
                msg.MsgDivShow(strMsg, 1, Bind);
            }
        }