예제 #1
0
        /// <summary>
        /// 返回当前时间检查排队列表
        /// </summary>
        /// <param name="str_msg"></param>
        /// <param name="str_GroupId"></param>
        /// <param name="str_TeamId"></param>
        /// <returns></returns>
        public List <CurrentSchedulModel> GetCurrentSchedulModels(out string str_msg, string str_GroupId, string str_TeamId)
        {
            List <CurrentSchedulModel> arr_currentSchedulModels = new List <CurrentSchedulModel>();
            DataSet _DataSet = new DataSet();

            if (_con.ConInit(out str_msg) && _con.SelGroupDetail(out str_msg, out _DataSet))
            {
                DataTable _table = _DataSet.Tables[0];
                for (int i = 0; i < _table.Rows.Count; i++)
                {
                    if (!string.IsNullOrEmpty(str_GroupId) && str_GroupId == _table.Rows[i]["GroupId"] + "" && ((string.IsNullOrEmpty(str_TeamId) || (!string.IsNullOrEmpty(str_TeamId) && str_TeamId == _table.Rows[i]["teamid"] + ""))))
                    {
                        CurrentSchedulModel _currentSchedulModel = new CurrentSchedulModel();
                        _currentSchedulModel.macid          = int.Parse(_table.Rows[i]["macid"] + "");
                        _currentSchedulModel.macname        = _table.Rows[i]["macname"] + "";
                        _currentSchedulModel.GroupDescption = _table.Rows[i]["GroupDescption"] + "";
                        _currentSchedulModel.teamDescption  = _table.Rows[i]["teamDescption"] + "";
                        arr_currentSchedulModels.Add(_currentSchedulModel);
                    }
                }
            }

            _DataSet = new DataSet();
            if (!string.IsNullOrEmpty(str_GroupId))
            {
                List <string> arr_condition = new List <string>();
                arr_condition.Add(str_GroupId);
                if (!string.IsNullOrEmpty(str_TeamId))
                {
                    arr_condition.Add(str_TeamId);
                }
                if (_con.SelViewCurrentSchedul(out str_msg, out _DataSet, arr_condition.ToArray()))
                {
                    DataTable _table = _DataSet.Tables[0];
                    for (int i = 0; i < _table.Rows.Count; i++)
                    {
                        for (int j = 0; j < arr_currentSchedulModels.Count(); j++)
                        {
                            if (arr_currentSchedulModels[j].macid == int.Parse(_table.Rows[i]["macid"] + ""))
                            {
                                arr_currentSchedulModels[j].PatName    = _table.Rows[i]["PatName"] + "";
                                arr_currentSchedulModels[j].signInDate = _table.Rows[i]["signInDate"] + "";
                                arr_currentSchedulModels[j].SignInSeq  = int.Parse("0" + _table.Rows[i]["SignInSeq"]);
                                break;
                            }
                        }
                    }
                }
            }
            else
            {
                str_msg = "parameter is null!";
            }
            return(arr_currentSchedulModels);
        }