Ejemplo n.º 1
0
        private void toolStripButtonAdd_Click(object sender, EventArgs e)
        {
            Class_Executor    E  = new Class_Executor();
            Form_EditExecutor _f = new Form_EditExecutor(E);

            _f.ShowDialog();
            Load_Data();
        }
Ejemplo n.º 2
0
 public void Save_Executor_Information(Class_Executor _Obj)
 {
     MongoCollection<Class_Executor> Collection_ = Database_.GetCollection<Class_Executor>("Executor");
     BsonDocument Stu_Doc = new BsonDocument()
         .Add("_id", _Obj._id)
         .Add("Fio", _Obj.Fio);
     Collection_.Save(Stu_Doc);
 }
Ejemplo n.º 3
0
 public void Update_Executor_Information(Class_Executor _Obj)
 {
     MongoCollection<Class_Executor> Collection_ = Database_.GetCollection<Class_Executor>("Executor");
     IMongoQuery Marker = Query.EQ("Id", _Obj.Id);
     IMongoUpdate Update_ = MongoDB.Driver.Builders.Update
         .Set("Fio", _Obj.Fio);
     Collection_.Update(Marker, Update_);
 }
Ejemplo n.º 4
0
       public void Insert_Executor_Information(Class_Executor _Obj)
       {
           MongoCollection<Class_Executor> Collection_ = Database_.GetCollection<Class_Executor>("Executor");
           BsonDocument Stu_Doc = new BsonDocument {  
               {  
                   "Id", _Obj.Id
               },
               {  
                   "Fio", _Obj.Fio
               }
 
           };
           Collection_.Insert(Stu_Doc);
       }
Ejemplo n.º 5
0
        private void toolStripBupdate_Click(object sender, EventArgs e)
        {
            Class_Executor    E  = (Class_Executor)BSExecutor.Current;
            Form_EditExecutor _f = new Form_EditExecutor(E);

            if (E != null)
            {
                _f.ShowDialog();
                Load_Data();
            }
            else
            {
                MessageBox.Show("Выберите слесаря");
            }
        }
Ejemplo n.º 6
0
        private void toolStripButtonDelete_Click(object sender, EventArgs e)
        {
            Class_Executor A = (Class_Executor)BSExecutor.Current;

            if (A != null)
            {
                DialogResult dr = MessageBox.Show("Удалить слесаря " + A.Fio + "?",
                                                  "Внимание!", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dr == System.Windows.Forms.DialogResult.Yes)
                {
                    _Obj.Delete_Executor_Infromation(A);
                }
                Load_Data();
            }
            else
            {
                MessageBox.Show("Выберите слесаря");
            }
        }
Ejemplo n.º 7
0
 public Form_EditExecutor(Class_Executor StuObj)
 {
     InitializeComponent();
     StuObj_ = StuObj;
 }
Ejemplo n.º 8
0
 public void Delete_Executor_Infromation(Class_Executor _Obj)
 {
     MongoCollection<Class_Executor> Collection_ = Database_.GetCollection<Class_Executor>("Executor");
     IMongoQuery Marker = Query.EQ("Id", _Obj.Id);
     Collection_.Remove(Marker);
 }