Exemple #1
0
        /// <summary>
        /// 解析病历
        /// </summary>
        /// <param name="str">病历数据</param>
        /// <param name="id">患者ID</param>
        /// <param name="recordName">病历名称</param>
        public void JieXi(string str, string id, string recordName)
        {
            JObject obj = JObject.Parse(str);

            foreach (var x in obj)
            {
                if (x.Key.Equals("Result"))
                {
                    str = x.Value.ToString();
                }
            }
            obj = JObject.Parse(str);
            SqlDAL sql = new SqlDAL();
            List <KeyValuePair <string, string> > field = new List <KeyValuePair <string, string> >();

            if (recordName == null)
            {
                foreach (var x in obj)
                {
                    if (x.Key.Equals("DiagTreatModel") || x.Key.Equals("OutModel"))
                    {
                        continue;
                    }
                    field = new List <KeyValuePair <string, string> >();
                    foreach (var y in (JObject)x.Value)
                    {
                        if (y.Value.ToString() == "")
                        {
                            field.Add(new KeyValuePair <string, string>(y.Key, null));
                        }
                        else
                        {
                            field.Add(new KeyValuePair <string, string>(y.Key, y.Value.ToString()));
                        }
                    }
                    sql.SaveData(field, id, x.Key);//存数数据
                }
            }
            else
            {
                foreach (var x in obj)
                {
                    if (x.Value.ToString() == "")
                    {
                        field.Add(new KeyValuePair <string, string>(x.Key, null));
                    }
                    else
                    {
                        field.Add(new KeyValuePair <string, string>(x.Key, x.Value.ToString()));
                    }
                }
                sql.SaveData(field, id, recordName);//存数数据
            }
        }
Exemple #2
0
        /// <summary>
        /// 存储用户ID
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Btn_Save_Click(object sender, EventArgs e)
        {
            if (PatientList.Count <= 0)
            {
                MessageBox.Show("请先获取所有用户");
            }
            SqlDAL dal = new SqlDAL();

            dal.SaveId(PatientList);
            MessageBox.Show("数据库用户列表已更新");
        }
        public void TestMethod3()
        {
            var builder = new ContainerBuilder();

            builder.RegisterType <DBManager>();
            builder.RegisterType <SqlDAL>().Named <IDAL>("SQL");
            builder.RegisterType <OracleDAL>().Named <IDAL>("ORACLE");
            using (var container = builder.Build())
            {
                SqlDAL    sqlDAL    = (SqlDAL)container.ResolveNamed <IDAL>("SQL");
                OracleDAL oracleDAL = (OracleDAL)container.ResolveNamed <IDAL>("ORACLE");
            }
        }
Exemple #4
0
        /// <summary>
        /// 解析单个患者的病历
        /// </summary>
        /// <param name="str"></param>
        public void JieXiBingLi(string str, string id, bool SaveData)
        {
            JObject obj = JObject.Parse(str);

            foreach (var x in obj)
            {
                if (x.Key.Equals("Result"))
                {
                    str = x.Value.ToString();
                }
            }
            obj = JObject.Parse(str);

            foreach (var x in obj)
            {
                List <KeyValuePair <string, string> > field = new List <KeyValuePair <string, string> >();
                foreach (var y in (JObject)x.Value)
                {
                    if (y.Value.ToString() == "")
                    {
                        field.Add(new KeyValuePair <string, string>(y.Key, null));
                    }
                    else
                    {
                        field.Add(new KeyValuePair <string, string>(y.Key, y.Value.ToString()));
                    }
                }
                SqlDAL sql = new SqlDAL();

                if (SaveData)
                {
                    sql.SaveData(field, id, x.Key);//存数数据
                }
                else
                {
                    sql.SaveField(field, x.Key);//存储字段
                }
            }
        }
Exemple #5
0
 public PlayerUoW(SqlDAL iDAL, IPlayerRepo PlayerRepo)
 {
     _iDAL       = iDAL;
     _playerRepo = PlayerRepo;
 }
 public FighterRepository(SqlDAL SqlDAL)
 {
     _sqlDAL = SqlDAL;
 }