Exemple #1
0
        public DeleteTimesForm(Exchange.TimesInfo timesInfo, DatabaseTools dayabaseTools, SettingClass settingClass)
        {
            InitializeComponent();

            m_TimesInfo     = timesInfo;
            m_DatabaseTools = dayabaseTools;
            m_SettingClass  = settingClass;

            textBoxDateStart.Text = timesInfo.DateStart.ToString();
            textBoxDateStop.Text  = timesInfo.DateStop.ToString();
        }
Exemple #2
0
        /// <summary>
        /// Get all rows from Times table
        /// </summary>
        /// <returns></returns>
        public Exchange.TimesInfo[] GetTimesRows(int pid)
        {
            DataTable productTable = m_DataSet.Tables[TableNames.Times.ToString()];

            DataRow[] allRows = productTable.Select("pid='" + pid + "'", "id");
            var       resRows = new Exchange.TimesInfo[allRows.Length];

            for (int i = 0; i < allRows.Length; i++)
            {
                resRows[i].ID        = (int)allRows[i]["id"];
                resRows[i].PID       = (int)allRows[i]["pid"];
                resRows[i].DateStart = (DateTime)allRows[i]["dateStart"];
                if (allRows[i]["dateStop"].ToString() != "")
                {
                    resRows[i].DateStop = (DateTime)allRows[i]["dateStop"];
                }
                else
                {
                    resRows[i].DateStop = null;
                }
            }

            return(resRows);
        }