Esempio n. 1
0
        public int Update(Book.Model.T_Base_Provider provider)
        {
            Book.DAL.T_Base_Provider dal = new DAL.T_Base_Provider();
            int result = dal.Update(provider);

            return(result);
        }
Esempio n. 2
0
        public ActionResult upDateSave(Book.Model.T_Base_Provider book)
        {
            Book.BLL.T_Base_Provider updatebook = new Book.BLL.T_Base_Provider();
            int result = updatebook.upDate(book);

            return(Redirect("/Provider/Index"));
        }
Esempio n. 3
0
 public int Add(Book.Model.T_Base_Provider provider)
 {
     Book.DAL.T_Base_Provider dal = new DAL.T_Base_Provider();
     //用DAL层提供的添加方法添加
     dal.Add(provider);
     return(0);
 }
Esempio n. 4
0
        public ActionResult UpdateSave(Book.Model.T_Base_Provider provider)
        {
            Book.BLL.T_Base_Provider bll = new BLL.T_Base_Provider();
            int result = bll.Update(provider);

            return(Redirect("Index"));
        }
Esempio n. 5
0
        public Book.Model.T_Base_Provider GetModel(int Id)
        {
            SqlConnection co = new SqlConnection();

            co.ConnectionString = "server=10.132.239.3;uid=sa;pwd=Jsj123456;database=152111160209";
            co.Open();
            SqlCommand cmd = new SqlCommand();

            cmd.Connection  = co;
            cmd.CommandText = "select * from  t_base_provider where id=@Id";
            cmd.Parameters.AddWithValue("@Id", Id);
            SqlDataReader dr = cmd.ExecuteReader();

            Book.Model.T_Base_Provider item = null;
            while (dr.Read())
            {
                item      = new Book.Model.T_Base_Provider();
                item.Id   = Convert.ToInt32(dr["Id"]);
                item.Name = Convert.ToString(dr["Name"]);
                item.Tel  = Convert.ToString(dr["Tel"]);
                item.Fax  = Convert.ToString(dr["Fax"]);
                item.Memo = Convert.ToString(dr["Memo"]);
            }
            dr.Close();
            co.Close();
            return(item);
        }
Esempio n. 6
0
        public int AddSave(Book.Model.T_Base_Provider provider)
        {
            Book.DAL.T_Base_Provider providerAddSave = new DAL.T_Base_Provider();
            int result = providerAddSave.AddSave(provider);

            return(result);
        }
Esempio n. 7
0
        public int Add(Book.Model.T_Base_Provider book)
        {
            int result = 0;

            Book.DAL.T_Base_Provider dal = new DAL.T_Base_Provider();
            result = dal.Add(book);
            return(result);
        }
Esempio n. 8
0
        public int Add(Book.Model.T_Base_Provider provider)
        {
            SqlConnection co = new SqlConnection();

            co.ConnectionString = "server=10.132.239.3;uid=sa;pwd=Jsj123456;database=15211160113";
            co.Open();
            SqlCommand cm = new SqlCommand();

            cm.Connection  = co;
            cm.CommandText = "Insert into T_Base_Provider(Name,Tel,Fax,Memo) values (@Name,@Tel,@Fax,@Memo)";
            cm.Parameters.AddWithValue("@Name", provider.Name);
            cm.Parameters.AddWithValue("@Tel", provider.Tel);
            cm.Parameters.AddWithValue("@Fax", provider.Fax);
            cm.Parameters.AddWithValue("@Memo", provider.Memo);
            int result = cm.ExecuteNonQuery();

            co.Close();
            return(result);
        }
Esempio n. 9
0
        public int upDate(Book.Model.T_Base_Provider book)
        {
            SqlConnection co = new SqlConnection();

            co.ConnectionString = "server=10.132.239.3;uid=sa;pwd=Jsj123456;database=152111160209";
            co.Open();
            SqlCommand cm = new SqlCommand();

            cm.Connection  = co;
            cm.CommandText = "update t_base_provider set Name=@Name, Tel=@Tel, Fax=@Fax,Memo=@Memo where Id=@Id";
            cm.Parameters.AddWithValue("@Id", book.Id);
            cm.Parameters.AddWithValue("@Name", book.Name);
            cm.Parameters.AddWithValue("@Tel", book.Tel);
            cm.Parameters.AddWithValue("@Fax", book.Fax);
            cm.Parameters.AddWithValue("@Memo", book.Memo);
            int result = cm.ExecuteNonQuery();

            co.Close();
            return(result);
        }
Esempio n. 10
0
 public ActionResult update(int Id)
 {
     Book.Model.T_Base_Provider book = (new Book.BLL.T_Base_Provider()).GetModel(Id);
     ViewBag.Book = book;
     return(View());
 }