Example #1
0
        private bool UpdateRecordInTable(int recindex, string molstring, double molweight, string molformula, int pagenum, string pagelabel, string examplenum, string iupacname, string enname, string inchikey)
        {
            bool blStatus = false;

            try
            {
                if (SearchResults != null)
                {
                    if (recindex < SearchResults.Rows.Count)
                    {
                        SearchResults.Rows[recindex]["structure"]      = molstring;
                        SearchResults.Rows[recindex]["mol_weight"]     = molweight;
                        SearchResults.Rows[recindex]["mol_formula"]    = molformula;
                        SearchResults.Rows[recindex]["iupac_name"]     = iupacname;
                        SearchResults.Rows[recindex]["page_number"]    = pagenum;
                        SearchResults.Rows[recindex]["page_label"]     = pagelabel;
                        SearchResults.Rows[recindex]["example_number"] = examplenum;
                        SearchResults.Rows[recindex]["table_number"]   = examplenum;
                        SearchResults.Rows[recindex]["en_name"]        = enname;
                        SearchResults.Rows[recindex]["inchi_key"]      = inchikey;

                        SearchResults.AcceptChanges();
                        blStatus = true;
                        return(blStatus);
                    }
                }
            }
            catch (Exception ex)
            {
                PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
            }
            return(blStatus);
        }
Example #2
0
        private bool DeleteStructFromSearchResultTable(int tandtlsid, int currecindex)
        {
            bool blStatus = false;

            try
            {
                if (SearchResults != null)
                {
                    if (SearchResults.Rows.Count > 0)
                    {
                        if (Convert.ToInt32(SearchResults.Rows[currecindex]["tan_dtl_id"]) == tandtlsid)
                        {
                            SearchResults.Rows[currecindex].Delete();
                            SearchResults.AcceptChanges();

                            blStatus = true;
                            return(blStatus);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                PepsiLiteErrorHandling.WriteErrorLog(ex.ToString());
            }
            return(blStatus);
        }