Example #1
0
        public string GetAnnexDataMode(string ConsultID)
        {
            List <AnnexOneVo> _list = new List <AnnexOneVo>();
            string            sql   = "select * from Annex where ConsultID='" + ConsultID + "'";
            DataTable         dt    = op.ExecuteDataTable(sql, CommandType.Text, null);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                AnnexOneVo _AnnexOneVo = new AnnexOneVo();
                _AnnexOneVo.Path = dt.Rows[i]["SerPath"].ToString() + dt.Rows[i]["FilePath"].ToString();
                // _AnnexOneVo.Path = AnnexPath + "\\" + ConsultID + "\\Annex\\" + dt.Rows[i]["AnnexName"].ToString();
                _AnnexOneVo.AnnexName  = dt.Rows[i]["AnnexName"].ToString();
                _AnnexOneVo.ClientPath = dt.Rows[i]["Client_Annex_Path"].ToString();
                _AnnexOneVo.AnnexType  = dt.Rows[i]["AnnexType"].ToString();

                string UncIp       = dt.Rows[i]["UncIp"].ToString();
                string UncUserName = dt.Rows[i]["UncUserName"].ToString();
                string UncPassWord = dt.Rows[i]["UncPassWord"].ToString();
                string UncToken    = "";
                if (UncIp != "" && UncUserName != "" && UncPassWord != "")
                {
                    string Token = "{\"ip\":\"" + UncIp + "\",\"username\":\"" + UncUserName + "\",\"password\":\"" + UncPassWord + "\"}";
                    string val   = ConfigurationManager.AppSettings["UncTokenKey"].ToString();
                    UncToken = Convert.ToBase64String(Des3.Des3EncodeECB(val, Token));
                }

                _AnnexOneVo.UncToken = UncToken;

                string status = "0";
                if (_AnnexOneVo.Path.IndexOf("\\") == 0)
                {
                    IdentityScope iss = new IdentityScope(UncUserName, UncPassWord, UncIp);
                }

                if (_AnnexOneVo.Path.StartsWith("http://"))
                {
                    _AnnexOneVo.Path = _AnnexOneVo.Path.Replace("\\", "/");
                    bool f = IsExist(_AnnexOneVo.Path);
                    if (f == true)
                    {
                        status = "1";
                    }
                }
                else
                {
                    if (File.Exists(_AnnexOneVo.Path))
                    {
                        status = "1";
                    }
                }
                //if (File.Exists(_AnnexOneVo.Path))
                //{
                //    status = "1";
                //}
                _AnnexOneVo.Status = status;
                _list.Add(_AnnexOneVo);
            }
            return(JsonConvert.SerializeObject(_list));
        }
Example #2
0
        public string GetSlideDataMode(string ConsultID)
        {
            List <SlidePathVo> _list = new List <SlidePathVo>();
            string             sql   = "select * from Slide where ConsultID='" + ConsultID + "' order by UpTime,RanSe desc";
            DataTable          dt    = op.ExecuteDataTable(sql, CommandType.Text, null);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                FileInfo    fileInfo     = new FileInfo(dt.Rows[i]["Client_Slide_Path"].ToString());
                SlidePathVo _SlidePathVo = new SlidePathVo();
                _SlidePathVo.Path      = dt.Rows[i]["SerPath"].ToString() + dt.Rows[i]["FilePath"].ToString();
                _SlidePathVo.SlideName = dt.Rows[i]["SlideName"].ToString();
                string ReName = dt.Rows[i]["ReName"].ToString();
                if (ReName.Trim() == "")
                {
                    ReName = dt.Rows[i]["SlideName"].ToString();
                }
                if (!System.IO.File.Exists(_SlidePathVo.Path))
                {
                    if (fileInfo.Extension != ".kfb")
                    {
                        _SlidePathVo.Path = dt.Rows[i]["SerPath"].ToString() + "\\" + ConsultID + "\\Annex\\" + dt.Rows[i]["SlideName"].ToString() + "\\1.mds";
                    }
                }
                _SlidePathVo.ReName     = ReName;
                _SlidePathVo.RanSe      = dt.Rows[i]["RanSe"].ToString();
                _SlidePathVo.CaseNo     = dt.Rows[i]["CaseNo"].ToString();
                _SlidePathVo.ClientPath = dt.Rows[i]["Client_Slide_Path"].ToString();
                string UncIp       = dt.Rows[i]["UncIp"].ToString();
                string UncUserName = dt.Rows[i]["UncUserName"].ToString();
                string UncPassWord = dt.Rows[i]["UncPassWord"].ToString();
                string UncToken    = "";
                if (UncIp != "" && UncUserName != "" && UncPassWord != "")
                {
                    string Token = "{\"ip\":\"" + UncIp + "\",\"username\":\"" + UncUserName + "\",\"password\":\"" + UncPassWord + "\"}";
                    string val   = ConfigurationManager.AppSettings["UncTokenKey"].ToString();
                    UncToken = Convert.ToBase64String(Des3.Des3EncodeECB(val, Token));
                }

                _SlidePathVo.UncToken = UncToken;
                string status = "0";
                if (_SlidePathVo.Path.IndexOf("\\") == 0)
                {
                    IdentityScope iss = new IdentityScope(UncUserName, UncPassWord, UncIp);
                }
                if (_SlidePathVo.Path.StartsWith("http://"))
                {
                    _SlidePathVo.Path = _SlidePathVo.Path.Replace("\\", "/");
                    bool f = IsExist(_SlidePathVo.Path);
                    if (f == true)
                    {
                        status = "1";
                    }
                }
                else
                {
                    if (File.Exists(_SlidePathVo.Path))
                    {
                        status = "1";
                    }
                }
                _SlidePathVo.Status = status;
                _list.Add(_SlidePathVo);
            }
            return(JsonConvert.SerializeObject(_list));
        }