コード例 #1
0
        private DataTable GetTanDetailsTableFromActiveForm(out string tan_out, out string srcCntrl_out)
        {
            DataTable dtTanDetails = null;
            string    strTanNumber = "";
            string    strSrcCntrl  = "";

            try
            {
                frmCurator              objfrmCurator   = null;
                Forms.frmQryDuplicates  objfrmQueryDups = null;
                Enumeration.frmRGrpEnum objfrmEnum      = null;

                Form objActiveForm = this.ActiveMdiChild;

                if (objActiveForm != null)
                {
                    if (objActiveForm.Name.ToUpper() == "FRMCURATOR")
                    {
                        objfrmCurator = (frmCurator)objActiveForm;
                        dtTanDetails  = objfrmCurator.TANDetailsTbl;
                        strTanNumber  = objfrmCurator.TANNumber;

                        strSrcCntrl = "FRMCURATOR";
                    }
                    else if (objActiveForm.Name.ToUpper() == "FRMQRYDUPLICATES")
                    {
                        objfrmQueryDups = (Forms.frmQryDuplicates)objActiveForm;
                        dtTanDetails    = objfrmQueryDups.ucCheckDuplicates1.SearchResults;
                        strTanNumber    = objfrmQueryDups.ucCheckDuplicates1.TANNumber;

                        strSrcCntrl = "FRMQRYDUPLICATES";
                    }
                    else if (objActiveForm.Name.ToUpper() == "FRMRGRPENUM")
                    {
                        objfrmEnum   = (Enumeration.frmRGrpEnum)objActiveForm;
                        dtTanDetails = objfrmEnum.EnumResultsTbl;
                        strTanNumber = objfrmEnum.TANNumber;

                        string strPageNo    = objfrmEnum.PageNumber;
                        string strPageLabel = objfrmEnum.PageLabel;
                        string strExampleNo = objfrmEnum.ExampleNumber;
                        string strTableNo   = objfrmEnum.TableNumber;

                        strSrcCntrl = "FRMRGRPENUM";

                        RebuildTANDetailsTable_Enum(ref dtTanDetails, strPageNo, strPageLabel, strExampleNo, strTableNo);
                    }
                    tan_out      = strTanNumber;
                    srcCntrl_out = strSrcCntrl;
                    return(dtTanDetails);
                }
            }
            catch (Exception ex)
            {
                PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
            }
            tan_out      = strTanNumber;
            srcCntrl_out = strSrcCntrl;
            return(dtTanDetails);
        }
コード例 #2
0
ファイル: Validations.cs プロジェクト: gituser1510/Test3
        public static string GetInchiKeyFromInchiString(string inchistring)
        {
            string strInchikey = "";

            try
            {
                if (inchistring.Trim() != "")
                {
                    string[] splitter    = { "InChIKey=" };
                    string[] strInchiArr = inchistring.Trim().Split(splitter, StringSplitOptions.RemoveEmptyEntries);
                    if (strInchiArr != null)
                    {
                        if (strInchiArr.Length == 2)
                        {
                            strInchikey = strInchiArr[1];
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
            }
            return(strInchikey);
        }
コード例 #3
0
        private void DisableMenuItems()
        {
            try
            {
                browsePDFToolStripMenuItem.Enabled = false;
                LoadTANtoolStripMenuItem.Enabled   = false;
                exportToolStripMenuItem.Enabled    = false;
                XMLToolStripMenuItem.Enabled       = false;
                queryToolStripMenuItem.Enabled     = false;
                EnumtoolStripMenuItem.Enabled      = false;
                setttingsToolStripMenuItem.Enabled = false;
                taskToolStripMenuItem.Enabled      = false;
                phaseToolStripMenuItem.Enabled     = false;

                dictionaryToolStripMenuItem.Enabled  = false;
                insertDictToolStripMenuItem.Enabled  = false;
                deleteDictToolStripMenuItem1.Enabled = false;
                updateDictToolStripMenuItem1.Enabled = false;
                retrieveDictStripMenuItem1.Enabled   = false;
                lookUpToolStripMenuItem.Enabled      = false;
            }
            catch (Exception ex)
            {
                PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
            }
        }
コード例 #4
0
        private void rGroupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                FormCollection          frmColl     = Application.OpenForms;
                Enumeration.frmRGrpEnum objRgrpEnum = null;
                bool blFrmOpen = false;

                foreach (Form frm in frmColl)
                {
                    if (frm.Name.ToUpper() == "FRMRGRPENUM")
                    {
                        objRgrpEnum = (Enumeration.frmRGrpEnum)frm;
                        blFrmOpen   = true;
                        objRgrpEnum.Show();
                        objRgrpEnum.WindowState = FormWindowState.Maximized;
                    }
                }
                if (!blFrmOpen)
                {
                    objRgrpEnum           = new Enumeration.frmRGrpEnum();
                    objRgrpEnum.MdiParent = this;
                    objRgrpEnum.Show();
                }
            }
            catch (Exception ex)
            {
                PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
            }
        }
コード例 #5
0
ファイル: Validations.cs プロジェクト: gituser1510/Test3
 public static ArrayList GetArrayListFromDataTable(DataTable _dtTanIds, int colindex)
 {
     try
     {
         if (_dtTanIds != null)
         {
             ArrayList lstTANIds = new ArrayList();
             if (_dtTanIds.Rows.Count > 0)
             {
                 for (int i = 0; i < _dtTanIds.Rows.Count; i++)
                 {
                     if (!lstTANIds.Contains(_dtTanIds.Rows[i][colindex].ToString()))
                     {
                         lstTANIds.Add(_dtTanIds.Rows[i][colindex].ToString());
                     }
                 }
             }
             return(lstTANIds);
         }
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
     return(null);
 }
コード例 #6
0
ファイル: Validations.cs プロジェクト: gituser1510/Test3
        public static string RemoveSMILESFromIUPACName(string iupacname)
        {
            string strIUPACName = iupacname;

            try
            {
                if (iupacname.Trim() != "")
                {
                    string[] strSplitter  = { " " };
                    string[] strSplitVals = iupacname.Split(strSplitter, StringSplitOptions.RemoveEmptyEntries);
                    if (strSplitVals != null)
                    {
                        if (strSplitVals.Length > 1)
                        {
                            //strIUPACName = strSplitVals[1].Trim();
                            //return strIUPACName;

                            strSplitVals[0] = "";
                            strIUPACName    = String.Join(" ", strSplitVals);
                            return(strIUPACName.Trim());
                        }
                        else if (strSplitVals.Length == 1)
                        {
                            strIUPACName = String.Join(" ", strSplitVals);
                            return(strIUPACName.Trim());
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
            }
            return(strIUPACName);
        }
コード例 #7
0
        private void OpenFile()
        {
            try
            {
                openFileDialog1.Filter      = "XML Files (*.xml)|*.xml|Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
                openFileDialog1.FilterIndex = 1;
                openFileDialog1.Title       = "Select a file to open";
                openFileDialog1.FileName    = "";
                openFileDialog1.ShowDialog();

                if (openFileDialog1.FileName != "")
                {
                    xmlFileName = openFileDialog1.FileName;

                    txtXmlFile.Text = xmlFileName.Trim();

                    RichTextBox1.LoadFile(openFileDialog1.FileName, RichTextBoxStreamType.PlainText);
                    this.Text = "Xml Editor | " + xmlFileName.Substring(xmlFileName.LastIndexOf("\\") + 1);
                }

                Changed = false;
            }
            catch (Exception ex)
            {
                PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
            }
        }
コード例 #8
0
        private void openXMLToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                FormCollection          frmColl       = Application.OpenForms;
                frmXMLViewer_Validation xmlView_Valid = null;
                bool blFrmOpen = false;

                foreach (Form frm in frmColl)
                {
                    if (frm.Name.ToUpper() == "FRMXMLVIEWER_VALIDATION")
                    {
                        xmlView_Valid = (frmXMLViewer_Validation)frm;

                        blFrmOpen = true;
                        xmlView_Valid.Show();
                        xmlView_Valid.WindowState = FormWindowState.Maximized;
                    }
                }
                if (!blFrmOpen)
                {
                    xmlView_Valid           = new frmXMLViewer_Validation();
                    xmlView_Valid.MdiParent = this;
                    xmlView_Valid.Show();
                }
            }
            catch (Exception ex)
            {
                PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
            }
        }
コード例 #9
0
 private void exitToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         this.Close();
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
コード例 #10
0
ファイル: frmChemViewOpts.cs プロジェクト: gituser1510/Test3
 private void frmChemDraw_Load(object sender, EventArgs e)
 {
     try
     {
         AssignMolsToControls();
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
コード例 #11
0
 private void btnBrowseXML_Click(object sender, EventArgs e)
 {
     try
     {
         OpenFile();
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
コード例 #12
0
 private void frmXMLViewer_Validation_Load(object sender, EventArgs e)
 {
     try
     {
         this.WindowState = FormWindowState.Maximized;
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
コード例 #13
0
 private void changePasswordToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         Forms.frmChangePwd objChangePwd = new NameToStructureApplication.Forms.frmChangePwd();
         objChangePwd.ShowDialog();
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
コード例 #14
0
 private void productDetailsToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     try
     {
         Help.frmProdDetails objProdDtls = new Help.frmProdDetails();
         objProdDtls.ShowDialog();
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
コード例 #15
0
 private void retrieveToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         TaskManagement.frmRetrievePhaseDtls objRetrvPDtls = new TaskManagement.frmRetrievePhaseDtls();
         objRetrvPDtls.ShowDialog();
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
コード例 #16
0
 private void createToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         Forms.frmCreateUser objCreateUser = new NameToStructureApplication.Forms.frmCreateUser();
         objCreateUser.Show();
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
コード例 #17
0
 private void assignmentToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         TaskManagement.frmTaskAssignment objTaskAssign = new TaskManagement.frmTaskAssignment();
         objTaskAssign.ShowDialog();
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
コード例 #18
0
 private void deleteDictToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     try
     {
         Dictionary.frmDeleteDict objDeleteDict = new Dictionary.frmDeleteDict();
         objDeleteDict.ShowDialog();
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
コード例 #19
0
ファイル: Validations.cs プロジェクト: gituser1510/Test3
        public static string GetConvertedIUPACName(string iupacname)
        {
            string strIUPACName = "";

            try
            {
                if (iupacname.Trim() != "")
                {
                    int intHashCode = 0;
                    foreach (Char c in iupacname.Trim())
                    {
                        intHashCode = c.GetHashCode();
                        switch (intHashCode)
                        {
                        case 913:

                            strIUPACName = strIUPACName + ".alpha.";
                            break;

                        case 914:

                            strIUPACName = strIUPACName + ".beta.";
                            break;

                        case 915:

                            strIUPACName = strIUPACName + ".gamma.";
                            break;

                        case 916:

                            strIUPACName = strIUPACName + ".delta.";
                            break;

                        case 917:

                            strIUPACName = strIUPACName + ".epsilon.";
                            break;

                        default:
                            strIUPACName = strIUPACName + c;
                            break;
                        }
                    }
                    return(strIUPACName);
                }
            }
            catch (Exception ex)
            {
                PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
            }
            return(strIUPACName);
        }
コード例 #20
0
ファイル: frmXMLViewer.cs プロジェクト: gituser1510/Test3
 private void SetBehavior()
 {
     try
     {
         bool bFileExists = ((txtFileName.Text.Trim() != string.Empty) && File.Exists(txtFileName.Text));
         xmlGridView1.ViewMode = XmlGridView.VIEW_MODE.XML;
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
コード例 #21
0
ファイル: Validations.cs プロジェクト: gituser1510/Test3
 private static void ValidationEventHandler(object sender, ValidationEventArgs args)
 {
     try
     {
         blValidateFail = true;
         strErrMSg      = "Validation error: " + args.Message;
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
コード例 #22
0
 static void Main()
 {
     try
     {
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         Application.Run(new frmMain_PepsiLite());//Enumeration.frmRGrpEnum frmMain_PepsiLite
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
コード例 #23
0
 private void browsePDFToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         frmCurator frmNToS = new frmCurator();
         frmNToS.MdiParent = this;
         frmNToS.Show();
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
コード例 #24
0
 private void checkDuplicatesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         Forms.frmQryDuplicates objfrmQryDups = new Forms.frmQryDuplicates();
         objfrmQryDups.MdiParent = this;
         objfrmQryDups.Show();
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
コード例 #25
0
 private void OnXmlSyntaxError(object sender, ValidationEventArgs args)
 {
     try
     {
         IsWellFormedXml = false;
         strError        = lineInf.LineNumber.ToString() + ": " + lineInf.LinePosition.ToString() + " " + args.Message;
         lstErrors.Items.Add(strError);
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
コード例 #26
0
        private void btnWellFormNess_Click(object sender, EventArgs e)
        {
            try
            {
                lstErrors.Items.Clear();

                RichTextBox1.SaveFile(xmlFileName, RichTextBoxStreamType.PlainText);

                IsWellFormedXml = true;

                using (FileStream stream = File.OpenRead(AppDomain.CurrentDomain.BaseDirectory + "PatentEnhancedPrioritySubstanceIndexing-2.3.xsd"))
                {
                    XmlReaderSettings settings = new XmlReaderSettings();

                    XmlSchema schema = XmlSchema.Read(stream, OnXmlSyntaxError);
                    settings.ValidationType = ValidationType.Schema;
                    settings.Schemas.Add(schema);
                    settings.ValidationEventHandler += OnXmlSyntaxError;

                    string strError = "";
                    using (XmlReader validator = XmlReader.Create(txtXmlFile.Text.Trim(), settings))
                    {
                        try
                        {
                            // Validate the entire xml file
                            while (validator.Read())
                            {
                                lineInf = (IXmlLineInfo)validator;
                            }
                        }
                        catch (Exception ex)
                        {
                            if (lineInf.HasLineInfo())
                            {
                                strError = lineInf.LineNumber.ToString() + ": " + lineInf.LinePosition.ToString() + " " + ex.Message;
                            }
                            lstErrors.Items.Add(strError);
                        }
                    }
                }
                if (IsWellFormedXml)
                {
                    MessageBox.Show("Wellformed XML", "Wellformed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
            }
        }
コード例 #27
0
        private void exportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                string    strTanNumber = "";
                string    strSrcCntrl  = "";
                DataTable dtTanDetails = GetTanDetailsTableFromActiveForm(out strTanNumber, out strSrcCntrl);

                if (dtTanDetails != null)
                {
                    if (dtTanDetails.Rows.Count > 0)
                    {
                        if (strTanNumber.Trim() != "")
                        {
                            Export.frmExportOpts objfrmExp = new Export.frmExportOpts();

                            ArrayList availProplst = GetExportListOnSourceControl(strSrcCntrl);

                            objfrmExp.AvailProps = availProplst;

                            if (objfrmExp.ShowDialog() == DialogResult.OK)
                            {
                                string strFilepath = objfrmExp.FolderPath + "\\" + strTanNumber + ".sdf";
                                if (Export.PepsiLite_Export.EmportToSdFile(strFilepath, dtTanDetails, objfrmExp.SelectedProps))
                                {
                                    MessageBox.Show("Data exported to sd file successfully", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                }
                            }
                        }
                        else
                        {
                            MessageBox.Show("Please specify TAN Number", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                    else
                    {
                        MessageBox.Show("No data is available to export", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else
                {
                    MessageBox.Show("No data is available to export", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
            }
        }
コード例 #28
0
        private void LoadTANtoolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                //If no tans are assigned directly open curator page
                //If tans are available load available tans

                //Retrieve assigned TANs for the user based on userid,role
                DataTable dtAssignedTans = PepsiLiteDataAccess.DataOperations.RetrieveUserAssignedTANs(Generic.Generic_PepsiLite.UserName, Generic.Generic_PepsiLite.UserRole);

                if (dtAssignedTans != null)
                {
                    if (dtAssignedTans.Rows.Count > 0)
                    {
                        string selTAN = "";
                        TaskManagement.frmTaskSheet objTSheet = new NameToStructureApplication.TaskManagement.frmTaskSheet();
                        objTSheet.AssignedTANs = dtAssignedTans;

                        if (objTSheet.ShowDialog() != DialogResult.OK)
                        {
                            if (objTSheet.SubmitClick)
                            {
                                selTAN = objTSheet.SelectedTAN;
                                DataTable dtTanDetails = objTSheet.SelTANDetails;

                                frmCurator objCur = new frmCurator();
                                objCur.TANDetailsTbl = dtTanDetails;
                                objCur.TANNumber     = selTAN;
                                objCur.MdiParent     = this;
                                objCur.BindTANResultsToControls(dtTanDetails);
                                objCur.Show();
                            }
                        }
                    }
                    else//open new curator page
                    {
                        browsePDFToolStripMenuItem_Click(null, null);
                    }
                }
                else//open new curator page
                {
                    browsePDFToolStripMenuItem_Click(null, null);
                }
            }
            catch (Exception ex)
            {
                PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
            }
        }
コード例 #29
0
ファイル: frmReviewer.cs プロジェクト: gituser1510/Test3
        private void frmReviewer_Load(object sender, EventArgs e)
        {
            try
            {
                ucChemProps_Navigation1.FileName  = FileName;
                ucChemProps_Navigation1.TANNumber = TANNumber;
                ucChemProps_Navigation1.LoadMolecules();

                this.WindowState = FormWindowState.Maximized;
            }
            catch (Exception ex)
            {
                PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
            }
        }
コード例 #30
0
 private void TabControl1_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (TabControl1.SelectedIndex == 1)
         {
             RichTextBox1.SaveFile(xmlFileName, RichTextBoxStreamType.PlainText);
             webBrowser1.Navigate(xmlFileName);
         }
     }
     catch (Exception ex)
     {
         PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
     }
 }