public static void InsertToathuoc( string MABENHAN, string MATHUOC, string SOLUONG, string SOLANDUNG, string SOLUONGDUNG,DateTime NGAYTAO) { using (DB_HMS_Entities dk = new DB_HMS_Entities()) { tbKETOATHUOC sl = new tbKETOATHUOC(); sl.MABENHAN = MABENHAN; sl.SOLUONG = Int32.Parse(SOLUONG); sl.SOLANDUNG = Int32.Parse(SOLANDUNG); sl.SOLUONGDUNG = Int32.Parse(SOLUONGDUNG); sl.NGAYTAO = NGAYTAO; dk.SaveChanges(); } }
public static void UpdateToathuoc(string MABENHAN, string MATHUOC, string SOLUONG, string SOLANDUNG, string SOLUONGDUNG,DateTime NGAYTAO) { using (DB_HMS_Entities ds = new DB_HMS_Entities()) { tbKETOATHUOC pk = new tbKETOATHUOC(); var query = (from dss in ds.tbKETOATHUOCs where dss.MABENHAN == MABENHAN select dss).First(); //query.MABENH = MABENH; query.MATHUOC = MATHUOC; query.SOLUONG = int.Parse(SOLUONG); query.SOLANDUNG = int.Parse(SOLANDUNG); query.SOLUONGDUNG = int.Parse(SOLUONGDUNG); query.NGAYTAO = NGAYTAO; ds.SaveChanges(); } }
/// <summary> /// Deprecated Method for adding a new object to the tbKETOATHUOCs EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTotbKETOATHUOCs(tbKETOATHUOC tbKETOATHUOC) { base.AddObject("tbKETOATHUOCs", tbKETOATHUOC); }
/// <summary> /// Create a new tbKETOATHUOC object. /// </summary> /// <param name="sTT">Initial value of the STT property.</param> public static tbKETOATHUOC CreatetbKETOATHUOC(global::System.Int32 sTT) { tbKETOATHUOC tbKETOATHUOC = new tbKETOATHUOC(); tbKETOATHUOC.STT = sTT; return tbKETOATHUOC; }