Пример #1
0
        void _printer_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            string stradress = "";
            string strPath   = AppDomain.CurrentDomain.BaseDirectory + @"config\sdnSystem.ini";

            if (!string.IsNullOrEmpty(strPath))
            {
                operConfig.ReadIniFile sdnReadIni = new operConfig.ReadIniFile(strPath);
                stradress = sdnReadIni.ReadValue("Adress", "adress");//得到公司地址
            }
            Brush bstr       = Brushes.Black;
            Font  normalFont = new System.Drawing.Font("宋体", 9.5F, FontStyle.Regular); //其他行字体
            Font  biggerFont = new System.Drawing.Font("宋体", 48F, FontStyle.Bold);     //号码字体
            int   first_row  = 70;                                                     //首行位置
            int   row_det    = 20;                                                     //下一行增加的位移
            int   row        = first_row;

            e.Graphics.DrawString(_call_num, biggerFont, bstr, 12, 0);//号码加大居中显示
            e.Graphics.DrawString("*前面有" + _rest_count + "人等待", normalFont, bstr, 0, row);
            row += row_det;
            e.Graphics.DrawString("身份证号:" + _id_num, normalFont, bstr, 0, row);
            row += row_det;
            e.Graphics.DrawString("姓名:" + _name, normalFont, bstr, 0, row);
            row += row_det;
            e.Graphics.DrawString("时间:" + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"), normalFont, bstr, 0, row);
            row += row_det;
            e.Graphics.DrawString("*当日当次有效,过号作废", normalFont, bstr, 0, row);
            row += row_det;
            e.Graphics.DrawString("*" + stradress, normalFont, bstr, 0, row);
            // e.Graphics.DrawString("*邓尉路555号 虎丘大队", normalFont, bstr, 0, row);
            row += row_det;
            return;
        }
Пример #2
0
        private void sdnGetReadCardType()
        {
            try
            {
                string strPath = AppDomain.CurrentDomain.BaseDirectory + @"config\config.ini";
                if (!string.IsNullOrEmpty(strPath))
                {
                    operConfig.ReadIniFile sdnReadIni = new operConfig.ReadIniFile(strPath);

                    strCardType = sdnReadIni.ReadValue("CardType", "typenum");//得到读卡器的类型
                    strCardType = "1";
                }
            }
            catch
            { }
        }