public PanelBarCode(CodeType codeType, bool scaleBarCode, Size size) : this(size, scaleBarCode) { _innerPanel.Controls.Clear(); _label.Dock = DockStyle.Top; _innerPanel.Controls.Add(_label); var value = GetValue(codeType); if (codeType == CodeType.None) { _label.Text = $"Type: None"; } else { _barCode = new C1BarCode() { CodeType = codeType, Text = value, BackColor = Color.White, Dock = DockStyle.Bottom, BarHeight = _innerPanel.Height - _label.Height }; _barCode.MouseLeave += CustomMouseLeave; _barCode.MouseEnter += CustomMouseEnter; _barCode.Click += CustomClick; _label.Text = $"Type: {_barCode.CodeType.ToString()}"; _innerPanel.Controls.Add(_barCode); } }
public override void ZoomBounds(Control control, ZoomBoundsInfo infos) { C1BarCode barcode = control as C1BarCode; barcode.ModuleSize = infos.Zoom(barcode.ModuleSize); barcode.BarHeight = infos.Zoom(barcode.BarHeight); base.ZoomBounds(control, infos); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { C1BarCode barCode = new C1BarCode(); barCode.Text = "1234567890"; barCode.CodeType = WijmoCodeTypeEnum.Code128; this.Image1.ImageUrl = barCode.ImageUrl; } }
private void GenerateQrCodes() { _panel.Controls.Clear(); if (string.IsNullOrEmpty(_sourceText.Text)) { return; } var Code = new C1BarCode(); Code.CodeType = CodeType.QRCode; Code.Text = _sourceText.Text; Code.QRCodeOptions.Connection = true; Code.QRCodeOptions.Model = QRCodeModel.Model2; var range = Convert.ToInt32(_range.SelectedItem); Code.QRCodeOptions.Version = range; Code.QRCodeOptions.ErrorLevel = QRCodeErrorLevel.Medium; Enumerable.Range(0, range) .ToList() .ForEach(x => { Code.QRCodeOptions.ConnectionNumber = x; var imageCode = Code.Image; var pictureBox = new PictureBox() { Image = imageCode, Size = new Size(200, 200) }; _panel.Controls.Add(pictureBox); }); // For preview properties var selectedObjects = new List <C1BarCode>() { Code }.ToArray(); _settings.SelectedObjects = (object[])selectedObjects; // Capacity of text _symbols.Text = _sourceText.Text.Length.ToString(); }
private void setForm() { frm = new Form(); int gapLine = 25, gapX = 20, gapY = 20, xCol2 = 130, xCol1 = 80, xCol3 = 470, xCol4 = 640, xCol5 = 950; Size size = new Size(); //throw new NotImplementedException(); frm.Size = new Size(1100, 800); frm.StartPosition = FormStartPosition.CenterScreen; pn.Dock = DockStyle.Fill; frm.Controls.Add(pn); grfImg = new C1FlexGrid(); grfImg.Font = fEdit; grfImg.Dock = System.Windows.Forms.DockStyle.Bottom; grfImg.Location = new System.Drawing.Point(0, 0); grfImg.Rows.Count = 1; grfImg.Height = 540; grfImg.Rows.Count = 6; grfImg.Cols.Count = 15; grfImg.Cols[1].Caption = ""; //grfINS.Cols[2].Caption = "เลขที่เอกสาร"; //grfDITdc02.Cols[3].Caption = "Vendor"; //grfDITdc02.Cols[4].Caption = "Price New"; grfImg.Cols[1].Width = 120; grfImg.Cols[2].Width = 150; pn.Controls.Add(grfImg); lbID = new Label(); lbPID = new Label(); lbName = new Label(); lbDate = new Label(); lbAddress = new Label(); lbEmail = new Label(); lbMobile = new Label(); lbDose = new Label(); txtID = new C1TextBox(); txtPID = new C1TextBox(); txtName = new C1TextBox(); txtDate = new C1TextBox(); txtAddress = new C1TextBox(); txtEmail = new C1TextBox(); txtMobile = new C1TextBox(); txtDose = new C1TextBox(); bc.setControlLabel(ref lbID, fEdit, "เลขที่ใบจอง :", "lbID", gapX, gapY); size = bc.MeasureString(lbID); bc.setControlC1TextBox(ref txtID, fEdit, "txtID", 120, xCol2, lbID.Location.Y); txtID.Width = 120; bc.setControlLabel(ref lbPID, fEdit, "PID :", "lbPID", xCol3, lbID.Location.Y); size = bc.MeasureString(lbPID); bc.setControlC1TextBox(ref txtPID, fEdit, "txtPID", 120, lbPID.Location.X + size.Width + 15, lbID.Location.Y); txtPID.Width = 160; gapY += gapLine; bc.setControlLabel(ref lbName, fEdit, "ชื่อ นามสกุล :", "lbName", gapX, gapY); size = bc.MeasureString(lbName); bc.setControlC1TextBox(ref txtName, fEdit, "txtName", 120, xCol2, lbName.Location.Y); txtName.Width = 320; gapY += gapLine; bc.setControlLabel(ref lbDate, fEdit, "วันที่จอง :", "lbDate", gapX, gapY); size = bc.MeasureString(lbDate); bc.setControlC1TextBox(ref txtDate, fEdit, "txtDate", 120, xCol2, lbDate.Location.Y); txtDate.Width = 180; gapY += gapLine; bc.setControlLabel(ref lbAddress, fEdit, "ที่อยู่ :", "lbAddress", gapX, gapY); size = bc.MeasureString(lbDate); bc.setControlC1TextBox(ref txtAddress, fEdit, "txtAddress", 120, xCol2, lbAddress.Location.Y); txtAddress.Width = 620; gapY += gapLine; bc.setControlLabel(ref lbEmail, fEdit, "Email :", "lbEmail", gapX, gapY); size = bc.MeasureString(lbDate); bc.setControlC1TextBox(ref txtEmail, fEdit, "txtEmail", 120, xCol2, lbEmail.Location.Y); txtEmail.Width = 320; bc.setControlLabel(ref lbMobile, fEdit, "Mobile :", "lbMobile", xCol3, lbEmail.Location.Y); size = bc.MeasureString(lbPID); bc.setControlC1TextBox(ref txtMobile, fEdit, "txtMobile", 120, lbMobile.Location.X + size.Width + 15, lbMobile.Location.Y); txtMobile.Width = 200; gapY += gapLine; bc.setControlLabel(ref lbDose, fEdit, "Dose :", "lbDose", gapX, gapY); size = bc.MeasureString(lbDate); bc.setControlC1TextBox(ref txtDose, fEdit5B, "txtDose", 120, xCol2, lbDose.Location.Y); txtDose.Width = 300; gapY += gapLine + 40; bc.setControlC1Button(ref btnApprove, fEdit, "ตรวจสอบเรียบร้อย", "btnApprove", gapX, gapY); btnApprove.Width = 180; bc.setControlC1Button(ref btnPrn, fEdit, "พิมพ์ ใบจอง", "btnPrn", btnApprove.Location.X + btnApprove.Width + 40, gapY); btnPrn.Width = 120; gapY += gapLine + 40; bc.setControlC1Button(ref btnUnApprove, fEdit, "ตรวจสอบ ยังไม่เรียบร้อย", "btnUnApprove", gapX, gapY); btnUnApprove.Width = 180; c1BarCode1 = new C1.Win.BarCode.C1BarCode(); c1BarCode1.AdditionalNumber = null; c1BarCode1.BackColor = System.Drawing.Color.White; c1BarCode1.CodeType = C1.BarCode.CodeType.QRCode; c1BarCode1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F); c1BarCode1.ForeColor = System.Drawing.Color.Black; c1BarCode1.Location = new System.Drawing.Point(800, 60); c1BarCode1.MicroQRCodeOptions.EncodingCodePage = 65001; c1BarCode1.Name = "c1BarCode1"; c1BarCode1.QuietZone.Bottom = 0D; c1BarCode1.QuietZone.Left = 0D; c1BarCode1.QuietZone.Right = 0D; c1BarCode1.QuietZone.Top = 0D; c1BarCode1.Size = new System.Drawing.Size(151, 150); c1BarCode1.TabIndex = 1; c1BarCode1.Text = txtID.Text; c1BarCode1.TextFixedLength = 0; c1BarCode1.WideToNarrowRatio = 2F; ContextMenu menuGw = new ContextMenu(); menuGw.MenuItems.Add("ตรวจสอบเรียบร้อย", new EventHandler(ContextMenu_Approve)); menuGw.MenuItems.Add("พิมพ์ ใบจอง", new EventHandler(ContextMenu_printReservel)); menuGw.MenuItems.Add("ตรวจสอบ ยังไม่เรียบร้อย", new EventHandler(ContextMenu_UnApprove)); frm.ContextMenu = menuGw; pn.Controls.Add(txtID); pn.Controls.Add(txtPID); pn.Controls.Add(lbID); pn.Controls.Add(lbPID); pn.Controls.Add(txtName); pn.Controls.Add(lbName); pn.Controls.Add(txtDate); pn.Controls.Add(lbDate); pn.Controls.Add(txtAddress); pn.Controls.Add(lbAddress); pn.Controls.Add(txtMobile); pn.Controls.Add(lbMobile); pn.Controls.Add(txtEmail); pn.Controls.Add(lbEmail); pn.Controls.Add(txtDose); pn.Controls.Add(lbDose); pn.Controls.Add(c1BarCode1); }
private void ContextMenu_sticker(object sender, System.EventArgs e) { String chk1 = "", name = "", id = "", vsid = "", resid = "", re3 = ""; if (grfReq.Row < 0) { return; } id = grfReq[grfReq.Row, colReqId] != null ? grfReq[grfReq.Row, colReqId].ToString() : ""; vsid = grfReq[grfReq.Row, colReqVsId] != null ? grfReq[grfReq.Row, colReqVsId].ToString() : ""; if (id.Length <= 0) { return; } SetDefaultPrinter(ic.iniC.printerSticker); DataTable dt = new DataTable(); dt.Columns.Add("hn", typeof(String)); dt.Columns.Add("name", typeof(String)); dt.Columns.Add("age", typeof(String)); dt.Columns.Add("vn", typeof(String)); dt.Columns.Add("path_barcode", typeof(String)); LabRequest lbreq = new LabRequest(); lbreq = ic.ivfDB.lbReqDB.selectByPk1(id); Visit vs = new Visit(); vs = ic.ivfDB.vsDB.selectByPk1(vsid); Patient ptt = new Patient(); ptt = ic.ivfDB.pttDB.selectByPk1(vs.t_patient_id); Lis lis = new Lis(); lis.lis_id = ""; lis.barcode = ""; lis.req_id = id; lis.visit_vn = vs.visit_vn; lis.patient_name = ptt.Name; lis.visit_hn = ptt.patient_hn; lis.visit_id = vs.t_visit_id; lis.message_lis = ""; lis.active = ""; lis.remark = ""; lis.date_create = ""; lis.date_modi = ""; lis.date_cancel = ""; lis.user_create = ""; lis.user_modi = ""; lis.user_cancel = ""; lis.statis_lis = ""; lis.date_time_receive = ""; lis.date_time_finish = ""; lis.lab_id = lbreq.lab_id; re3 = ic.ivfDB.lisDB.insertLis(lis, ic.cStf.staff_id); String re = "", re1 = "", re2 = ""; long chk = 0, chk2 = 0; Lis lis1 = new Lis(); lis1 = ic.ivfDB.lisDB.selectByPk(re3); DataRow row11 = dt.NewRow(); row11["hn"] = vs.visit_hn; row11["name"] = ptt.Name; row11["age"] = "Age " + ptt.AgeStringShort() + " [" + ic.datetoShow(ptt.patient_birthday) + "]"; row11["vn"] = lis1.barcode; row11["path_barcode"] = System.IO.Directory.GetCurrentDirectory() + "\\report\\" + lis1.barcode + ".jpg"; dt.Rows.Add(row11); if (!Directory.Exists("report")) { Directory.CreateDirectory("report"); } if (!File.Exists(System.IO.Directory.GetCurrentDirectory() + "\\report\\" + lis1.barcode + ".jpg")) { File.Delete(System.IO.Directory.GetCurrentDirectory() + "\\report\\" + lis1.barcode + ".jpg"); } C1BarCode barc = new C1BarCode(); if (ic.iniC.lisBarcode.Equals("Code_128_B")) { barc.CodeType = C1.BarCode.CodeType.Code_128_B; } else if (ic.iniC.lisBarcode.Equals("Code_128_A")) { barc.CodeType = C1.BarCode.CodeType.Code_128_A; } else if (ic.iniC.lisBarcode.Equals("Code_128_C")) { barc.CodeType = C1.BarCode.CodeType.Code_128_C; } else if (ic.iniC.lisBarcode.Equals("Code_128auto")) { barc.CodeType = C1.BarCode.CodeType.Code_128auto; } else if (ic.iniC.lisBarcode.Equals("Code_128auto")) { //barc.CodeType = C1.BarCode.CodeType.en; } else { } barc.Size = new Size(100, 60); barc.BarHeight = 60; barc.Text = lis1.barcode; Bitmap bitm = new Bitmap(100, 40); //bitm = barc.Image; Image img = barc.Image; //img.Size = new Size(100, 40); img.Save(System.IO.Directory.GetCurrentDirectory() + "\\report\\" + lis1.barcode + ".jpg", ImageFormat.Jpeg); FrmReport frm = new FrmReport(ic); frm.setStickerPatientThemalLIS(dt); frm.ShowDialog(this); }