private void SaveData(LoadOperation<tram_vt> lo) { if (lo.Entities.Count() > 0) { MessageBox.Show("Mã trạm viễn thông " + this.txtmaxa.Text.Trim().ToUpper() + " đã tồn tại"); } else { if (txtmaxa.Text.Trim() != "" || txtten.Text.Trim() != "") { tram_vt tram = new tram_vt { ma_tram = txtmaxa.Text.Trim().ToUpper(), ten_tram = txtten.Text.Trim(), ma_huyen = App.ma_huyen }; dstb.tram_vts.Add(tram); dstb.SubmitChanges(OnSubmitCompleted, true); } else MessageBox.Show("Nhập chưa đủ thông tin"); } }
/// <summary> /// Create a new tram_vt object. /// </summary> /// <param name="ma_tram">Initial value of the ma_tram property.</param> /// <param name="ten_tram">Initial value of the ten_tram property.</param> /// <param name="ma_huyen">Initial value of the ma_huyen property.</param> /// <param name="id">Initial value of the id property.</param> public static tram_vt Createtram_vt(global::System.String ma_tram, global::System.String ten_tram, global::System.String ma_huyen, global::System.Decimal id) { tram_vt tram_vt = new tram_vt(); tram_vt.ma_tram = ma_tram; tram_vt.ten_tram = ten_tram; tram_vt.ma_huyen = ma_huyen; tram_vt.id = id; return tram_vt; }
/// <summary> /// Deprecated Method for adding a new object to the tram_vt EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTotram_vt(tram_vt tram_vt) { base.AddObject("tram_vt", tram_vt); }