Example #1
0
        /// <summary>
        /// Инициализация
        /// </summary>
        /// <param name="err">Признак ошибки при выполнении инициализации</param>
        /// <param name="errMsg">Строкаа с сообщением об ошибке (при наличии)</param>
        protected override void initialize(out int err, out string errMsg)
        {
            err    = 0;
            errMsg = string.Empty;
            DataGridView  dgv = null;
            List <string> listNAlg;
            string        strItem = string.Empty;

            m_tblOrigin = __handlerDb.GetDataTable(ID_DBTABLE.FTABLE, out err);

            if (err == 0)
            {
                m_tblEdit = m_tblOrigin.Copy();
                m_zGraph_fTABLE.Set(m_tblEdit);

                dgv      = Controls.Find(INDEX_CONTROL.DGV_NALG.ToString(), true)[0] as DataGridView;
                listNAlg = new List <string>();

                if (dgv.RowCount > 0)
                {
                    dgv.Rows.Clear();
                }
                else
                {
                    ;
                }
                //var distinctRows = (from DataRow r in m_tblOrigin.Rows select new { nalg = r["N_ALG"] }).Distinct();

                foreach (DataRow r in m_tblEdit.Rows)
                {
                    strItem = ((string)r[@"N_ALG"]).Trim();
                    if (listNAlg.Contains(strItem) == false)
                    {
                        listNAlg.Add(strItem);
                        dgv.Rows.Add(strItem, string.Empty, r[@"ID"]);
                    }
                    else
                    {
                        ;
                    }
                }
            }

            Logging.Logg().Debug(@"PluginTepPrjFTable::initialize () - усПех ...", Logging.INDEX_MESSAGE.NOT_SET);
        }
Example #2
0
        /// <summary>
        /// Инициализация
        /// </summary>
        /// <param name="dbConn"></param>
        /// <param name="err"></param>
        /// <param name="errMsg"></param>
        protected override void initialize(ref DbConnection dbConn, out int err, out string errMsg)
        {
            err    = 0;
            errMsg = string.Empty;
            DataGridView  dgv = null;
            List <string> listNAlg;
            string        strItem = string.Empty;

            m_tblOrigin = DbTSQLInterface.Select(ref dbConn, "SELECT * FROM [dbo].[ftable]", null, null, out err);

            if (err == 0)
            {
                m_tblEdit = m_tblOrigin.Copy();
                m_zGraph_fTABLE.Set(m_tblEdit);

                dgv      = Controls.Find(INDEX_CONTROL.DGV_NALG.ToString(), true)[0] as DataGridView;
                listNAlg = new List <string>();

                //var distinctRows = (from DataRow r in m_tblOrigin.Rows select new { nalg = r["N_ALG"] }).Distinct();

                foreach (DataRow r in m_tblEdit.Rows)
                {
                    strItem = ((string)r[@"N_ALG"]).Trim();
                    if (listNAlg.Contains(strItem) == false)
                    {
                        listNAlg.Add(strItem);
                        dgv.Rows.Add(strItem, string.Empty, r[@"ID"]);
                    }
                    else
                    {
                        ;
                    }
                }
            }

            Logging.Logg().Debug(@"PluginTepPrjFTable::initialize () - усПех ...", Logging.INDEX_MESSAGE.NOT_SET);
        }