Пример #1
0
       public void Insert_Request_Information(Class_Request _Obj)
       {
           MongoCollection<Class_Request> Collection_ = Database_.GetCollection<Class_Request>("Request");
           BsonDocument Stu_Doc = new BsonDocument {  
               {  
                   "Id", _Obj.Id
               },
               {  
                   "AccountCD", _Obj.AccountCD 
               },
                {  
                   "ExecutorCD", _Obj.ExecutorCD
               },
                {  
                   "FailureCD", _Obj.FailureCD
               },
                {  
                   "ExecutionDate", _Obj.ExecutionDate
               },
                {  
                   "IncomingDate", _Obj.IncomingDate
               },
                {  
                   "Executed", _Obj.Executed
               }
 
           };
           Collection_.Insert(Stu_Doc);
       }
Пример #2
0
        private void toolStripButtonAdd_Click(object sender, EventArgs e)
        {
            Class_Request    R  = new Class_Request();
            Form_EditRequest _f = new Form_EditRequest(R);

            _f.ShowDialog();
            Load_Data();
        }
Пример #3
0
 public void Save_Request_Information(Class_Request _Obj)
 {
     MongoCollection<Class_Request> Collection_ = Database_.GetCollection<Class_Request>("Request");
     BsonDocument Stu_Doc = new BsonDocument()
         .Add("_id", _Obj._id)
         .Add("ExecutorCD", _Obj.ExecutorCD)
         .Add("FailureCD", _Obj.FailureCD)
         .Add("ExecutionDate", _Obj.ExecutionDate)
         .Add("IncomingDate", _Obj.IncomingDate)
         .Add("Executed", _Obj.Executed);
     Collection_.Save(Stu_Doc);
 }
Пример #4
0
        public void Update_Request_Information(Class_Request _Obj)
        {
            MongoCollection<Class_Request> Collection_ = Database_.GetCollection<Class_Request>("Request");
            IMongoQuery Marker = Query.EQ("Id", _Obj.Id);

            IMongoUpdate Update_ = MongoDB.Driver.Builders.Update
                .Set("ExecutorCD", _Obj.ExecutorCD)
                .Set("FailureCD", _Obj.FailureCD)
                .Set("ExecutionDate", _Obj.ExecutionDate)
                .Set("IncomingDate", _Obj.IncomingDate)
                .Set("Executed", _Obj.Executed);
            Collection_.Update(Marker, Update_);
        }
Пример #5
0
        private void toolStripBupdate_Click(object sender, EventArgs e)
        {
            Class_Request    R  = (Class_Request)BSRequest.Current;
            Form_EditRequest _f = new Form_EditRequest(R);

            if (R != null)
            {
                _f.ShowDialog();
                Load_Data();
            }
            else
            {
                MessageBox.Show("Выберите заявку");
            }
        }
Пример #6
0
        private void toolStripButtonDelete_Click(object sender, EventArgs e)
        {
            Class_Request A = (Class_Request)BSRequest.Current;

            if (A != null)
            {
                DialogResult dr = MessageBox.Show("Удалить заявку " + A.Id + "?",
                                                  "Внимание!", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dr == System.Windows.Forms.DialogResult.Yes)
                {
                    _Obj.Delete_Request_Infromation(A);
                }
                Load_Data();
            }
            else
            {
                MessageBox.Show("Выберите заявку");
            }
        }
Пример #7
0
 public Form_EditRequest(Class_Request StuObj)
 {
     InitializeComponent();
     StuObj_ = StuObj;
 }
Пример #8
0
 public void Delete_Request_Infromation(Class_Request _Obj)
 {
     MongoCollection<Class_Request> Collection_ = Database_.GetCollection<Class_Request>("Request");
     IMongoQuery Marker = Query.EQ("Id", _Obj.Id);
     Collection_.Remove(Marker);
 }