public void Update_Street_Information(Class_Street _Obj) { MongoCollection<Class_Street> Collection_ = Database_.GetCollection<Class_Street>("Street"); IMongoQuery Marker = Query.EQ("Id", _Obj.Id); IMongoUpdate Update_ = MongoDB.Driver.Builders.Update.Set("STREETNM", _Obj.STREETNM); Collection_.Update(Marker, Update_); }
private void toolStripButtonAdd_Click(object sender, EventArgs e) { Class_Street S = new Class_Street(); Form_EditStreet _f = new Form_EditStreet(S); _f.ShowDialog(); Load_Data(); }
public void Save_Street_Information(Class_Street _Obj) { MongoCollection<Class_Street> Collection_ = Database_.GetCollection<Class_Street>("Street"); BsonDocument Stu_Doc = new BsonDocument() .Add("_id", _Obj._id) .Add("STREETNM", _Obj.STREETNM); Collection_.Save(Stu_Doc); }
public void Insert_Street_Information(Class_Street _Obj) { MongoCollection<Class_Street> Collection_ = Database_.GetCollection<Class_Street>("Street"); BsonDocument Stu_Doc = new BsonDocument { { "Id", _Obj.Id }, { "STREETNM", _Obj.STREETNM } }; Collection_.Insert(Stu_Doc); }
private void toolStripBupdate_Click(object sender, EventArgs e) { Class_Street S = (Class_Street)BSStreet.Current; Form_EditStreet _f = new Form_EditStreet(S); if (S != null) { _f.ShowDialog(); Load_Data(); } else { MessageBox.Show("Выберите улицу"); } }
private void toolStripButtonDelete_Click(object sender, EventArgs e) { Class_Street A = (Class_Street)BSStreet.Current; if (A != null) { DialogResult dr = MessageBox.Show("Удалить улицу " + A.STREETNM + "?", "Внимание!", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == System.Windows.Forms.DialogResult.Yes) { _Obj.Delete_Street_Infromation(A); } Load_Data(); } else { MessageBox.Show("Выберите улицу"); } }
public Form_EditStreet(Class_Street StuObj) { InitializeComponent(); StuObj_ = StuObj; }
public void Filter_Street_Infromation(Class_Street _Obj) { MongoCollection<Class_Street> Collection_ = Database_.GetCollection<Class_Street>("Street"); IMongoQuery Marker = Query.EQ("Id", _Obj.Id); Collection_.Find(Marker); }