public bool Xoaloaisanpham(DTO.Loaisanpham lsp)
        {
            string        sql = "UPDATE LOAISANPHAM SET XOA = 1 WHERE MALOAI = @MALOAI";
            SqlConnection con = dc.getConnect();

            try
            {
                cmd = new SqlCommand(sql, con);
                con.Open();
                cmd.Parameters.Add("@MALOAI", SqlDbType.Int).Value = lsp.MALOAI1;
                cmd.ExecuteNonQuery();
                con.Close();
            }
            catch (Exception e)
            {
                return(false);
            }
            return(true);
        }
        public bool Themloaisanpham(DTO.Loaisanpham lsp)
        {
            string        sql = "INSERT INTO LOAISANPHAM(TENLOAI)values (@TENLOAI)";
            SqlConnection con = dc.getConnect();

            try
            {
                cmd = new SqlCommand(sql, con);
                con.Open();
                cmd.Parameters.Add("@TENLOAI", SqlDbType.NVarChar).Value = lsp.TENLOAI1;
                cmd.ExecuteNonQuery();
                con.Close();
            }
            catch (Exception e)
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 3
0
 public bool Sualoaisanpham(DTO.Loaisanpham lsp)
 {
     return(lspd.Sualoaisanpham(lsp));
 }
Ejemplo n.º 4
0
 public bool Xoaloaisanpham(DTO.Loaisanpham lsp)
 {
     return(lspd.Xoaloaisanpham(lsp));
 }
Ejemplo n.º 5
0
 public bool Themloaisanpham(DTO.Loaisanpham lsp)
 {
     return(lspd.Themloaisanpham(lsp));
 }