private void setProperties() { try { foreach (Control control in pnlThongtintien.Controls) { if (control is EditBox) { var txtFormantTongTien = new EditBox(); txtFormantTongTien = ((EditBox) (control)); txtFormantTongTien.Clear(); txtFormantTongTien.ReadOnly = true; //if (txtFormantTongTien.Font.Size < 9) // txtFormantTongTien.Font = new Font("Microsoft Sans Serif", 9F, FontStyle.Bold, // GraphicsUnit.Point, 0); txtFormantTongTien.TextAlignment = TextAlignment.Far; txtFormantTongTien.KeyPress += txtEventTongTien_KeyPress; txtFormantTongTien.TextChanged += txtEventTongTien_TextChanged; } } foreach (Control control in pnlThongtinBN.Controls) { if (control is EditBox) { var txtControl = new EditBox(); if (txtControl.Tag != "NO")//Đánh dấu một số Control cho phép chỉnh sửa. Ví dụ Hạn thẻ BHYT //để người dùng có thể sửa nếu phía Tiếp đón gõ sai { txtControl = ((EditBox) (control)); txtControl.ReadOnly = true; txtControl.BackColor = Color.White; } txtControl.ForeColor = Color.Black; } if (control is UICheckBox) { var chkControl = new UICheckBox(); if (chkControl.Tag != "NO") { chkControl = (UICheckBox) control; chkControl.Enabled = false; } } } } catch (Exception exception) { } }
private void ShowDiseaseList(EditBox txt) { try { var frm = new frm_QuickSearchDiseases(); frm.DiseaseType_ID = -1; frm.ShowDialog(); if (frm.m_blnCancel) { txt.Text = frm.v_DiseasesCode; txt.Focus(); txt.SelectAll(); } } catch (Exception exception) { if (globalVariables.IsAdmin) { Utility.ShowMsg(exception.ToString()); } } }
private void setProperties() { foreach (Control control in grpTongTien.Controls) { if (control is Janus.Windows.GridEX.EditControls.EditBox) { Janus.Windows.GridEX.EditControls.EditBox txtTien = new EditBox(); txtTien = (Janus.Windows.GridEX.EditControls.EditBox)control; txtTien.Clear(); txtTien.ReadOnly = true; txtTien.TextChanged += new EventHandler(txtEventTongTien_TextChanged); txtTien.KeyPress += new KeyPressEventHandler(txtEventTongTien_KeyPress); // txtTien.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); txtTien.TextAlignment = Janus.Windows.GridEX.TextAlignment.Far; } } }
private void setProperties() { try { foreach (Control control in this.Controls) { if (control is EditBox) { var _item = new EditBox(); _item = ((EditBox)(control)); _item.Clear(); _item.ReadOnly = true; _item.TextAlignment = Janus.Windows.GridEX.TextAlignment.Far; _item.TextChanged += txtEventTongTien_TextChanged; } } } catch (Exception exception) { } }
private void DSACH_ICD(EditBox tEditBox, string LOAITIMKIEM, int CP) { try { this.Selected = false; string filterExpression = ""; if (LOAITIMKIEM.ToUpper() == DmucChung.Columns.Ten) { filterExpression = " Disease_Name like '%" + tEditBox.Text + "%' OR FirstChar LIKE '%" + tEditBox.Text + "%'"; } else if (LOAITIMKIEM == DmucChung.Columns.Ma) { filterExpression = DmucBenh.Columns.MaBenh + " LIKE '%" + tEditBox.Text + "%'"; } DataRow[] source = this.dt_ICD.Select(filterExpression); if (source.Length == 1) { if (CP == 0) { this.txtMaBenhChinh.Text = ""; this.txtMaBenhChinh.Text = Utility.sDbnull(source[0][DmucBenh.Columns.MaBenh], ""); this.hasMorethanOne = false; this.txtMaBenhChinh_TextChanged(this.txtMaBenhChinh, new EventArgs()); this.txtMaBenhChinh.Focus(); } else if (CP == 1) { this.txtMaBenhphu.Text = Utility.sDbnull(source[0][DmucBenh.Columns.MaBenh], ""); this.hasMorethanOne = false; this.txtMaBenhphu_TextChanged(this.txtMaBenhphu, new EventArgs()); this.txtMaBenhphu_KeyDown(this.txtMaBenhphu, new KeyEventArgs(Keys.Enter)); this.Selected = false; } } else if (source.Length > 1) { frm_DanhSach_ICD h_icd = new frm_DanhSach_ICD(CP) { dt_ICD = source.CopyToDataTable<DataRow>() }; h_icd.ShowDialog(); if (!h_icd.has_Cancel) { List<GridEXRow> lstSelectedRows = h_icd.lstSelectedRows; if (CP == 0) { this.isLike = false; this.txtMaBenhChinh.Text = ""; this.txtMaBenhChinh.Text = Utility.sDbnull(lstSelectedRows[0].Cells[DmucBenh.Columns.MaBenh].Value, ""); this.hasMorethanOne = false; this.txtMaBenhChinh_TextChanged(this.txtMaBenhChinh, new EventArgs()); this.txtMaBenhChinh_KeyDown(this.txtMaBenhChinh, new KeyEventArgs(Keys.Enter)); this.Selected = false; } else if (CP == 1) { if (lstSelectedRows.Count == 1) { this.isLike = false; this.txtMaBenhphu.Text = ""; this.txtMaBenhphu.Text = Utility.sDbnull(lstSelectedRows[0].Cells[DmucBenh.Columns.MaBenh].Value, ""); this.hasMorethanOne = false; this.txtMaBenhphu_TextChanged(this.txtMaBenhphu, new EventArgs()); this.txtMaBenhphu_KeyDown(this.txtMaBenhphu, new KeyEventArgs(Keys.Enter)); this.Selected = false; } else { foreach (GridEXRow row in lstSelectedRows) { this.isLike = false; this.txtMaBenhphu.Text = ""; this.txtMaBenhphu.Text = Utility.sDbnull(row.Cells[DmucBenh.Columns.MaBenh].Value, ""); this.hasMorethanOne = false; this.txtMaBenhphu_TextChanged(this.txtMaBenhphu, new EventArgs()); this.txtMaBenhphu_KeyDown(this.txtMaBenhphu, new KeyEventArgs(Keys.Enter)); this.Selected = false; } this.hasMorethanOne = true; } } tEditBox.Focus(); } else { this.hasMorethanOne = true; tEditBox.Focus(); } } else { this.hasMorethanOne = true; tEditBox.SelectAll(); } } catch { } finally { this.isLike = true; } }
private void setProperties() { try { foreach (Control control in pnlInfor.Controls) { if (control is EditBox) { var txtFormantTongTien = new EditBox(); txtFormantTongTien = ((EditBox)(control)); txtFormantTongTien.Clear(); txtFormantTongTien.ReadOnly = true; txtFormantTongTien.TextAlignment = TextAlignment.Far; txtFormantTongTien.TextChanged += txtEventTongTien_TextChanged; } } } catch (Exception exception) { } }
private void ClearControl() { txtNgaySinh.Clear(); txtThangSinh.Clear(); txtDienThoai.Clear(); txtDanToc.Clear(); txtMaLanKham.Clear(); txtThongTinLienHe.Clear(); txtChanDoanBanDau.Clear(); txtNoiLamViec.Clear(); foreach (Control control in KHAMBENH.Controls) { if (control is EditBox) { var txtControl = new EditBox(); txtControl = ((EditBox) control); txtControl.Clear(); } if (control is CalendarCombo) { var txtControl = new CalendarCombo(); txtControl = ((CalendarCombo) control); txtControl.NullValue = true; } if (control is UICheckBox) { var txtControl = new UICheckBox(); txtControl = ((UICheckBox) control); txtControl.Checked = false; } if (control is MaskedEditBox) { var txtControl = new MaskedEditBox(); txtControl = ((MaskedEditBox) control); txtControl.Clear(); } if (control is RichTextBox) { var txtControl = new RichTextBox(); txtControl = ((RichTextBox)control); txtControl.Clear(); } } foreach (Control control in LDVV.Controls) { if (control is EditBox) { var txtControl = new EditBox(); txtControl = ((EditBox) control); txtControl.Clear(); } if (control is CalendarCombo) { var txtControl = new CalendarCombo(); txtControl = ((CalendarCombo) control); txtControl.NullValue = true; } if (control is UICheckBox) { var txtControl = new UICheckBox(); txtControl = ((UICheckBox) control); txtControl.Checked = false; } if (control is MaskedEditBox) { var txtControl = new MaskedEditBox(); txtControl = ((MaskedEditBox) control); txtControl.Clear(); } if (control is RichTextBox) { var txtControl = new RichTextBox(); txtControl = ((RichTextBox)control); txtControl.Clear(); } } foreach (Control control in HOIBENH.Controls) { if (control is EditBox) { var txtControl = new EditBox(); txtControl = ((EditBox) control); txtControl.Clear(); } if (control is CalendarCombo) { var txtControl = new CalendarCombo(); txtControl = ((CalendarCombo) control); txtControl.NullValue = true; } if (control is UICheckBox) { var txtControl = new UICheckBox(); txtControl = ((UICheckBox) control); txtControl.Checked = false; } if (control is MaskedEditBox) { var txtControl = new MaskedEditBox(); txtControl = ((MaskedEditBox) control); txtControl.Clear(); } if (control is RichTextBox) { var txtControl = new RichTextBox(); txtControl = ((RichTextBox)control); txtControl.Clear(); } } }
private void DSACH_ICD(EditBox tEditBox, string LOAITIMKIEM, int CP) { try { Selected = false; string sFillter = ""; if (LOAITIMKIEM.ToUpper() == DmucChung.Columns.Ten) { sFillter = " Disease_Name like '%" + tEditBox.Text + "%' OR FirstChar LIKE '%" + tEditBox.Text + "%'"; } else if (LOAITIMKIEM == DmucChung.Columns.Ma) { sFillter = DmucBenh.Columns.MaBenh+ " LIKE '%" + tEditBox.Text + "%'"; } DataRow[] dataRows; dataRows = dt_ICD.Select(sFillter); if (dataRows.Length == 1) { if (CP == 0) { txtMaBenhChinh.Text = ""; txtMaBenhChinh.Text = Utility.sDbnull(dataRows[0][DmucBenh.Columns.MaBenh], ""); hasMorethanOne = false; txtMaBenhChinh_TextChanged(txtMaBenhChinh, new EventArgs()); txtMaBenhChinh.Focus(); } else if (CP == 1) { txtMaBenhphu.Text = Utility.sDbnull(dataRows[0][DmucBenh.Columns.MaBenh], ""); hasMorethanOne = false; txtMaBenhphu_TextChanged(txtMaBenhphu, new EventArgs()); txtMaBenhphu_KeyDown(txtMaBenhphu, new KeyEventArgs(Keys.Enter)); Selected = false; } } else if (dataRows.Length > 1) { var frmDanhSachIcd = new frm_DanhSach_ICD(CP); frmDanhSachIcd.dt_ICD = dataRows.CopyToDataTable(); frmDanhSachIcd.ShowDialog(); if (!frmDanhSachIcd.has_Cancel) { List<GridEXRow> lstSelectedRows = frmDanhSachIcd.lstSelectedRows; if (CP == 0) { isLike = false; txtMaBenhChinh.Text = ""; txtMaBenhChinh.Text = Utility.sDbnull(lstSelectedRows[0].Cells[DmucBenh.Columns.MaBenh].Value, ""); hasMorethanOne = false; txtMaBenhChinh_TextChanged(txtMaBenhChinh, new EventArgs()); txtMaBenhChinh_KeyDown(txtMaBenhChinh, new KeyEventArgs(Keys.Enter)); Selected = false; } else if (CP == 1) { if (lstSelectedRows.Count == 1) { isLike = false; txtMaBenhphu.Text = ""; txtMaBenhphu.Text = Utility.sDbnull(lstSelectedRows[0].Cells[DmucBenh.Columns.MaBenh].Value, ""); hasMorethanOne = false; txtMaBenhphu_TextChanged(txtMaBenhphu, new EventArgs()); txtMaBenhphu_KeyDown(txtMaBenhphu, new KeyEventArgs(Keys.Enter)); Selected = false; } else { foreach (GridEXRow row in lstSelectedRows) { isLike = false; txtMaBenhphu.Text = ""; txtMaBenhphu.Text = Utility.sDbnull(row.Cells[DmucBenh.Columns.MaBenh].Value, ""); hasMorethanOne = false; txtMaBenhphu_TextChanged(txtMaBenhphu, new EventArgs()); txtMaBenhphu_KeyDown(txtMaBenhphu, new KeyEventArgs(Keys.Enter)); Selected = false; } hasMorethanOne = true; } } tEditBox.Focus(); } else { hasMorethanOne = true; tEditBox.Focus(); } } else { hasMorethanOne = true; tEditBox.SelectAll(); } } catch { } finally { isLike = true; } }
private void ClearControl() { foreach (Control control in grpChanDoan.Controls) { if (control is EditBox) { var txtControl = new EditBox(); txtControl = ((EditBox) control); txtControl.Clear(); } if (control is CalendarCombo) { var txtControl = new CalendarCombo(); txtControl = ((CalendarCombo) control); txtControl.NullValue = true; } if (control is UICheckBox) { var txtControl = new UICheckBox(); txtControl = ((UICheckBox) control); txtControl.Checked = false; } if (control is MaskedEditBox) { var txtControl = new MaskedEditBox(); txtControl = ((MaskedEditBox) control); txtControl.Clear(); } if (control is RichTextBox) { var txtControl = new RichTextBox(); txtControl = ((RichTextBox) control); txtControl.Clear(); } } }
private void setProperties() { try { foreach (Control control in pnlInfor.Controls) { if (control is EditBox) { var txt = new EditBox(); txt.TextChanged += txtEventTongTien_TextChanged; } } } catch (Exception exception) { } }
private void SetPropertion() { try { foreach (Control control in grpThongTinBenhNhan.Controls) { if (control is EditBox) { var txtControl = new EditBox(); if (txtControl.Tag != "NO") { txtControl = ((EditBox) (control)); txtControl.ReadOnly = true; txtControl.BackColor = Color.WhiteSmoke; txtControl.BorderStyle = Janus.Windows.GridEX.BorderStyle.None; txtControl.Font.Bold.CompareTo(true); txtControl.ReadOnly = true; } txtControl.ForeColor = Color.Black; } if (control is CalendarCombo) { var cboControl = new CalendarCombo(); if (cboControl.Tag != "NO") { cboControl = (CalendarCombo) control; cboControl.ReadOnly = true; cboControl.Font.Bold.CompareTo(true); cboControl.BorderStyle = Janus.Windows.CalendarCombo.BorderStyle.None; cboControl.ShowUpDown = false; cboControl.ShowDropDown = false; cboControl.ForeColor = Color.Black; cboControl.BackColor = Color.WhiteSmoke; cboControl.ReadOnly = true; } } if (control is UICheckBox) { var chkControl = new UICheckBox(); if (chkControl.Tag != "NO") { chkControl = (UICheckBox) control; chkControl.Enabled = false; } } } foreach (Control control in grpThongTinLanKham.Controls) { if (control is EditBox) { var txtControl = new EditBox(); if (txtControl.Tag != "NO") { txtControl = ((EditBox) (control)); txtControl.ReadOnly = true; txtControl.BackColor = Color.WhiteSmoke; txtControl.BorderStyle = Janus.Windows.GridEX.BorderStyle.None; txtControl.Font.Bold.CompareTo(true); } txtControl.ForeColor = Color.Black; } if (control is CalendarCombo) { var cboControl = new CalendarCombo(); if (cboControl.Tag != "NO") { cboControl = (CalendarCombo) control; cboControl.ReadOnly = true; cboControl.Font.Bold.CompareTo(true); cboControl.BorderStyle = Janus.Windows.CalendarCombo.BorderStyle.None; cboControl.ShowUpDown = false; cboControl.ShowDropDown = false; cboControl.ForeColor = Color.Black; cboControl.BackColor = Color.WhiteSmoke; } } if (control is UICheckBox) { var chkControl = new UICheckBox(); if (chkControl.Tag != "NO") { chkControl = (UICheckBox) control; chkControl.Enabled = false; } } } } catch (Exception) { Utility.ShowMsg("Có lỗi trong quá trình set thuộc tính control"); throw; } }
private void ClearControlOfUc(Control parent) { try { foreach (Control control in parent.Controls) { if (control is EditBox) { var txtControl = new EditBox(); txtControl = ((EditBox)control); txtControl.Clear(); } if (control is CalendarCombo) { var txtControl = new CalendarCombo(); txtControl = ((CalendarCombo)control); txtControl.NullValue = true; } if (control is UICheckBox) { var txtControl = new UICheckBox(); txtControl = ((UICheckBox)control); txtControl.Checked = false; } if (control is MaskedEditBox) { var txtControl = new MaskedEditBox(); txtControl = ((MaskedEditBox)control); txtControl.Clear(); } if (control is RichTextBox) { var txtControl = new RichTextBox(); txtControl = ((RichTextBox)control); txtControl.Clear(); } } } catch (Exception ex) { Utility.CatchException(ex); } }