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); }
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); }
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); }
public bool DeleteQuan(QuanDLdata q) { return(dataq.DeleteQuan(q)); }
public bool UpDateQuan(QuanDLdata q) { return(dataq.UpDateQuan(q)); }
public bool InsertQuan(QuanDLdata q) { return(dataq.InserQuan(q)); }