Ejemplo n.º 1
0
        /// <summary>
        /// 添加或修改数据
        /// </summary>
        private void UpdateData()
        {
            bool  blResult = false;
            int   id       = Request.Form["id"] != "" ? Convert.ToInt32(Request.Form["id"]) : 0;
            Admin model    = GetData(id);

            string writeMsg = "操作失败!";

            if (model != null)
            {
                if (id < 1)
                {
                    blResult = bll.Add(model);
                    if (blResult)
                    {
                        writeMsg = "增加成功!";
                    }
                    else
                    {
                        writeMsg = "增加失败!";
                    }
                }
                else
                {
                    blResult = bll.Update(model);
                    if (blResult)
                    {
                        writeMsg = "更新成功!";
                    }
                    else
                    {
                        writeMsg = "更新失败!";
                    }
                }
            }
            Response.Clear();
            Response.Write(writeMsg);
            Response.End();
        }
Ejemplo n.º 2
0
 public int AddAdmin(AdministratorInfo admin)
 {
     return(Adminbll.Add(admin));
 }