예제 #1
0
 void BtnOpenClick(object sender, EventArgs e)
 {
     if(lstDocs.SelectedItems.Count!=1) return;
     string docid=lstDocs.SelectedItems[0].Text;
     try
     {
         string doc=mCouchWrap.GetDocument(mServer,mDB,docid);
         // This output really needs formatting, but for now we will just
         // replace the unix line breaks with windows ones...
         doc=doc.Replace("\n","\r\n");
         ResultForm f2=new ResultForm(doc);
         f2.Show();
     }
     catch(Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
예제 #2
0
        void BtnOpenClick(object sender, EventArgs e)
        {
            if (lstDocs.SelectedItems.Count != 1)
            {
                return;
            }
            string docid = lstDocs.SelectedItems[0].Text;

            try
            {
                string doc = mCouchWrap.GetDocument(mServer, mDB, docid);
                // This output really needs formatting, but for now we will just
                // replace the unix line breaks with windows ones...
                doc = doc.Replace("\n", "\r\n");
                ResultForm f2 = new ResultForm(doc);
                f2.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #3
0
 void BtnQueryDBClick(object sender, EventArgs e)
 {
     string db=GetSelectedDB();
     if(db=="") return;
     QueryForm f=new QueryForm(mSavedMap,mSavedReduce);
     if(f.ShowDialog()==DialogResult.OK)
     {
         try
         {
             mSavedMap=f.MapFunction;
             mSavedReduce=f.ReduceFunction;
             string result=mDB.ExecTempView(txtServer.Text,db,mSavedMap,mSavedReduce==""?null:mSavedReduce,f.StartKey,f.EndKey);
             // This output really needs formatting, but for now we will just
             // replace the unix line breaks with windows ones...
             result=result.Replace("\n","\r\n");
             ResultForm f2=new ResultForm(result);
             f2.Show();
         }
         catch(Exception ex)
         {
             StatusBar.Items[0].Text=ex.Message;
         }
     }
 }
예제 #4
0
 void BtnGetDocClick(object sender, EventArgs e)
 {
     string db=GetSelectedDB();
     if(db=="") return;
     DocIDForm f=new DocIDForm();
     if(f.ShowDialog()==DialogResult.OK)
     {
         try
         {
             string doc=mDB.GetDocument(txtServer.Text,db,f.DocID);
             // This output really needs formatting, but for now we will just
             // replace the unix line breaks with windows ones...
             doc=doc.Replace("\n","\r\n");
             ResultForm f2=new ResultForm(doc);
             f2.Show();
         }
         catch(Exception ex)
         {
             StatusBar.Items[0].Text=ex.Message;
         }
     }
 }