Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Admin ai = new Admin();

            ai.admin_name = textBox1.Text;
            ai.password   = textBox2.Text;

            if (adminBll.Add(ai))
            {
                LoadList();
            }
            else
            {
                MessageBox.Show("添加失败");
            }
        }
Exemplo n.º 2
0
        public string Add(Admin model)
        {
            var rst = new ReturnResult <bool>();
            var bll = new AdminBll();

            if (model.Id == 0)
            {
                model.CreateTime = DateTime.Now;
                rst = bll.Add(model);
            }
            else
            {
                rst = bll.Update(model);
            }

            return(JsonHelper.Instance.Serialize(rst));
        }