Exemplo n.º 1
0
        private void FillMain()
        {
            if (textDateStart.errorProvider1.GetError(textDateStart) != "" ||
                textDateEnd.errorProvider1.GetError(textDateEnd) != "")
            {
                //MessageBox.Show(Lan.g(this,"Please fix data entry errors first."));
                return;
            }

            /*if(checkGroupFamilies.Checked){
             *      textFamilyMessage.Visible=true;
             *      labelFamilyMessage.Visible=true;
             * }
             * else{
             *      textFamilyMessage.Visible=false;
             *      labelFamilyMessage.Visible=false;
             * }*/
            DateTime fromDate;
            DateTime toDate;

            if (textDateStart.Text == "")
            {
                fromDate = DateTime.MinValue.AddDays(1);              //because we don't want to include 010101
            }
            else
            {
                fromDate = PIn.PDate(textDateStart.Text);
            }
            if (textDateEnd.Text == "")
            {
                toDate = DateTime.MaxValue;
            }
            else
            {
                toDate = PIn.PDate(textDateEnd.Text);
            }
            table = Recalls.GetRecallList(fromDate, toDate, checkGroupFamilies.Checked);
            int scrollval = gridMain.ScrollValue;

            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableRecallList", "Due Date"), 75);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallList", "Patient"), 120);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallList", "Age"), 30);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallList", "Interval"), 50);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallList", "Contact"), 120);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallList", "Status"), 130);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallList", "Note"), 200);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(table.Rows[i]["dueDate"].ToString());
                row.Cells.Add(table.Rows[i]["patientName"].ToString());
                row.Cells.Add(table.Rows[i]["age"].ToString());
                row.Cells.Add(table.Rows[i]["recallInterval"].ToString());
                row.Cells.Add(table.Rows[i]["contactMethod"].ToString());
                row.Cells.Add(table.Rows[i]["status"].ToString());
                //DefB.GetName(DefCat.RecallUnschedStatus,RecallList[i].RecallStatus));
                row.Cells.Add(table.Rows[i]["Note"].ToString());
                row.Tag = table.Rows[i];              //although not used yet.
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }