Exemplo n.º 1
0
 partial void DeleteCashPrintTime(CashPrintTime instance);
Exemplo n.º 2
0
 partial void InsertCashPrintTime(CashPrintTime instance);
Exemplo n.º 3
0
 partial void UpdateCashPrintTime(CashPrintTime instance);
Exemplo n.º 4
0
        //打印
        private void printTool_Click(object sender, EventArgs e)
        {
            try
            {
                dgv_show();

                var dc = new BathDBDataContext(LogIn.connectionString);
                string companyName = dc.Options.FirstOrDefault().companyName;
                List<string> printColumns = new List<string>();
                foreach (DataGridViewColumn dgvCol in dgv.Columns)
                {
                    printColumns.Add(dgvCol.HeaderText);
                }

                dgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;

                if (ptTimeList.SelectedIndex == 0)
                {
                    CashPrintTime cpt = new CashPrintTime();
                    cpt.macAdd = macAdd;
                    cpt.time = GeneralClass.Now;
                    dc.CashPrintTime.InsertOnSubmit(cpt);
                    dc.SubmitChanges();
                }

                PrintReceipt.Print_DataGridView(dgv, lastTime.ToString("yyyy-MM-dd HH:mm:ss"), thisTime.ToString("yyyy-MM-dd HH:mm:ss"), companyName);
                BathClass.set_dgv_fit(dgv);
            }
            catch
            {
                BathClass.printErrorMsg("打印出错,请重新打印!");
            }
        }