Пример #1
0
        private void Item_Click(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
            string id_tn = view_calendar.GetFocusedRowCellValue("id_creator").ToString();
            string date;

            if (column_name == "fio" || column_name == "position" || column_name == "id_models" || column_name == "fName_model" || column_name == "id_creator" || column_name == "image" || column_name == "photo_models" || column_name == "start_date" || column_name == "status_now")
            {
                class_date class_Date = new class_date();
                date = class_Date.convert(DateTime.Now);
            }
            else
            {
                date = year + "-" + month + "-" + column_name.Substring(1, column_name.Length - 1);
            }
            gridControl2.DataSource = dtRaport(id_tn, date);
        }
Пример #2
0
        public DataTable dtRaport(string id_tn, string date)
        {
            string    comand   = "select*from total where id_tn=" + id_tn + " and date='" + date + "'";
            DataTable dtRaport = class_Sql.sql_dt(comand, "t1");

            if (dtRaport.Rows.Count != 0)
            {
                return(dtRaport);
            }
            else
            {
                class_date class_Date = new class_date();
                if (date == class_Date.convert(DateTime.Now))
                {
                    MessageBox.Show("Рапорт на сегодня еще не заполнен.");
                }
                else
                {
                    MessageBox.Show("Рапорт на " + DateTime.Parse(date).ToLongDateString() + " еще не заполнен.");
                }
                return(null);
            }
        }