private void FormOnDutyEmployee_Load(object sender, EventArgs e) { var apartmentAdapter = new VoucherExpense.DamaiDataSetTableAdapters.ApartmentTableAdapter(); var HRAdapter = new VoucherExpense.DamaiDataSetTableAdapters.HRTableAdapter(); apartmentAdapter.Connection.ConnectionString = DB.SqlConnectString(MyFunction.HardwareCfg); try { apartmentAdapter.Fill(m_DataSet.Apartment); HRAdapter.Fill(m_DataSet.HR); OnDutyDataAdapter.Fill(m_DataSet.OnDutyData); } catch (Exception ex) { MessageBox.Show("Ex:" + ex.Message); } SetupBindingSource(); int index = DateTime.Now.Month - 2; if (index < 0) { index = 0; } this.comboBoxMonth.SelectedIndex = index; ckBoxShowAll_CheckedChanged(null, null); //comboBoxApartment.DataSource = GetApartmentList(); }
private void FormHR_Load(object sender, EventArgs e) { SetupBindingSource(); dgvHRDetail.DataSource = fKHRDetailHRBindingSource; var operatorAdapter = new VoucherExpense.DamaiDataSetTableAdapters.OperatorTableAdapter(); var apartmentAdapter = new VoucherExpense.DamaiDataSetTableAdapters.ApartmentTableAdapter(); operatorAdapter.Connection.ConnectionString = DB.SqlConnectString(MyFunction.HardwareCfg); apartmentAdapter.Connection.ConnectionString = DB.SqlConnectString(MyFunction.HardwareCfg); Try(() => operatorAdapter.Fill(m_DataSet.Operator)); Try(() => apartmentAdapter.Fill(m_DataSet.Apartment)); Try(() => HRAdapter.Fill(m_DataSet.HR)); Try(() => HRDetailAdapter.Fill(m_DataSet.HRDetail)); MyFunction.SetFieldLength(dgvHR, m_DataSet.HR); MyFunction.SetFieldLength(dgvHRDetail, m_DataSet.HRDetail); MyFunction.SetControlLengthFromDB(this, m_DataSet.HR); checkBoxShowAll.Checked = false; }
private void FormBillList_Load(object sender, EventArgs e) { requestsBindingSource.DataSource = m_DataSet; var apartmentAdapter = new VoucherExpense.DamaiDataSetTableAdapters.ApartmentTableAdapter(); apartmentAdapter.Connection.ConnectionString = DB.SqlConnectString(MyFunction.HardwareCfg); apartmentAdapter.Fill(m_DataSet.Apartment); RequestsAdapter.Fill(m_DataSet.Requests); this.requestsBindingSource.Sort = "requestsid desc"; if (m_DefaultApartment.IsApartmentNameNull()) { Apartmentname = m_DefaultApartment.ApartmentAllName; } else { Apartmentname = m_DefaultApartment.ApartmentAllName; } textBox1.Text = Apartmentname; //设定打印机 Config = MyFunction.HardwareCfg; PrinterSettings ps = new PrinterSettings(); ps.PrinterName = Config.DotPrinterName; textBoxDotPrinter.Text = Config.DotPrinterName; pD.PrinterSettings = ps; dateTimetoolStripCbB.SelectedIndex = DateTime.Now.Month; if (MyFunction.IntHeaderYear != DateTime.Now.Year) { dateTimetoolStripCbB.SelectedIndex = dateTimetoolStripCbB.Items.Count - 1; } else { dateTimetoolStripCbB.SelectedIndex = DateTime.Now.Month; } }