Beispiel #1
0
    //加载
    public void LoadDataBind()
    {
        int ID = CommonClass.ReturnRequestInt("id", 0);

        if (ID > 0)
        {
            model = EmployeeService.InfoService.Get(ID);
        }
    }
Beispiel #2
0
    //加载
    public void LoadDataBind()
    {
        int ID = CommonClass.ReturnRequestInt("id", 0);

        if (ID > 0)
        {
            TB_Employee_Info model = EmployeeService.InfoService.Get(ID);
            if (model.ID.ToInt() > 0)
            {
                ViewState["id"]           = model.ID;
                DDLCateogry.SelectedValue = model.CategoryID.ToStr();
                TbTitle.Text     = model.Title;
                FckContent.Value = model.Remark;
            }
        }
    }
Beispiel #3
0
    //保存
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        TB_Employee_Info model = new TB_Employee_Info();

        if (ViewState["id"] != null)
        {
            model = EmployeeService.InfoService.Get(ViewState["id"]);
        }
        model.CategoryID = DDLCateogry.SelectedValue.ToInt();
        model.Title      = TbTitle.Text;
        model.Remark     = FckContent.Value;
        model.Creater    = AdminUserName;

        if (ViewState["id"] == null)
        {
            if (EmployeeService.InfoService.Insert(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据添加成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据添加失败");
            }
        }
        else
        {
            if (EmployeeService.InfoService.Update(model) == 1)
            {
                MessageDiv.InnerHtml = CommonClass.Reload("数据修改成功");
            }
            else
            {
                MessageDiv.InnerHtml = CommonClass.Alert("数据修改失败");
            }
        }
    }