Exemplo n.º 1
0
        private void LisResultReOperation(DataTable dt) //用来判断进行插入修改操作
        {
            if (dt != null && dt.Rows.Count > 0)
            {
                //先删除,后插入
                DeleteFromLisResultRe(dt.Rows[0]["ybh"].ToString(), dt.Rows[0]["jyrq"].ToString(),
                                      dt.Rows[0]["yq"].ToString(), dt.Rows[0]["yybm"].ToString());

                Form_lisBll form_lisbll = new Form_lisBll();
                form_lisbll.Add(dt, "sql042", true);
            }
        }
Exemplo n.º 2
0
        private bool TjZtOperation(DataTable dtAll, DataRow drs, string jkdah, string sfzh, string ryxm)
        {
            Form_lisBll form_lisbll = new Form_lisBll();
            //查询体检状态
            string tjzt = "1";

            DataRow[] dr_zt = dtAll.Select("xmdh='TJZT' and ybh='" + drs["ybh"].ToString() + "'");
            if (dr_zt != null && dr_zt.Length > 0)
            {
                tjzt = dr_zt[0]["result"].ToString();
            }
            //体检状态信息
            ArrayList TJRYXXList = save_T_JK_TJZT(jkdah, sfzh, ryxm,
                                                  drs["jyrq"].ToString(), TJClient.Common.Common.TJTYPE.健康体检表, TJClient.Common.Common.ZT.确定状态);

            if (TJRYXXList != null && TJRYXXList.Count > 0)
            {
                DBAccess dbaccess = new DBAccess();
                dbaccess.ExecuteNonQueryBySql(TJRYXXList);
            }
            return(true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 更新健康体检表
        /// </summary>
        /// <param name="dt_tjjgUpdate"></param>
        /// <returns></returns>
        public bool Update_jktj(DataTable dt_tjjgUpdate, string JKDAH, string jyrq_tem)
        {
            try
            {
                if (dt_tjjgUpdate == null || dt_tjjgUpdate.Columns.Count == 0 || dt_tjjgUpdate.Rows.Count == 0)
                {
                    return(false);
                }

                if (dt_tjjgUpdate.Columns.Contains("D_GRDABH") == false)
                {
                    DataColumn dtColumn = new DataColumn("D_GRDABH");
                    dtColumn.DefaultValue = JKDAH;
                    dt_tjjgUpdate.Columns.Add(dtColumn);
                }
                if (dt_tjjgUpdate.Columns.Contains("HAPPENTIME") == false)
                {
                    DataColumn dtColumn = new DataColumn("HAPPENTIME");
                    dtColumn.DefaultValue = jyrq_tem;
                    dt_tjjgUpdate.Columns.Add(dtColumn);
                }

                if (dt_tjjgUpdate.Columns.Contains("czy") == false)
                {
                    DataColumn dtColumn = new DataColumn("czy");
                    dtColumn.DefaultValue = UserInfo.userId;
                    dt_tjjgUpdate.Columns.Add(dtColumn);
                }
                if (dt_tjjgUpdate.Columns.Contains("gzz") == false)
                {
                    DataColumn dtColumn = new DataColumn("gzz");
                    dtColumn.DefaultValue = UserInfo.gzz;
                    dt_tjjgUpdate.Columns.Add(dtColumn);
                }

                //体检结果是否已经存在
                string Guid = "";
                //true:新的Guid  false:已经存在的Guid
                bool GuidResult = true;
                GuidResult = getNewGuid(out Guid, JKDAH, jyrq_tem);

                Form_lisBll form_lisbll = new Form_lisBll();
                if (dt_tjjgUpdate.Columns.Contains("guid") == false)
                {
                    DataColumn dtColumn = new DataColumn("guid");
                    dtColumn.DefaultValue = Guid;
                    dt_tjjgUpdate.Columns.Add(dtColumn);
                }

                //体检结果
                if (GuidResult == true)
                {
                    //体检结果插入
                    form_lisbll.Add(dt_tjjgUpdate, "sql047");
                }
                else
                {
                    //体检结果更新
                    dt_tjjgUpdate.AcceptChanges();
                    dt_tjjgUpdate.Rows[0]["guid"] = Guid;
                    form_lisbll.Upd(dt_tjjgUpdate, "sql048");
                }

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取结果
        /// </summary>
        /// <returns></returns>
        public DataTable dataRecive()
        {
            DataTable dt     = null;
            string    errMsg = "";

            try
            {
                if (yqDemo != null)
                {
                    if (yqDemo.IsOpen(out errMsg) == false)
                    {
                        yqDemo.open(out errMsg);
                    }

                    dt = yqDemo.YQDataReturn(DateTime.Now.ToString("yyyy-MM-dd"), out errMsg);
                }
                else
                {
                    if (yqxh.Trim().Length == 0)
                    {
                        timer_lis.Enabled = false;
                        //MessageBox.Show("请选择仪器!");

                        return(null);
                    }

                    if (yqDemo == null)
                    {
                        if (Common.getyqPath(yqxh).Length <= 0)
                        {
                            MessageBox.Show("仪器配置文件不存在!");
                            return(null);
                        }
                        string yqVersion = XmlRW.GetValueFormXML(Common.getyqPath(yqxh), "YQ_Version", "value");

                        yqDemo = LisFactory.LisCreate(yqVersion);
                    }

                    if (yqDemo.IsOpen(out errMsg) == false)
                    {
                        yqDemo.open(out errMsg);
                    }
                    dt = yqDemo.YQDataReturn(DateTime.Now.ToString("yyyy-MM-dd"), out errMsg);
                }

                //将取得的结果保存到数据库中
                if (dt != null)
                {
                    if (!dt.Columns.Contains("yybm"))
                    {
                        DataColumn dtcolumn = new DataColumn("yybm");
                        dtcolumn.DefaultValue = UserInfo.Yybm;
                        dt.Columns.Add(dtcolumn);
                    }

                    if (!dt.Columns.Contains("yq"))
                    {
                        DataColumn dtcolumn = new DataColumn("yq");
                        dtcolumn.DefaultValue = timer_lis;
                        dt.Columns.Add(dtcolumn);
                    }

                    Form_lisBll form_lisbll = new Form_lisBll();

                    form_lisbll.Add(dt, "sql042");
                }
            }
            catch (Exception ex)
            {
                timer_lis.Enabled = false;
                Jktj_lis.msgShow(ex.Message);
            }
            return(dt);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 更新健康体检表
        /// </summary>
        /// <returns></returns>
        public string updateLis_jktj(DataTable dtList_ryxx)
        {
            //没有需要同步的人员
            if (dtList_ryxx == null || dtList_ryxx.Rows.Count == 0)
            {
                return("1");
            }
            try
            {
                Form_lisBll form_lisbll = new Form_lisBll();
                string      JKDAH       = "";
                string      tjsj        = "";
                for (int i = 0; i < dtList_ryxx.Rows.Count; i++)
                {
                    JKDAH = dtList_ryxx.Rows[i]["JKDAH"].ToString();
                    //获取人员的信息(条码号 条码类型)
                    string    sqlWhere   = string.Format(" and  YLJGBM='{0}' and JKDAH='{1}'  and nd='{2}' ", UserInfo.Yybm, JKDAH, DateTime.Now.Year.ToString());
                    DataTable dt_txmList = form_lisbll.GetMoHuList(sqlWhere, "sql_select_people_txm");
                    if (dt_txmList != null && dt_txmList.Rows.Count > 0)
                    {
                        //按照条码号同步lis信息
                        for (int j = 0; j < dt_txmList.Rows.Count; j++)
                        {
                            //按照条码号获取lis检验信息
                            string    sqlWhereLis          = string.Format(" and  testno='{0}' ", dt_txmList.Rows[i]["TXMBH"].ToString());
                            DataTable dt_lis_reqresultList = form_lisbll.GetMoHuList(sqlWhereLis, "sql_select_lis_reqresult");
                            if (dt_lis_reqresultList != null && dt_lis_reqresultList.Rows.Count > 0)
                            {
                                //获取检验项目与健康体检表的项目对应关系
                                string yq = dt_lis_reqresultList.Rows[0]["instrument"].ToString();
                                tjsj = dt_lis_reqresultList.Rows[0]["resulttime"].ToString();
                                string    sqlWhereLisItems = string.Format(" and (YQLX='' or YQLX is null or YQLX='{0}') and YLJGBM='{1}' ", yq, UserInfo.Yybm);
                                DataTable dt_LisItemsList  = form_lisbll.GetMoHuList(sqlWhereLisItems, "sql_select_lis_reqresult");
                                if (dt_LisItemsList != null && dt_LisItemsList.Rows.Count > 0)
                                {
                                    DataTable dt_tjjgUpdate = new DataTable();
                                    dt_tjjgUpdate.Rows.Add();

                                    //获取对应的数据值
                                    for (int k = 0; k < dt_LisItemsList.Rows.Count; k++)
                                    {
                                        //lis结果
                                        for (int m = 0; m < dt_lis_reqresultList.Rows.Count; m++)
                                        {
                                            if (dt_LisItemsList.Rows[k]["XMBM_LIS"].ToString().ToUpper().Equals(dt_lis_reqresultList.Rows[m]["itemno"].ToString().ToUpper()))
                                            {
                                                if (dt_tjjgUpdate.Columns.Contains(dt_LisItemsList.Rows[k]["XMBM"].ToString()) == false)
                                                {
                                                    DataColumn dtColumn = new DataColumn(dt_LisItemsList.Rows[k]["XMBM"].ToString());
                                                    dtColumn.DefaultValue = dt_lis_reqresultList.Rows[m]["testresult"].ToString();
                                                    dt_tjjgUpdate.Columns.Add(dtColumn);
                                                }
                                                else
                                                {
                                                    dt_tjjgUpdate.Rows[dt_tjjgUpdate.Rows.Count - 1][dt_LisItemsList.Rows[k]["XMBM"].ToString()] = dt_lis_reqresultList.Rows[m]["testresult"].ToString();
                                                }
                                                break;
                                            }
                                        }
                                    }
                                    //数据更新到健康体检结果中
                                    Update_jktj(dt_tjjgUpdate, JKDAH, tjsj);
                                }
                            }
                        }
                    }
                }
                return("");
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }