示例#1
0
       public void Insert_Abonent_Information(Class_Abonent _Obj)
       {
           MongoCollection<Class_Abonent> Collection_ = Database_.GetCollection<Class_Abonent>("Abonent");
           BsonDocument Stu_Doc = new BsonDocument {  
               {  
                   "Id", _Obj.Id
               },
               {  
                   "StreetCD", _Obj.StreetCD 
               },
                {  
                   "HouseNo", _Obj.HouseNo
               },
                {  
                   "FlatNo", _Obj.FlatNo
               },
                {  
                   "Fio", _Obj.Fio
               },
                {  
                   "Phone", _Obj.Phone
               }
 
           };
           Collection_.Insert(Stu_Doc);
       }
示例#2
0
        private void toolStripButtonAdd_Click(object sender, EventArgs e)
        {
            Class_Abonent    A  = new Class_Abonent();
            Form_EditAbonent _f = new Form_EditAbonent(A);

            _f.ShowDialog();
            Load_Data();
        }
示例#3
0
 public void Save_Abonent_Information(Class_Abonent _Obj)
 {
     MongoCollection<Class_Abonent> Collection_ = Database_.GetCollection<Class_Abonent>("Abonent");
     BsonDocument Stu_Doc = new BsonDocument()
         .Add("_id", _Obj._id)
         .Add("StreetCD", _Obj.StreetCD)
         .Add("HouseNo", _Obj.HouseNo)
         .Add("FlatNo", _Obj.FlatNo)
         .Add("Fio", _Obj.Fio)
         .Add("Phone", _Obj.Phone); ;
     Collection_.Save(Stu_Doc);
 }
示例#4
0
 public void Update_Abonent_Information(Class_Abonent _Obj)
 {
     MongoCollection<Class_Abonent> Collection_ = Database_.GetCollection<Class_Abonent>("Abonent");
     IMongoQuery Marker = Query.EQ("Id", _Obj.Id);
     IMongoUpdate Update_ = MongoDB.Driver.Builders.Update
         .Set("StreetCD", _Obj.StreetCD)
         .Set("HouseNo", _Obj.HouseNo)
         .Set("FlatNo", _Obj.FlatNo)
         .Set("Fio", _Obj.Fio)
         .Set("Phone", _Obj.Phone);
     Collection_.Update(Marker, Update_);
 }
示例#5
0
        private void toolStripBupdate_Click(object sender, EventArgs e)
        {
            Class_Abonent    A  = (Class_Abonent)BSAbonent.Current;
            Form_EditAbonent _f = new Form_EditAbonent(A);

            if (A != null)
            {
                _f.ShowDialog();
                Load_Data();
            }
            else
            {
                MessageBox.Show("Выберите абонента");
            }
        }
示例#6
0
        private void toolStripButtonDelete_Click(object sender, EventArgs e)
        {
            Class_Abonent A = (Class_Abonent)BSAbonent.Current;

            if (A != null)
            {
                DialogResult dr = MessageBox.Show("Удалить абонента " + A.Fio + "?",
                                                  "Внимание!", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dr == System.Windows.Forms.DialogResult.Yes)
                {
                    _Obj.Delete_Abonent_Infromation(A);
                }
                Load_Data();
            }
            else
            {
                MessageBox.Show("Выберите абонента");
            }
        }
示例#7
0
 public Form_EditAbonent(Class_Abonent StuObj)
 {
     InitializeComponent();
     StuObj_ = StuObj;
 }
示例#8
0
 public void Delete_Abonent_Infromation(Class_Abonent _Obj)
 {
     MongoCollection<Class_Abonent> Collection_ = Database_.GetCollection<Class_Abonent>("Abonent");
     IMongoQuery Marker = Query.EQ("Id", _Obj.Id);
     Collection_.Remove(Marker);
 }