예제 #1
0
        private void frmReception_Load(object sender, EventArgs e)
        {
            ComboboxItem item = new ComboboxItem();

            item.Value = "M";
            item.Text  = "Nam";
            cbbGender.Items.Add(item);
            ComboboxItem item1 = new ComboboxItem();

            item1.Value = "F";
            item1.Text  = "Nữ";
            cbbGender.Items.Add(item1);
            cbbGender.SelectedIndex = 0;
            cbbGender.DisplayMember = "Text";
            mtbFromdate.Text        = DateTime.Now.ToString("01/MM/yyyy 00:01");
            mtbTodate.Text          = DateTime.Now.ToString("dd/MM/yyyy 23:59");
            btnSearch.PerformClick();
            var st = new Systems();

            string[] arrAddress = st.Address().AsEnumerable()
                                  .Select(r => r.Field <string>("sys_address"))
                                  .ToArray();
            actAddress.Values = arrAddress;
            string[] arrSymptom = st.Symptom().AsEnumerable()
                                  .Select(r => r.Field <string>("symptom"))
                                  .ToArray();
            actSymptom.Values = arrSymptom;

            string[] icd = st.Icd().AsEnumerable()
                           .Select(r => r.Field <string>("hi_fullname"))
                           .ToArray();
            actDiagnostic.Values = icd;
            string[] advices = st.Advice().AsEnumerable()
                               .Select(r => r.Field <string>("advice"))
                               .ToArray();
            actAdvice.Values = advices;


            string[] usages = st.DrugUsage().AsEnumerable()
                              .Select(r => r.Field <string>("drugusage"))
                              .ToArray();
            actUsage.Values = usages;

            feelist = st.FeeList();
            sleFee.Properties.DataSource = st.FeeList();
            //sleFee.Properties.Columns["feeid"].Caption = "Mã";
            //sleFee.Properties.Columns["name"].Caption = "Tên dịch vụ";
            sleFee.Properties.DisplayMember = "name";
            sleFee.Properties.ValueMember   = "feeid";
            sleFee.Properties.BestFitMode   = BestFitMode.BestFit;

            tblDrug = new Drug().Select();
            sleDrug.Properties.DataSource    = tblDrug;
            sleDrug.Properties.DisplayMember = "name";
            sleDrug.Properties.ValueMember   = "id";
            sleDrug.Properties.BestFitMode   = BestFitMode.BestFit;

            if (status == null || status == "T")
            {
                SetEnableComponents(false);
            }
            s             = new Systems();
            lblTitle.Text = string.Format("{0} [{1}]", s.SelectValue("clinic_name"), s.SelectValue("clinic_address"));

            cbbDoctor.DataSource    = new Doctor().Select();
            cbbDoctor.DisplayMember = "fullname";
            cbbDoctor.ValueMember   = "username";
            cbbDoctor.SelectedIndex = -1;

            txtSearch.Select();
        }