Example #1
0
 public void Save_Disrepair_Information(Class_Disrepair _Obj)
 {
     MongoCollection<Class_Disrepair> Collection_ = Database_.GetCollection<Class_Disrepair>("Disrepair");
     BsonDocument Stu_Doc = new BsonDocument()
         .Add("_id", _Obj._id)
         .Add("FAILURENM", _Obj.FAILURENM);
     Collection_.Save(Stu_Doc);
 }
Example #2
0
        private void toolStripButtonAdd_Click(object sender, EventArgs e)
        {
            Class_Disrepair    D  = new Class_Disrepair();
            Form_EditDisrepair _f = new Form_EditDisrepair(D);

            _f.ShowDialog();
            Load_Data();
        }
Example #3
0
 public void Update_Disrepair_Information(Class_Disrepair _Obj)
 {
     MongoCollection<Class_Disrepair> Collection_ = Database_.GetCollection<Class_Disrepair>("Disrepair");
     IMongoQuery Marker = Query.EQ("Id", _Obj.Id);
     IMongoUpdate Update_ = MongoDB.Driver.Builders.Update
         .Set("FAILURENM", _Obj.FAILURENM);
     Collection_.Update(Marker, Update_);
 }
Example #4
0
       public void Insert_Disrepair_Information(Class_Disrepair _Obj)
       {
           MongoCollection<Class_Disrepair> Collection_ = Database_.GetCollection<Class_Disrepair>("Disrepair");
           BsonDocument Stu_Doc = new BsonDocument {  
               {  
                   "Id", _Obj.Id
               },
               {  
                   "FAILURENM", _Obj.FAILURENM
               }
 
           };
           Collection_.Insert(Stu_Doc);
       }
Example #5
0
        private void toolStripBupdate_Click(object sender, EventArgs e)
        {
            Class_Disrepair    D  = (Class_Disrepair)BSDisrepair.Current;
            Form_EditDisrepair _f = new Form_EditDisrepair(D);

            if (D != null)
            {
                _f.ShowDialog();
                Load_Data();
            }
            else
            {
                MessageBox.Show("Выберите неисправность");
            }
        }
Example #6
0
        private void toolStripButtonDelete_Click(object sender, EventArgs e)
        {
            Class_Disrepair A = (Class_Disrepair)BSDisrepair.Current;

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