public void createReport() { ReportGenerating.startDate = date_edit_for_SQL.convert(de_start); ReportGenerating.endDate = date_edit_for_SQL.convert(de_end); set_worker(); string type_report = type_reports_cmbBox.Text; ReportGenerating rg = new ReportGenerating(); rg.Createreport(Convert.ToInt32(select_IdSubunit), dt_total_rep, type_report, selected_worker_id, selected_worker_fio); }
public void timeToLabel() { DateTime selectDate = date_AddRecord.DateTime.Date; string query = @"SELECT [time_span] FROM [total] WHERE [id_tn]='" + formLogin.id_tn + "'" + "AND [date]='" + _Date.convert(date_AddRecord.DateTime) + "'"; DataTable dtHours = _Sql.sql_dt(query, "t1"); if (dtHours.Rows.Count != 0) { TimeSpan ts1 = new TimeSpan(0, 0, 0); for (int i = 0; i < dtHours.Rows.Count; i++) { ts1 += TimeSpan.Parse(dtHours.Rows[i]["time_span"].ToString()); } lblTime.Text = ts1.ToString().Substring(0, 5); } else { lblTime.Text = "00:00"; } }
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); }
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); } }
private void dEdit_start_EditValueChanged(object sender, EventArgs e) { date_start = _date.convert(dEdit_start.DateTime); }