Beispiel #1
0
        //今日提醒显示
        public string[][] SearchTA(int UserID)
        {
            InitializeTA(UserID);
            DateTime          now      = DateTime.Now;
            string            a        = now.ToString("yyyy-MM-dd");
            string            sqlorder = string.Format("SELECT * FROM TodayAlert WHERE UserID = {0} AND AlertDate ='{1}'", UserID, a);
            SqlBasicOperation searchTA = new SqlBasicOperation();
            DataSet           dataset  = searchTA.Search(sqlorder);

            if (dataset.Tables[0].Rows.Count != 0)
            {
                string[][] TodayAlert = new string[dataset.Tables[0].Rows.Count][];
                int        i          = 0;
                foreach (DataRow datarow in dataset.Tables[0].Rows)
                {
                    string   b   = datarow[4].ToString();
                    DateTime dt  = Convert.ToDateTime(b);
                    string   c   = dt.ToString("HH:mm");
                    DateTime dt1 = Convert.ToDateTime(datarow[6]);
                    string   d   = dt1.ToString("yyyy-MM-dd");
                    TodayAlert[i] = new string[] { datarow[0].ToString(), datarow[1].ToString(), datarow[2].ToString(), datarow[3].ToString(), c, datarow[5].ToString(), d, datarow[7].ToString() };
                    i++;
                }
                dataset.Dispose();
                return(TodayAlert);
            }
            else
            {
                string[][] i = new string[1][];

                i[0] = new string[] { "空" };
                return(i);
            }
        }
Beispiel #2
0
        //查找血糖计划用于表格显示
        public string[][] SearchBSPlan(int UserID)
        {
            string            sqlorder     = string.Format("SELECT * FROM BSPlan WHERE UserID={0}", UserID);
            SqlBasicOperation searchBSplan = new SqlBasicOperation();
            DataSet           dataset      = searchBSplan.Search(sqlorder);

            if (dataset.Tables[0].Rows.Count != 0)
            {
                string[][] BSPlan = new string[dataset.Tables[0].Rows.Count][];
                int        i      = 0;
                foreach (DataRow datarow in dataset.Tables[0].Rows)
                {
                    DateTime dt  = Convert.ToDateTime(datarow[5]);
                    string   a   = dt.ToString("yyyy-MM-dd");
                    string   b   = datarow[4].ToString();
                    DateTime dt1 = Convert.ToDateTime(b);
                    string   c   = dt1.ToString("HH:mm");
                    BSPlan[i] = new string[] { datarow[0].ToString(), datarow[1].ToString(), datarow[2].ToString(), datarow[3].ToString(), c, a, datarow[6].ToString() };
                    i++;
                }
                dataset.Dispose();
                return(BSPlan);
            }
            else
            {
                string[][] i = new string[1][];

                i[0] = new string[] { "空" };
                return(i);
            }
        }
Beispiel #3
0
        //初始化今日提醒的子函数
        private void SearchMaybeInsertTA(DataRow datarow, string b)
        {
            string            sqlorderforSTA = string.Format("SELECT * FROM TodayAlert WHERE UserID={0} AND PlanID={1} AND AlertDate='{2}'", datarow[0], datarow[1], b);
            SqlBasicOperation searchTA       = new SqlBasicOperation();
            DataSet           dataTA         = searchTA.Search(sqlorderforSTA);

            if (dataTA.Tables[0].Rows.Count == 0)
            {
                string            sqlorderforITA = string.Format("INSERT INTO TodayAlert (UserID,PlanID,Project,Time,Completion,AlertDate,Type) VALUES ({0},{1},'{2}','{3}',{4},'{5}',{6})", datarow[0], datarow[1], datarow[2], datarow[4], 0, b, datarow[6]);
                SqlBasicOperation insertTA       = new SqlBasicOperation();
                insertTA.Insert(sqlorderforITA);
            }
            dataTA.Dispose();
        }
Beispiel #4
0
        //初始化今日提醒
        private void InitializeTA(int UserID)
        {
            string            sqlorder      = string.Format("SELECT * FROM BSPlan WHERE UserID={0}", UserID);
            SqlBasicOperation searchallplan = new SqlBasicOperation();
            DataSet           dataset       = new DataSet();

            dataset = searchallplan.Search(sqlorder);
            if (dataset.Tables[0].Rows.Count != 0)
            {
                foreach (DataRow datarow in dataset.Tables[0].Rows)
                {
                    string a = null;
                    string b = null;

                    switch (datarow[3].ToString())
                    {
                    case "仅一次":
                        DateTime origin = Convert.ToDateTime(datarow[5]);
                        a = origin.ToString("yyyy-MM-dd");
                        DateTime now = DateTime.Now;
                        b = now.ToString("yyyy-MM-dd");
                        if (a == b)
                        {
                            SearchMaybeInsertTA(datarow, b);
                        }
                        break;

                    case "1次/天":
                        DateTime now1    = DateTime.Now;
                        DateTime origin1 = Convert.ToDateTime(datarow[5]);
                        string   b1      = now1.ToString("yyyy-MM-dd");

                        if (DateTime.Compare(origin1, now1) <= 0)
                        {
                            SearchMaybeInsertTA(datarow, b1);
                        }

                        break;

                    case "1次/周":
                        DateTime origin2 = Convert.ToDateTime(datarow[5]);
                        a = origin2.DayOfWeek.ToString();
                        DateTime now2 = DateTime.Now;
                        b = now2.DayOfWeek.ToString();
                        string b2 = now2.ToString("yyyy-MM-dd");
                        if (a == b && DateTime.Compare(origin2, now2) <= 0)
                        {
                            SearchMaybeInsertTA(datarow, b2);
                        }
                        break;

                    case "1次/月":
                        DateTime origin3 = Convert.ToDateTime(datarow[5]);
                        a = origin3.Day.ToString();
                        DateTime now3 = DateTime.Now;
                        b = now3.Day.ToString();
                        string b3 = now3.ToString("yyyy-MM-dd");
                        if (a == b && DateTime.Compare(origin3, now3) <= 0)
                        {
                            SearchMaybeInsertTA(datarow, b3);
                        }
                        break;

                    case "1次/季度":
                        DateTime origin4 = Convert.ToDateTime(datarow[5]);
                        a = origin4.Day.ToString();
                        float    x    = origin4.Month;
                        DateTime now4 = DateTime.Now;
                        float    y    = now4.Month;
                        b = now4.Day.ToString();
                        string b4 = now4.ToString("yyyy-MM-dd");
                        string z  = Convert.ToString((x - y) / 3);
                        int    ss;
                        bool   aa = int.TryParse(z, out ss);
                        //z = Math.Abs(z);
                        if (a == b && aa && DateTime.Compare(origin4, now4) <= 0)
                        {
                            SearchMaybeInsertTA(datarow, b4);
                        }
                        break;

                    case "1次/每年":
                        DateTime origin5 = Convert.ToDateTime(datarow[5]);
                        a = origin5.Day.ToString();
                        string   a5   = origin5.Month.ToString();
                        DateTime now5 = DateTime.Now;
                        b = now5.Day.ToString();
                        string b5 = now5.Month.ToString();
                        string b6 = now5.ToString("yyyy-MM-dd");
                        if (a == b && a5 == b5 && DateTime.Compare(origin5, now5) <= 0)
                        {
                            SearchMaybeInsertTA(datarow, b6);
                        }
                        break;
                    }
                }
            }
            dataset.Dispose();
        }
Beispiel #5
0
        //控制目标在建立用户时应为其自动设置默认值
        //查找控制目标
        public ControlGoals SearchControlGoals(int UserID)
        {
            string            sqlorder    = string.Format("SELECT * FROM ControlGoals WHERE UserID={0}", UserID);
            SqlBasicOperation searchgoals = new SqlBasicOperation();
            DataSet           dataset     = new DataSet();

            dataset = searchgoals.Search(sqlorder);
            ControlGoals goals = new ControlGoals();

            //ControlGoalsResults controlgoalsresults = new ControlGoalsResults();
            if (dataset.Tables[0].Rows.Count != 0)
            {
                goals.UserID        = Convert.ToInt32(dataset.Tables[0].Rows[0][0]);
                goals.ControlGoalID = Convert.ToInt32(dataset.Tables[0].Rows[0][1]);
                goals.HbA1c         = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][2]);
                goals.FPGmmolL      = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][3]);
                goals.FPGmgdl       = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][4]);
                goals.FPGflag       = (bool)dataset.Tables[0].Rows[0][5];
                goals.PPGmmolL      = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][6]);
                goals.PPGmgdl       = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][7]);
                goals.PPGflag       = (bool)dataset.Tables[0].Rows[0][8];
                goals.BPH           = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][9]);
                goals.BPL           = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][10]);
                goals.TchmmolL      = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][11]);
                goals.Tchmgdl       = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][12]);
                goals.Tchflag       = (bool)dataset.Tables[0].Rows[0][13];
                goals.LDLchmmolL    = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][14]);
                goals.LDLchmgdl     = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][15]);
                goals.LDLchflag     = (bool)dataset.Tables[0].Rows[0][16];
                goals.HDLchmmolL    = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][17]);
                goals.HDLchmgdl     = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][18]);
                goals.HDLchflag     = (bool)dataset.Tables[0].Rows[0][19];
                goals.TGmmolL       = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][20]);
                goals.TGmgdl        = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][21]);
                goals.TGflag        = (bool)dataset.Tables[0].Rows[0][22];
                goals.UaumolL       = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][23]);
                goals.Uamgdl        = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][24]);
                goals.Uaflag        = (bool)dataset.Tables[0].Rows[0][25];
                goals.AlbCrmgmmol   = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][26]);
                goals.AlbCrmgg      = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][27]);
                goals.AlbCrflag     = (bool)dataset.Tables[0].Rows[0][28];
                goals.Athlete       = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][29]);
                goals.Weight        = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][30]);


                //    controlgoalsresults.UserID = goals.UserID;

                //    controlgoalsresults.HbA1c = goals.HbA1c;

                //    if (goals.FPGflag == true)
                //    {
                //        controlgoalsresults.FPG = goals.FPGmmolL;
                //    }
                //    else
                //    {
                //        controlgoalsresults.FPG = goals.FPGmgdl;
                //    }
                //    controlgoalsresults.FPGflag = goals.FPGflag;

                //    if (goals.PPGflag == true)
                //    {
                //        controlgoalsresults.PPG = goals.PPGmmolL;
                //    }
                //    else
                //    {
                //        controlgoalsresults.PPG = goals.PPGmgdl;
                //    }
                //    controlgoalsresults.PPGflag = goals.PPGflag;

                //    controlgoalsresults.BPH = goals.BPH;

                //    controlgoalsresults.BPL = goals.BPL;

                //    if (goals.Tchflag == true)
                //    {
                //        controlgoalsresults.Tch = goals.TchmmolL;
                //    }
                //    else
                //    {
                //        controlgoalsresults.Tch = goals.Tchmgdl;
                //    }
                //    controlgoalsresults.Tchflag = goals.Tchflag;

                //    if (goals.LDLchflag == true)
                //    {
                //        controlgoalsresults.LDLch = goals.LDLchmmolL;
                //    }
                //    else
                //    {
                //        controlgoalsresults.LDLch = goals.LDLchmgdl;
                //    }
                //    controlgoalsresults.LDLchflag = goals.LDLchflag;

                //    if (goals.TGflag == true)
                //    {
                //        controlgoalsresults.TG = goals.TGmmolL;
                //    }
                //    else
                //    {
                //        controlgoalsresults.TG = goals.TGmgdl;
                //    }
                //    controlgoalsresults.TGflag = goals.TGflag;

                //    if (goals.Uaflag == true)
                //    {
                //        controlgoalsresults.Ua = goals.UaumolL;
                //    }
                //    else
                //    {
                //        controlgoalsresults.Ua = goals.Uamgdl;
                //    }
                //    controlgoalsresults.Uaflag = goals.Uaflag;

                //    controlgoalsresults.Athlete = goals.Athlete;

                //    controlgoalsresults.Weight = goals.Weight;


                //    if (goals.HDLchflag == true)
                //    {
                //        controlgoalsresults.HDLch = goals.HDLchmmolL;
                //    }
                //    else
                //    {
                //        controlgoalsresults.HDLch = goals.HDLchmgdl;
                //    }
                //    controlgoalsresults.HDLchflag = goals.HDLchflag;
                //    if (goals.AlbCrflag == true)
                //    {
                //        controlgoalsresults.AlbCr = goals.AlbCrmgmmol;
                //    }
                //    else
                //    {
                //        controlgoalsresults.AlbCr = goals.AlbCrmgg;
                //    }
                //    controlgoalsresults.AlbCrflag = goals.AlbCrflag;
            }

            else
            {
                //goals.UserID = 0;
                //controlgoalsresults.UserID = 0;
                goals.UserID = 0;
            }


            return(goals);
        }
        //今日提醒显示
        public string[][] SearchTA(int UserID)
        {
            InitializeTA(UserID);
            DateTime now = DateTime.Now;
            string a = now.ToString("yyyy-MM-dd");
            string sqlorder = string.Format("SELECT * FROM TodayAlert WHERE UserID = {0} AND AlertDate ='{1}'", UserID, a);
            SqlBasicOperation searchTA = new SqlBasicOperation();
            DataSet dataset = searchTA.Search(sqlorder);
            if (dataset.Tables[0].Rows.Count != 0)
            {
                string[][] TodayAlert = new string[dataset.Tables[0].Rows.Count][];
                int i = 0;
                foreach (DataRow datarow in dataset.Tables[0].Rows)
                {
                    string b = datarow[4].ToString();
                    DateTime dt = Convert.ToDateTime(b);
                    string c = dt.ToString("HH:mm");
                    DateTime dt1 = Convert.ToDateTime(datarow[6]);
                    string d = dt1.ToString("yyyy-MM-dd");
                    TodayAlert[i] = new string[] { datarow[0].ToString(), datarow[1].ToString(), datarow[2].ToString(), datarow[3].ToString(), c,datarow[5].ToString(), d,datarow[7].ToString() };
                    i++;
                }
                dataset.Dispose();
                return TodayAlert;
            }
            else
            {
                string[][] i = new string[1][];

                i[0] = new string[] { "空" };
                return i;
            }

        }
 //初始化今日提醒的子函数
 private void SearchMaybeInsertTA(DataRow datarow ,string b)
 {
     string sqlorderforSTA = string.Format("SELECT * FROM TodayAlert WHERE UserID={0} AND PlanID={1} AND AlertDate='{2}'", datarow[0], datarow[1], b);
     SqlBasicOperation searchTA = new SqlBasicOperation();
     DataSet dataTA = searchTA.Search(sqlorderforSTA);
     if (dataTA.Tables[0].Rows.Count == 0)
     {
         string sqlorderforITA = string.Format("INSERT INTO TodayAlert (UserID,PlanID,Project,Time,Completion,AlertDate,Type) VALUES ({0},{1},'{2}','{3}',{4},'{5}',{6})", datarow[0], datarow[1], datarow[2], datarow[4], 0, b,datarow[6]);
         SqlBasicOperation insertTA = new SqlBasicOperation();
         insertTA.Insert(sqlorderforITA);
     }
     dataTA.Dispose();
 }
 //初始化今日提醒
 private void InitializeTA(int UserID)
 {
     string sqlorder = string.Format("SELECT * FROM BSPlan WHERE UserID={0}", UserID);
     SqlBasicOperation searchallplan = new SqlBasicOperation();
     DataSet dataset = new DataSet();
     dataset = searchallplan.Search(sqlorder);
     if (dataset.Tables[0].Rows.Count != 0)
     {
         foreach (DataRow datarow in dataset.Tables[0].Rows)
         {
             string a = null;
             string b = null;
             
             switch (datarow[3].ToString())
             {
                 case "仅一次":
                     DateTime origin = Convert.ToDateTime(datarow[5]);
                     a = origin.ToString("yyyy-MM-dd");
                     DateTime now = DateTime.Now;
                     b = now.ToString("yyyy-MM-dd");
                     if (a == b)
                     {
                         SearchMaybeInsertTA(datarow,b);                              
                     }
                     break;
                 case "1次/天":
                     DateTime now1 = DateTime.Now;
                     DateTime origin1 = Convert.ToDateTime(datarow[5]);
                     string b1 = now1.ToString("yyyy-MM-dd");
                     
                     if(DateTime.Compare(origin1,now1)<=0)
                     {
                        SearchMaybeInsertTA(datarow, b1);
                     }
                     
                     break;
                 case "1次/周":
                     DateTime origin2 = Convert.ToDateTime(datarow[5]);
                     a = origin2.DayOfWeek.ToString();
                     DateTime now2 = DateTime.Now;                            
                     b = now2.DayOfWeek.ToString();
                     string b2 = now2.ToString("yyyy-MM-dd");
                     if (a == b && DateTime.Compare(origin2,now2)<=0)
                     {
                         SearchMaybeInsertTA(datarow, b2);
                     }
                     break;
                 case "1次/月":
                     DateTime origin3 = Convert.ToDateTime(datarow[5]);
                     a = origin3.Day.ToString();
                     DateTime now3 = DateTime.Now;
                     b = now3.Day.ToString();
                     string b3 = now3.ToString("yyyy-MM-dd");
                     if (a == b && DateTime.Compare(origin3,now3)<=0)
                     {
                         SearchMaybeInsertTA(datarow, b3);
                     }
                     break;
                 case "1次/季度":
                     DateTime origin4 = Convert.ToDateTime(datarow[5]);
                     a = origin4.Day.ToString();
                     float x = origin4.Month;
                     DateTime now4 = DateTime.Now;
                     float y = now4.Month;
                     b = now4.Day.ToString();
                     string b4 = now4.ToString("yyyy-MM-dd");
                     string z = Convert.ToString((x - y)/3);
                     int ss;
                     bool aa = int.TryParse(z, out ss);
                     //z = Math.Abs(z);
                     if(a == b && aa && DateTime.Compare(origin4,now4)<=0)
                     {                                          
                           SearchMaybeInsertTA(datarow, b4);                                                            
                     }
                     break; 
                  case "1次/每年":
                     DateTime origin5 = Convert.ToDateTime(datarow[5]);
                     a = origin5.Day.ToString();
                     string a5 = origin5.Month.ToString();
                     DateTime now5 = DateTime.Now;
                     b = now5.Day.ToString();
                     string b5 = now5.Month.ToString();
                     string b6 = now5.ToString("yyyy-MM-dd");
                     if (a == b && a5 == b5 && DateTime.Compare(origin5,now5)<=0)
                     {
                         SearchMaybeInsertTA(datarow, b6);
                     }
                     break;
             }               
         }
     }
     dataset.Dispose();
 }
        //查找血糖计划用于表格显示
        public string[][] SearchBSPlan(int UserID)
        {
            string sqlorder = string.Format("SELECT * FROM BSPlan WHERE UserID={0}",UserID);
            SqlBasicOperation searchBSplan = new SqlBasicOperation();
            DataSet dataset = searchBSplan.Search(sqlorder);
            if (dataset.Tables[0].Rows.Count != 0)
            {
                
                string[][] BSPlan = new string[dataset.Tables[0].Rows.Count][];
                int i = 0;
                foreach (DataRow datarow in dataset.Tables[0].Rows)
                {
                    DateTime dt = Convert.ToDateTime(datarow[5]);
                    string a = dt.ToString("yyyy-MM-dd");
                    string b = datarow[4].ToString();
                    DateTime dt1 = Convert.ToDateTime(b);
                    string c = dt1.ToString("HH:mm");
                    BSPlan[i] = new string[] { datarow[0].ToString(), datarow[1].ToString(), datarow[2].ToString(), datarow[3].ToString(), c, a,datarow[6].ToString() };
                    i++;
                    
                }
                dataset.Dispose();
                return BSPlan;

            }
            else
            {
                string[][] i = new string[1][];
                
                i[0] =new string[]{ "空"};
                return i;
            }

        }
Beispiel #10
0
        //控制目标在建立用户时应为其自动设置默认值
        //查找控制目标
        public ControlGoals SearchControlGoals(int UserID)
        {
            string sqlorder = string.Format("SELECT * FROM ControlGoals WHERE UserID={0}", UserID);
            SqlBasicOperation searchgoals = new SqlBasicOperation();
            DataSet dataset = new DataSet();
            dataset = searchgoals.Search(sqlorder);
            ControlGoals goals = new ControlGoals();
            //ControlGoalsResults controlgoalsresults = new ControlGoalsResults();
            if (dataset.Tables[0].Rows.Count != 0)
            {
                goals.UserID = Convert.ToInt32(dataset.Tables[0].Rows[0][0]);
                goals.ControlGoalID = Convert.ToInt32(dataset.Tables[0].Rows[0][1]);
                goals.HbA1c = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][2]);
                goals.FPGmmolL = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][3]);
                goals.FPGmgdl = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][4]);
                goals.FPGflag = (bool)dataset.Tables[0].Rows[0][5];
                goals.PPGmmolL = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][6]);
                goals.PPGmgdl = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][7]);
                goals.PPGflag = (bool)dataset.Tables[0].Rows[0][8];
                goals.BPH = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][9]);
                goals.BPL = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][10]);
                goals.TchmmolL = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][11]);
                goals.Tchmgdl = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][12]);
                goals.Tchflag = (bool)dataset.Tables[0].Rows[0][13];
                goals.LDLchmmolL = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][14]);
                goals.LDLchmgdl = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][15]);
                goals.LDLchflag = (bool)dataset.Tables[0].Rows[0][16];
                goals.HDLchmmolL = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][17]);
                goals.HDLchmgdl = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][18]);
                goals.HDLchflag = (bool)dataset.Tables[0].Rows[0][19];
                goals.TGmmolL = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][20]);
                goals.TGmgdl = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][21]);
                goals.TGflag = (bool)dataset.Tables[0].Rows[0][22];
                goals.UaumolL = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][23]);
                goals.Uamgdl = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][24]);
                goals.Uaflag = (bool)dataset.Tables[0].Rows[0][25];
                goals.AlbCrmgmmol = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][26]);
                goals.AlbCrmgg = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][27]);
                goals.AlbCrflag = (bool)dataset.Tables[0].Rows[0][28];
                goals.Athlete = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][29]);
                goals.Weight = (float)Convert.ToDouble(dataset.Tables[0].Rows[0][30]);

                
            //    controlgoalsresults.UserID = goals.UserID;

            //    controlgoalsresults.HbA1c = goals.HbA1c;

            //    if (goals.FPGflag == true)
            //    {
            //        controlgoalsresults.FPG = goals.FPGmmolL;
            //    }
            //    else
            //    {
            //        controlgoalsresults.FPG = goals.FPGmgdl;
            //    }
            //    controlgoalsresults.FPGflag = goals.FPGflag;

            //    if (goals.PPGflag == true)
            //    {
            //        controlgoalsresults.PPG = goals.PPGmmolL;
            //    }
            //    else
            //    {
            //        controlgoalsresults.PPG = goals.PPGmgdl;
            //    }
            //    controlgoalsresults.PPGflag = goals.PPGflag;

            //    controlgoalsresults.BPH = goals.BPH;

            //    controlgoalsresults.BPL = goals.BPL;

            //    if (goals.Tchflag == true)
            //    {
            //        controlgoalsresults.Tch = goals.TchmmolL;
            //    }
            //    else
            //    {
            //        controlgoalsresults.Tch = goals.Tchmgdl;
            //    }
            //    controlgoalsresults.Tchflag = goals.Tchflag;

            //    if (goals.LDLchflag == true)
            //    {
            //        controlgoalsresults.LDLch = goals.LDLchmmolL;
            //    }
            //    else
            //    {
            //        controlgoalsresults.LDLch = goals.LDLchmgdl;
            //    }
            //    controlgoalsresults.LDLchflag = goals.LDLchflag;

            //    if (goals.TGflag == true)
            //    {
            //        controlgoalsresults.TG = goals.TGmmolL;
            //    }
            //    else
            //    {
            //        controlgoalsresults.TG = goals.TGmgdl;
            //    }
            //    controlgoalsresults.TGflag = goals.TGflag;

            //    if (goals.Uaflag == true)
            //    {
            //        controlgoalsresults.Ua = goals.UaumolL;
            //    }
            //    else
            //    {
            //        controlgoalsresults.Ua = goals.Uamgdl;
            //    }
            //    controlgoalsresults.Uaflag = goals.Uaflag;

            //    controlgoalsresults.Athlete = goals.Athlete;

            //    controlgoalsresults.Weight = goals.Weight;

                
            //    if (goals.HDLchflag == true)
            //    {
            //        controlgoalsresults.HDLch = goals.HDLchmmolL;
            //    }
            //    else
            //    {
            //        controlgoalsresults.HDLch = goals.HDLchmgdl;
            //    }
            //    controlgoalsresults.HDLchflag = goals.HDLchflag;
            //    if (goals.AlbCrflag == true)
            //    {
            //        controlgoalsresults.AlbCr = goals.AlbCrmgmmol;
            //    }
            //    else
            //    {
            //        controlgoalsresults.AlbCr = goals.AlbCrmgg;
            //    }
            //    controlgoalsresults.AlbCrflag = goals.AlbCrflag;
            }
                
            else
            {
                //goals.UserID = 0;
                //controlgoalsresults.UserID = 0;
                goals.UserID = 0;
            }


            return goals;

        }