Esempio n. 1
0
        public void BindGrid(string id)
        {
            Demo.BLL.tb_JC_Department   bll  = new Demo.BLL.tb_JC_Department();
            Demo.Model.tb_JC_Department dept = new Demo.Model.tb_JC_Department();

            dept = bll.GetModel(id);

            DeptmentId.Text     = dept.ID;
            DepartmentNO.Text   = dept.DepartmentNO;
            DepartmentName.Text = dept.DepartmentName;
        }
Esempio n. 2
0
        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            // 1. 这里放置保存窗体中数据的逻辑

            Demo.BLL.tb_JC_Department   bll  = new Demo.BLL.tb_JC_Department();
            Demo.Model.tb_JC_Department dept = new Demo.Model.tb_JC_Department();

            dept.ID             = Guid.NewGuid().ToString();
            dept.DepartmentNO   = DepartmentNO.Text.Trim();
            dept.DepartmentName = DepartmentName.Text.Trim();

            if (bll.Add(dept))
            {
                Alert.ShowInTop("添加成功");
            }
            else
            {
                Alert.ShowInTop("添加失败");
            }

            // 2. 关闭本窗体,然后刷新父窗体
            PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
        }
Esempio n. 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Demo.Model.tb_JC_Department model)
 {
     return(dal.Update(model));
 }
Esempio n. 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Demo.Model.tb_JC_Department model)
 {
     return(dal.Add(model));
 }