コード例 #1
0
        /// <summary>
        /// 测试用
        /// </summary>
        /// <returns></returns>
        public ActionResult TestView()
        {
            IPatCon.ConInit(out str_msg);
            DataSet ds = new DataSet();

            IPatCon.SelDateTimeSplit(out str_msg, out ds);
            ViewBag.Message = str_msg;
            return(View());
        }
コード例 #2
0
        public ActionResult SignInIDCard(string IDCard, string GroupId)
        {
            if (string.IsNullOrEmpty(IDCard))
            {
                throw  new Exception("卡号为空或卡号读取失败!");
            }
            else
            {
                DataSet _DataResult = new DataSet();
                if (_ISchedulCon.ConInit(out str_msg) && _ISchedulCon.SelMainIDCurrentSchedulForIDCard(out str_msg, out _DataResult, new string[] { IDCard.ToUpper().Trim(), GroupId }) && _DataResult != null && _DataResult.Tables[0].Rows.Count > 0)
                {
                    string   str_mainID = _DataResult.Tables[0].Rows[0][0] + "";
                    string   str_teamid = _DataResult.Tables[0].Rows[0][1] + "";
                    string[] arr_mainID = { str_mainID };
                    int      int_maxseq = 0;
                    _DataResult = new DataSet();
                    int_maxseq  = _GetData.GetMaxCurrenSeq(out str_msg, str_teamid);
                    string          SchedulDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo);
                    List <string[]> arr2_value      = new List <string[]> {
                        new string[] { SchedulDateTime.ConvertSqlCondition(), int_maxseq.ToString() }
                    };
                    if (_ISchedulCon.UpdateSchedulSigninDate(out str_msg, arr2_value, arr_mainID))
                    {
                    }

                    string SchedulDate    = DateTime.Now.ToString("yyyy-MM-dd", DateTimeFormatInfo.InvariantInfo);
                    string dt_SchedulDate = DateTime.Now.ToString("HH:mm:dd", DateTimeFormatInfo.InvariantInfo);
                    string SchedulTime    = _GetData.GetDateSplit(out str_msg, dt_SchedulDate);
                    List <List <SchedulPrint> > arr2_schedulPrints = new List <List <SchedulPrint> >();
                    List <SchedulPrint>         arr_schedulPrints  = _GetData.GetSchedulPrint(out str_msg, GroupId, SchedulDate, SchedulTime);
                    string str_teamName = "";
                    List <SchedulPrint> tmp_schedulPrints = new List <SchedulPrint>();
                    foreach (SchedulPrint sp in arr_schedulPrints)
                    {
                        if (str_teamName != sp.TeamName)
                        {
                            if (str_teamName != "")
                            {
                                arr2_schedulPrints.Add(tmp_schedulPrints);
                                tmp_schedulPrints = new List <SchedulPrint>();
                            }
                            tmp_schedulPrints.Add(sp);
                            str_teamName = sp.TeamName;
                        }
                        else
                        {
                            tmp_schedulPrints.Add(sp);
                        }
                    }
                    arr2_schedulPrints.Add(tmp_schedulPrints);
                    tmp_schedulPrints   = new List <SchedulPrint>();
                    ViewBag.SchedulDate = arr2_schedulPrints;
                    return(PartialView("/Views/Schedul/SchedulSignInView.cshtml"));
                }
                else
                {
                    throw new Exception("签到失败,找不到未签到记录!");
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// 返回检查排队列表
        /// </summary>
        /// <param name="str_msg"></param>
        /// <param name="str_GroupId"></param>
        /// <param name="str_SchedulDate"></param>
        /// <param name="str_SchedulTime"></param>
        /// <returns></returns>
        public List <SchedulShowModel> SchedulInitTable(out string str_msg, string str_GroupId, string str_SchedulDate, string str_SchedulTime)
        {
            List <SchedulShowModel> arr_schedulShow = new List <SchedulShowModel>();
            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 (_table.Rows[i]["groupid"] + "" == str_GroupId)
                    {
                        SchedulShowModel _SchedulShowModel = new SchedulShowModel();
                        _SchedulShowModel.macid   = Int64.Parse(_table.Rows[i]["macid"] + "");
                        _SchedulShowModel.macname = _table.Rows[i]["macname"] + "";
                        arr_schedulShow.Add(_SchedulShowModel);
                    }
                }
                _DataSet = null;
            }
            else
            {
                return(null);
            }
            if (!string.IsNullOrEmpty(str_SchedulDate) && !string.IsNullOrEmpty(str_SchedulTime))
            {
                DataSet  _DataTmp      = new DataSet();
                string[] arr_condition = { str_GroupId, str_SchedulDate, str_SchedulTime };
                if (_con.SelViewSchedulMain(out str_msg, out _DataTmp, arr_condition))
                {
                    DataTable _table = _DataTmp.Tables[0];
                    for (int i = 0; i < _table.Rows.Count; i++)
                    {
                        Int64 str_macid = Int64.Parse(_table.Rows[i]["macid"] + "");
                        foreach (SchedulShowModel _schedulShowModel in arr_schedulShow)
                        {
                            if (_schedulShowModel.macid == str_macid)
                            {
                                _schedulShowModel.mainid            = Int64.Parse(_table.Rows[i]["mainid"] + "");
                                _schedulShowModel.patid             = Int64.Parse(_table.Rows[i]["patid"] + "");
                                _schedulShowModel.patName           = (_table.Rows[i]["patName"] + "");
                                _schedulShowModel.remark            = (_table.Rows[i]["remark"] + "");
                                _schedulShowModel.routeName         = (_table.Rows[i]["routeName"] + "");
                                _schedulShowModel.SchedulDate       = (_table.Rows[i]["SchedulDate"] + "");
                                _schedulShowModel.SchedulTime       = (_table.Rows[i]["SchedulTime"] + "");
                                _schedulShowModel.anticoagulantName = (_table.Rows[i]["anticoagulantName"] + "");
                                _schedulShowModel.dialyzerName      = (_table.Rows[i]["dialyzerName"] + "");
                                break;
                            }
                        }
                    }
                }
            }

            return(arr_schedulShow);
        }
コード例 #4
0
        public ActionResult GetPayPateint()
        {
            try
            {
                DataSet _PatData = new DataSet();
                if (!IPatCon.ConInit(out str_msg))
                {
                    ViewBag.Message     = str_msg;
                    ViewBag.PatientDate = null;
                    return(View());
                }
                else
                {
                    if (IPatOraCon.ConInit(out str_msg))
                    {
                        DataSet _dataSet = new DataSet();
                        IPatOraCon.ConInit(out str_msg);
                        if (IPatOraCon.SelPayPatient(out str_msg, out _dataSet))
                        {
                            List <string[]> arr2_insertValues = new List <string[]>();
                            DataTable       _dataTable        = _dataSet.Tables[0];
                            for (int i = 0; i < _dataTable.Rows.Count; i++)
                            {
                                PatientModel _patientModel = new PatientModel();
                                _patientModel.PatName      = _dataTable.Rows[i]["病人姓名"] + "";
                                _patientModel.PatIdCardNo  = _dataTable.Rows[i]["身份证"] + "";
                                _patientModel.PatOutCardNo = _dataTable.Rows[i]["卡号"] + "";
                                _patientModel.PatSex       = _dataTable.Rows[i]["性别"] + "";
                                _patientModel.SendDeptName = _dataTable.Rows[i]["开方科室"] + "";
                                _patientModel.TelphoneNo   = _dataTable.Rows[i]["电话"] + "";
                                string   str_paymentDate = _dataTable.Rows[i]["日期"] + "";
                                string   str_Brithday    = _dataTable.Rows[i]["出生日期"] + "";
                                DateTime _briDateTime    = DateTime.Parse(str_Brithday);
                                DateTime _payDateTime    = DateTime.Parse(str_paymentDate);
                                _patientModel.PaymentDate = string.IsNullOrEmpty(str_paymentDate) ? string.Empty : string.Format("{0:yyyy-MM-dd}", _payDateTime);
                                _patientModel.PatBrithday = string.IsNullOrEmpty(str_Brithday) ? string.Empty : string.Format("{0:yyyy-MM-dd}", _briDateTime);
                                _patientModel.PatAge      = Convert.ToInt32(((_payDateTime - _briDateTime).TotalDays / 365));
                                _patientModel.IsRead      = 1;
                                string[] arr_check    = { _patientModel.PatName, _patientModel.PatIdCardNo };
                                string[] arr_ValueTmp =
                                {
                                    _patientModel.PatName.ConvertSqlCondition()
                                    , _patientModel.PatSex.ConvertSqlCondition()
                                    , _patientModel.PatBrithday.ConvertSqlCondition()
                                    , _patientModel.PatAge.ToString()
                                    , _patientModel.PatIdCardNo.ConvertSqlCondition()
                                    , _patientModel.SendDeptId.ConvertSqlCondition()
                                    , _patientModel.SendDeptName.ConvertSqlCondition()
                                    , _patientModel.PatOutCardNo.ToUpper().ConvertSqlCondition()
                                    , _patientModel.TelphoneNo.ConvertSqlCondition()
                                    , _patientModel.PaymentDate.ConvertSqlCondition()
                                    , _patientModel.Remark.ConvertSqlCondition()
                                };
                                if (IPatCon.CheckPatIsRead(out str_msg, arr_check))
                                {
                                    arr2_insertValues.Add(arr_ValueTmp);
                                }
                            }
                            if (arr2_insertValues != null)
                            {
                                IPatCon.InsertPatInformation(out str_msg, arr2_insertValues);
                            }
                            if (IPatCon.SelPatInformation(out str_msg, out _PatData, string.Empty))
                            {
                                var _PatTable    = _PatData.Tables[0];
                                var arr_PatModel = Convert <PatientModel> .ConvertToList(_PatTable);

                                ViewBag.PatientDate = arr_PatModel.ToList <PatientModel>();
                            }
                            PartialViewResult x = PartialView("/Views/Patient/GetPatient.cshtml");
                            return(x);
                        }
                        else
                        {
                            throw new Exception(str_msg);
                        }
                    }
                    else
                    {
                        throw new Exception(str_msg);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #5
0
        public ActionResult SaveMain(List <SchedulColumnMainModel> schedulColumnMains)
        {
            if (_ICon.ConInit(out str_msg) && schedulColumnMains != null)
            {
                if (schedulColumnMains.Count > 0)
                {
                    List <string[]> arr2_insertList    = new List <string[]>();
                    List <string[]> arr2_updateValList = new List <string[]>();
                    List <string>   arr_updateIdLIst   = new List <string>();
                    List <string>   arr_dropList       = new List <string>();
                    for (int i = 0; i < schedulColumnMains.Count; i++)
                    {
                        string str_colMainId = schedulColumnMains[i].ColMainId.ToString();
                        switch (schedulColumnMains[i].Status)
                        {
                        case "1":
                            if (string.IsNullOrEmpty(str_colMainId) || str_colMainId == "0")
                            {
                                string[] arr_insertList = { schedulColumnMains[i].ColName.ConvertSqlCondition(), schedulColumnMains[i].Desciption.ConvertSqlCondition(), schedulColumnMains[i].ColType.ToString() };
                                arr2_insertList.Add(arr_insertList);
                            }
                            else
                            {
                                string[] arr_updateValList = { schedulColumnMains[i].ColName.ConvertSqlCondition(), schedulColumnMains[i].Desciption.ConvertSqlCondition(), schedulColumnMains[i].ColType.ToString() };
                                arr2_updateValList.Add(arr_updateValList);
                                arr_updateIdLIst.Add(str_colMainId);
                            }
                            break;

                        case "-1":
                            if (!string.IsNullOrEmpty(str_colMainId) && str_colMainId != "0")
                            {
                                arr_dropList.Add(str_colMainId);
                            }
                            break;

                        default: break;
                        }
                    }
                    _ICon.InsertSchedulColumnMain(out str_msg, arr2_insertList);
                    _ICon.UpdateSchedulColumnMain(out str_msg, arr2_updateValList, arr_updateIdLIst.ToArray());
                    _ICon.DropSchedulColumnMain(out str_msg, "0", arr_dropList.ToArray());
                    List <SchedulColumnMainModel> _schedulColumnMainModels = _GetData.GetSchedulColumnMain(out str_msg);
                    ViewBag.MainData = _schedulColumnMainModels;
                    List <SchedulColumnTypeModel> _schedulColumnTypeModels = _GetData.GetSchedulColumnType(out str_msg);
                    _schedulColumnTypeModels.Insert(0, new SchedulColumnTypeModel());
                    ViewBag.TypeData = _schedulColumnTypeModels;
                }
                else
                {
                    ViewBag.DetailData = null;
                }
            }
            else
            {
                ViewBag.DetailData = null;
            }
            PartialViewResult x = PartialView("/Views/SchedulItem/Titles.cshtml");

            return(x);
        }