Exemplo n.º 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);
       }
Exemplo n.º 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();
        }
Exemplo n.º 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);
 }
Exemplo n.º 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_);
 }
Exemplo n.º 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("Выберите абонента");
            }
        }
Exemplo n.º 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("Выберите абонента");
            }
        }
Exemplo n.º 7
0
 public Form_EditAbonent(Class_Abonent StuObj)
 {
     InitializeComponent();
     StuObj_ = StuObj;
 }
Exemplo n.º 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);
 }