Beispiel #1
0
        public ActionResult UpdateSave(Book.Model.T_Base_Customer Customer)
        {
            Book.BLL.T_Base_Customer bll = new BLL.T_Base_Customer();
            int result = bll.Update(Customer);

            return(Redirect("Index"));
        }
Beispiel #2
0
        public int Update(Book.Model.T_Base_Customer Customer)
        {
            Book.DAL.T_Base_Customer dal = new DAL.T_Base_Customer();
            int result = dal.Update(Customer);

            return(result);
        }
Beispiel #3
0
 public int Add(Book.Model.T_Base_Customer Customer)
 {
     Book.DAL.T_Base_Customer dal = new DAL.T_Base_Customer();
     //用DAL层提供的添加方法添加
     dal.Add(Customer);
     return(0);
 }
Beispiel #4
0
        public int AddSave(Book.Model.T_Base_Customer user)
        {
            Book.DAL.T_Base_Customer userAddSave = new DAL.T_Base_Customer();
            int result = userAddSave.AddSave(user);

            return(result);
        }
Beispiel #5
0
        public int Add(Book.Model.T_Base_Customer Customer)
        {
            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_Customer(Name,Tel,Fax,Memo) values (@Name,@Tel,@Fax,@Memo)";
            cm.Parameters.AddWithValue("@Name", Customer.Name);
            cm.Parameters.AddWithValue("@Tel", Customer.Tel);
            cm.Parameters.AddWithValue("@Fax", Customer.Fax);
            cm.Parameters.AddWithValue("@Memo", Customer.Memo);
            int result = cm.ExecuteNonQuery();

            co.Close();
            return(result);
        }
Beispiel #6
0
        public int AddSave(Book.Model.T_Base_Customer user)
        {
            SqlConnection co  = SQLServerOpen();
            SqlCommand    cmd = new SqlCommand();

            cmd.Connection  = co;
            cmd.CommandText = "insert into t_base_customer values(@CustomerName,@CustomerPwd," +
                              "@CustomerPostbox,@CustomerTel)";
            cmd.Parameters.AddWithValue("@CustomerName", user.CustomerName);
            cmd.Parameters.AddWithValue("@CustomerPwd", user.CustomerPwd);
            cmd.Parameters.AddWithValue("@CustomerPostbox", user.CustomerPostbox);
            cmd.Parameters.AddWithValue("@CustomerTel", user.CustomerTel);

            int result = cmd.ExecuteNonQuery();

            cmd.Clone();
            co.Close();

            return(result);
        }
Beispiel #7
0
        public int Update(Book.Model.T_Base_Customer Customer)
        {
            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 = "update T_Base_Customer set Name=@Name,Tel=@Tel,Fax=@Fax,Memo=@Memo where Id=@Id";
            cm.Parameters.AddWithValue("@Id", Customer.Id);
            cm.Parameters.AddWithValue("@Name", Customer.Name);
            cm.Parameters.AddWithValue("@Tel", Customer.Tel);
            cm.Parameters.AddWithValue("@Fax", Customer.Fax);
            cm.Parameters.AddWithValue("@Memo", Customer.Memo);

            int result = cm.ExecuteNonQuery();

            co.Close();
            return(result);
        }