Example #1
0
        public void BindGrid(string id)
        {
            Demo.BLL.tb_JC_Position   bll   = new Demo.BLL.tb_JC_Position();
            Demo.Model.tb_JC_Position model = new Demo.Model.tb_JC_Position();
            model = bll.GetModel(id);


            model.ID           = Guid.NewGuid().ToString();
            positionid.Text    = model.ID;
            positionnno.Text   = model.PositionNO;
            positionname.Text  = model.PositionName;
            DropDownList1.Text = model.DepartmentNO;

            // deptno.SelectedValue = deptbll.GetModelList("where DeptmentNo = "+  model.DepartmentNO)[0].DepartmentName;
        }
Example #2
0
        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            // 1. 这里放置保存窗体中数据的逻辑

            Demo.BLL.tb_JC_Position   bll   = new Demo.BLL.tb_JC_Position();
            Demo.Model.tb_JC_Position model = new Demo.Model.tb_JC_Position();

            model.ID           = Guid.NewGuid().ToString();
            model.PositionNO   = positionnno.Text.Trim();
            model.PositionName = positionname.Text.Trim();
            model.DepartmentNO = DropDownList1.SelectedItem.Value.Trim();


            if (bll.Add(model))
            {
                Alert.ShowInTop("添加成功");
            }
            else
            {
                Alert.ShowInTop("添加失败");
            }
            PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
        }
Example #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Demo.Model.tb_JC_Position model)
 {
     return(dal.Update(model));
 }
Example #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Demo.Model.tb_JC_Position model)
 {
     return(dal.Add(model));
 }