예제 #1
0
        //点击确定
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (name.Text == "")
            {
                name.Focus();
                GeneralClass.printErrorMsg("请输入项目名称");
                return;
            }
            m_WaiterItem.name = name.Text;
            m_WaiterItem.note = note.Text;

            if (newWaiterItem)
            {
                if (db.WaiterItem.FirstOrDefault(x => x.name == name.Text) != null)
                {
                    name.SelectAll();
                    name.Focus();
                    GeneralClass.printErrorMsg("已存在" + name.Text + "服务项目,不能重复添加");
                    return;
                }
                db.WaiterItem.InsertOnSubmit(m_WaiterItem);
                db.SubmitChanges();
                m_rmForm.dgv_show();

                m_WaiterItem = new WaiterItem();
                name.Text = "";
                note.Text = "";
                name.Focus();
            }
            else
            {
                db.SubmitChanges();
                this.DialogResult = DialogResult.OK;
            }
        }
예제 #2
0
 //构造函数
 public WaitForm(BathDBDataContext dc, WaiterItem room, WaitManagementForm rm)
 {
     db = dc;
     m_rmForm = rm;
     if (room != null)
     {
         newWaiterItem = false;
         m_WaiterItem = room;
     }
     InitializeComponent();
 }
예제 #3
0
 partial void UpdateWaiterItem(WaiterItem instance);
예제 #4
0
 partial void DeleteWaiterItem(WaiterItem instance);
예제 #5
0
 partial void InsertWaiterItem(WaiterItem instance);