Beispiel #1
0
 //绑定仓库
 private void lbHYList_CK()
 {
     HY_BLL.HY_WarehouseBLL hywar = new HY_WarehouseBLL();
     this.s_Warehouse.DataSource    = hywar.ExecuteQuery();
     this.s_Warehouse.DisplayMember = "c_ckName";
     this.s_Warehouse.ValueMember   = "c_ID";
 }
        private void W_DEL_Click(object sender, EventArgs e)
        {
            //实例化仓库实体类
            HY_Model.HY_Warehouse hywar = new HY_Model.HY_Warehouse();
            hywar.C_ID = int.Parse(this.lbCK.SelectedValue.ToString());//选择仓库项值

            HY_BLL.HY_WarehouseBLL hydep = new HY_WarehouseBLL();
            int res = hydep.del_Warehouse(hywar);

            if (res > 0)
            {
                MessageBoxEx.Show("提示:成功删除仓库!");
                lbHYList_BM();
            }
        }
        private void W_ADD_Click(object sender, EventArgs e)
        {
            string ckName = this.ckName.Text.Trim();

            if (ckName == string.Empty)
            {
                MessageBoxEx.Show("提示:仓库名称不能为空!");
                this.ckName.Focus();
                return;
            }
            //实例化仓库实体类
            HY_Model.HY_Warehouse w = new HY_Model.HY_Warehouse();
            w.C_ckName = this.ckName.Text.Trim();

            HY_BLL.HY_WarehouseBLL hywar = new HY_WarehouseBLL();
            int res = hywar.com_Warehouse(w);

            if (res > 0)
            {
                MessageBoxEx.Show("提示:仓库添加成功!");
                this.ckName.Text = "";
                lbHYList_CK();
            }
        }