示例#1
0
        public static bool NhapHang(Hang h)
        {
            bool nhap = false;
            if (isConnect())
            {
                SqlCommand com = new SqlCommand();
                com.CommandText = "Nhap_Hang";
                com.CommandType = CommandType.StoredProcedure;
                com.Parameters.AddWithValue("@ten", h.Ten);
                com.Parameters.AddWithValue("@maloai", h.Loai);
                com.Parameters.AddWithValue("@nguon", h.nguon);
                com.Parameters.AddWithValue("@soluong", h.sl);
                com.Connection = con;
                int i = com.ExecuteNonQuery();
                nhap = i > 0 ? true : false;

            }
            return nhap;
        }
示例#2
0
        public static bool NhapHang(Hang h)
        {
            bool nhap = false;

            if (isConnect())
            {
                SqlCommand com = new SqlCommand();
                com.CommandText = "Nhap_Hang";
                com.CommandType = CommandType.StoredProcedure;
                com.Parameters.AddWithValue("@ten", h.Ten);
                com.Parameters.AddWithValue("@maloai", h.Loai);
                com.Parameters.AddWithValue("@nguon", h.nguon);
                com.Parameters.AddWithValue("@soluong", h.sl);
                com.Connection = con;
                int i = com.ExecuteNonQuery();
                nhap = i > 0 ? true : false;
            }
            return(nhap);
        }