示例#1
0
        public bool DeleteQuan(QuanDLdata ldl)
        {
            string        sql = "DELETE FROM QuanDL Where MaQuan = @MaQuan";
            SqlConnection con = dc.GetConnect();

            try
            {
                con.Open();
                cmd = new SqlCommand(sql, con);
                cmd.Parameters.Add("@MaQuan", SqlDbType.NChar).Value = ldl.MaQuan;
                cmd.ExecuteNonQuery();
                con.Close();
            }
            catch (Exception e)
            {
                return(false);
            }
            return(true);
        }
示例#2
0
 public bool UpDateQuan(QuanDLdata ldl)
 {
     try
     {
         SqlConnection con = dc.GetConnect();
         con.Open();
         string sql = "UPDATE QuanDL set TenQuan = @TenQuan where MaQuan = @MaQuan";
         cmd = new SqlCommand(sql, con);
         cmd.Parameters.Add("@MaQuan", SqlDbType.NChar).Value     = ldl.MaQuan;
         cmd.Parameters.Add("@TenQuan", SqlDbType.NVarChar).Value = ldl.TenQuan;
         cmd.ExecuteNonQuery();
         con.Close();
     }
     catch (Exception e)
     {
         return(false);
     }
     return(true);
 }
示例#3
0
        public bool InserQuan(QuanDLdata ldl)
        {
            string        sql = "Insert into QuanDL (MaQuan, TenQuan) Values(@MaQuan, @TenQuan)";
            SqlConnection con = dc.GetConnect();

            try
            {
                cmd = new SqlCommand(sql, con);
                con.Open();
                cmd.Parameters.Add("@MaQuan", SqlDbType.NChar).Value     = ldl.MaQuan;
                cmd.Parameters.Add("@TenQuan", SqlDbType.NVarChar).Value = ldl.TenQuan;
                cmd.ExecuteNonQuery();
                con.Close();
            }
            catch (Exception e)
            {
                return(false);
            }
            return(true);
        }
示例#4
0
 public bool DeleteQuan(QuanDLdata q)
 {
     return(dataq.DeleteQuan(q));
 }
示例#5
0
 public bool UpDateQuan(QuanDLdata q)
 {
     return(dataq.UpDateQuan(q));
 }
示例#6
0
 public bool InsertQuan(QuanDLdata q)
 {
     return(dataq.InserQuan(q));
 }