Exemplo n.º 1
0
        public void SetLabels(int id, string mutProb, string name, string relationship)
        {
            relId = id;

            //old v2 way:
            //testingWillingnessComboBox.Text =
            //    Patient.getRelativeValueFromDB("tblRiskDataRelatives", "testingWillingness", relId);

            RelativeValueHolder relValHolder = new RelativeValueHolder("");

            ParameterCollection pc = new ParameterCollection("unitnum", SessionManager.Instance.GetActivePatient().unitnum);
            pc.Add("relativeid", relId);
            pc.Add("table", "tblRiskDataRelatives");
            pc.Add("column", "testingWillingness");
            relValHolder.DoLoadWithSpAndParams("sp_3_LoadRelativeValue", pc);
            testingWillingnessComboBox.Text = relValHolder.relativeValue;

            if (string.IsNullOrEmpty(mutProb) == false)
            {
                try
                {
                    brcapro = (int)Math.Round(double.Parse(mutProb));
                    if (brcapro > 0)
                    {
                        BrcaLabel.Text = brcapro.ToString() + "%";
                    }
                    else
                    {
                        BrcaLabel.Text = "";
                    }
                }
                catch { }
            }
            else
            {
                BrcaLabel.Text = "";
            }
            // You might well not know the mother's name (e.g.)
            if (!String.IsNullOrEmpty(name))
            {
                if (name.Contains(" "))
                {
                    string[] tokens = name.Split(' ');
                    if (name.Contains(','))
                        name = tokens[1].Replace(",","");
                    else
                        name = tokens[0];
                }
                //NameLabel.Text = name;
                RelationshipLabel.Text = name;
            }
            else
            {
                RelationshipLabel.Text = relationship;
            }
            RelationshipLabel.Text = RelationshipLabel.Text.Replace(" ", Environment.NewLine);
            int delta = this.Height - RelationshipLabel.Height;
            RelationshipLabel.Location = new Point(RelationshipLabel.Location.X, delta / 2);
        }
Exemplo n.º 2
0
        private void testingWillingnessComboBox_SelectedChangeCommitted(object sender, EventArgs e)
        {
            if (relId > 0)
            {
                ParameterCollection pc = new ParameterCollection("unitnum", SessionManager.Instance.GetActivePatient().unitnum);
                pc.Add("relativeid", relId);
                pc.Add("table", "tblRiskDataRelatives");
                pc.Add("column", "testingWillingness");
                pc.Add("relativeValue", (string)testingWillingnessComboBox.SelectedItem);

                RelativeValueHolder      relValHolder = new RelativeValueHolder((string)testingWillingnessComboBox.SelectedItem);
                HraModelChangedEventArgs args         = new HraModelChangedEventArgs(null);

                relValHolder.DoPersistWithSpAndParams(args, "sp_3_Save_RelativeValue", ref pc);
            }
        }
Exemplo n.º 3
0
        private void testingWillingnessComboBox_SelectedChangeCommitted(object sender, EventArgs e)
        {
            if (relId > 0)
            {
                ParameterCollection pc = new ParameterCollection("unitnum", SessionManager.Instance.GetActivePatient().unitnum);
                pc.Add("relativeid", relId);
                pc.Add("table", "tblRiskDataRelatives");
                pc.Add("column", "testingWillingness");
                pc.Add("relativeValue", (string)testingWillingnessComboBox.SelectedItem);

                RelativeValueHolder relValHolder = new RelativeValueHolder((string)testingWillingnessComboBox.SelectedItem);
                HraModelChangedEventArgs args = new HraModelChangedEventArgs(null);

                relValHolder.DoPersistWithSpAndParams(args, "sp_3_Save_RelativeValue", ref pc);
            }
        }
Exemplo n.º 4
0
        public void SetLabels(int id, string mutProb, string name, string relationship)
        {
            relId = id;

            //old v2 way:
            //testingWillingnessComboBox.Text =
            //    Patient.getRelativeValueFromDB("tblRiskDataRelatives", "testingWillingness", relId);

            RelativeValueHolder relValHolder = new RelativeValueHolder("");

            ParameterCollection pc = new ParameterCollection("unitnum", SessionManager.Instance.GetActivePatient().unitnum);

            pc.Add("relativeid", relId);
            pc.Add("table", "tblRiskDataRelatives");
            pc.Add("column", "testingWillingness");
            relValHolder.DoLoadWithSpAndParams("sp_3_LoadRelativeValue", pc);
            testingWillingnessComboBox.Text = relValHolder.relativeValue;

            if (string.IsNullOrEmpty(mutProb) == false)
            {
                try
                {
                    brcapro = (int)Math.Round(double.Parse(mutProb));
                    if (brcapro > 0)
                    {
                        BrcaLabel.Text = brcapro.ToString() + "%";
                    }
                    else
                    {
                        BrcaLabel.Text = "";
                    }
                }
                catch { }
            }
            else
            {
                BrcaLabel.Text = "";
            }
            // You might well not know the mother's name (e.g.)
            if (!String.IsNullOrEmpty(name))
            {
                if (name.Contains(" "))
                {
                    string[] tokens = name.Split(' ');
                    if (name.Contains(','))
                    {
                        name = tokens[1].Replace(",", "");
                    }
                    else
                    {
                        name = tokens[0];
                    }
                }
                //NameLabel.Text = name;
                RelationshipLabel.Text = name;
            }
            else
            {
                RelationshipLabel.Text = relationship;
            }
            RelationshipLabel.Text = RelationshipLabel.Text.Replace(" ", Environment.NewLine);
            int delta = this.Height - RelationshipLabel.Height;

            RelationshipLabel.Location = new Point(RelationshipLabel.Location.X, delta / 2);
        }