public void InitControl() { try { int soluotkham = Utility.Int32Dbnull(dtSttKham.Compute("SUM(so_luong)", KcbDangkyKcb.Columns.IdKhoakcb + "=" + id_khoakcb.ToString()), 0); string str = Utility.sDbnull(soluotkham, "0"); if (Utility.Int32Dbnull(soluotkham, 0) < 10) { str = Utility.FormatNumberToString(soluotkham, "00"); } UIAction.SetText(lblTotal, str); flowLayoutPanel1.Controls.Clear(); foreach (DataRow dr in dtBuongkham.Rows) { ucQMSItem _ucQMSItem = new ucQMSItem(Utility.Int32Dbnull(dr[DmucDichvukcb.Columns.IdKhoaphong], 0), Utility.sDbnull(dr[DmucKhoaphong.Columns.MaKhoaphong], "KKB"), Utility.Int32Dbnull(dr[DmucDichvukcb.Columns.IdKieukham], 0), Utility.Int32Dbnull(dr[DmucDichvukcb.Columns.IdPhongkham], 0), Utility.Int32Dbnull(dr[DmucDichvukcb.Columns.IdDichvukcb], 0), Utility.sDbnull(dr["ten_hienthi"]), _QMSProperties, ma_doituong_kcb, 0); _ucQMSItem._OnCreatedQMSNumber += _ucQMSItem__OnCreatedQMSNumber; DataRow[] arrDr = dtSttKham.Select(KcbDangkyKcb.Columns.IdKhoakcb + "=" + _ucQMSItem.id_KhoaKcb.ToString() + " AND " + KcbDangkyKcb.Columns.IdPhongkham + "=" + _ucQMSItem.id_phongkham.ToString()); //if (arrDr.Length > 0) //{ DataTable dtSTTKhamItem = dtSttKham.Clone(); if (arrDr.Length > 0) { dtSTTKhamItem = arrDr.CopyToDataTable(); } _ucQMSItem.Init(dtSTTKhamItem); flowLayoutPanel1.Controls.Add(_ucQMSItem); //} } } catch (Exception ex) { } }
public void InitControl() { try { int soluotkham =Utility.Int32Dbnull( dtSttKham.Compute("SUM(so_luong)", KcbDangkyKcb.Columns.IdKhoakcb + "=" + id_khoakcb.ToString()),0); string str = Utility.sDbnull(soluotkham, "0"); if (Utility.Int32Dbnull(soluotkham, 0) < 10) { str = Utility.FormatNumberToString(soluotkham, "00"); } UIAction.SetText(lblTotal, str); flowLayoutPanel1.Controls.Clear(); foreach (DataRow dr in dtBuongkham.Rows) { ucQMSItem _ucQMSItem = new ucQMSItem(Utility.Int32Dbnull(dr[DmucDichvukcb.Columns.IdKhoaphong], 0), Utility.sDbnull(dr[DmucKhoaphong.Columns.MaKhoaphong], "KKB"), Utility.Int32Dbnull(dr[DmucDichvukcb.Columns.IdKieukham], 0), Utility.Int32Dbnull(dr[DmucDichvukcb.Columns.IdPhongkham], 0), Utility.Int32Dbnull(dr[DmucDichvukcb.Columns.IdDichvukcb], 0), Utility.sDbnull(dr["ten_hienthi"]), _QMSProperties, ma_doituong_kcb, 0); _ucQMSItem._OnCreatedQMSNumber += _ucQMSItem__OnCreatedQMSNumber; DataRow[] arrDr = dtSttKham.Select(KcbDangkyKcb.Columns.IdKhoakcb + "=" + _ucQMSItem.id_KhoaKcb.ToString() + " AND " + KcbDangkyKcb.Columns.IdPhongkham + "=" + _ucQMSItem.id_phongkham.ToString()); //if (arrDr.Length > 0) //{ DataTable dtSTTKhamItem = dtSttKham.Clone() ; if (arrDr.Length > 0) dtSTTKhamItem = arrDr.CopyToDataTable(); _ucQMSItem.Init(dtSTTKhamItem); flowLayoutPanel1.Controls.Add(_ucQMSItem); //} } } catch (Exception ex) { } }