Пример #1
0
 public string[] UploadPdfsAndGetDocIds(ApiSoapClient ws, string authXml, string[] documentPaths)
 {
     string[] docIds = new string[documentPaths.Length];
     for (int i = 0; i < docIds.Length; i++)
     {
         string docXml = GetDocXml(documentPaths[i]);
         string fileUploadResponseXml      = ws.UploadTemporarySspFile_v1Async(authXml, docXml).GetAwaiter().GetResult();
         SignAnywhereResponse uploadResult = SignAnywhereResponse.parseResponse(fileUploadResponseXml);
         docIds[i] = uploadResult.okInfo.InnerText;
     }
     return(docIds);
 }
Пример #2
0
        public string UpdateImage(HttpContext context)
        {
            var    user   = RequestSession.GetSessionUser();
            string result = "";

            try
            {
                var tag = context.Request["images"];
                if (user != null)
                {
                    string goodspath = ConfigurationManager.AppSettings["ImgUmasMapSrc"] + user.CompanyId + "\\";
                    string Webpath   = ConfigurationManager.AppSettings["ImgUmasWebSrc"] + user.CompanyId + "/";
                    if (!string.IsNullOrEmpty(tag))
                    {
                        string path = Base64ToImage("data:image/jpeg;base64," + tag).Replace("\\", "/");
                        user = RequestSession.GetSessionUser();
                        if (user != null)
                        {
                            using (var db = new UdowsYunPublicEntities())
                            {
                                var id = db.Company.Where(p => p.userId == user.id).ToList();
                                foreach (var vals in id)
                                {
                                    ApiSoapClient a    = new ApiSoapClient();
                                    string        json = a.UploadLicense(vals.id, ImgaeFoByte(path));
                                    ImgTag        it   = JsonConvert.DeserializeObject <ImgTag>(json);
                                    if (it != null)
                                    {
                                        if (it.result == 1)
                                        {
                                            result = "{ \"code\": 0,\"msg\": \"\",\"data\": {\"src\": \"" + Webpath + it.name + "\"}}";
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        result = "{ \"code\": 1,\"msg\": \"\",\"data\": {\"src\": \"\"}}";
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper lh = new LogHelper();
                lh.WriteLog(ex.Message);
                throw;
            }
            return(result);
        }
Пример #3
0
        public string SelInfoList(HttpContext context)
        {
            string result = "";

            try
            {
                var user = RequestSession.GetSessionUser();
                pageNum  = Convert.ToInt32(context.Request["limit"]);
                PageSize = Convert.ToInt32(context.Request["page"]);
                if (user != null)
                {
                    using (var db = new UdowsYunPublicEntities())
                    {
                        string         sql  = @"select * from (select row_number() over (order by id desc) as rn,* from (select a.id,'http://pic03.uz360.cn/UmassWebPageImage/'+b.imgPath as imgPath,c.name as b2bName,a.url,CONVERT(varchar(100), DATEADD(s,a.createTime, '1970-01-01 08:00:00'), 20) as createTime,b.title,'推送成功' as Start,a.b2bId,'' as b2bUrl from SuccessInfo a 
                          left join Info b
                          on a.infoId = b.id
                          left join B2B c
                          on a.b2bId = c.id
                          where a.companyId = " + user.CompanyId + ") t ) t where rn between (" + PageSize + "-1) * " + pageNum + " + 1 and " + PageSize + " * " + pageNum;
                        List <GetInfo> list = db.Database.SqlQuery <GetInfo>(sql).ToList();
                        if (list.Count > 0)
                        {
                            ApiSoapClient a = new ApiSoapClient();
                            foreach (var val in list)
                            {
                                if (val.url.IndexOf('|') > 0)
                                {
                                    val.url = val.url.Substring(0, val.url.IndexOf('|'));
                                }
                                if (val.b2bId == 2 || val.b2bId == 3 || val.b2bId == 5 || val.b2bId == 6 || val.b2bId == 8 || val.b2bId == 10)
                                {
                                    val.b2bUrl = a.GetLoginUrl(Convert.ToInt32(user.CompanyId), val.b2bId);
                                }
                            }
                            result = "{\"code\":0,\"msg\":\"\",\"count\":" + db.SuccessInfo.Count(p => p.companyId == user.CompanyId) + ",\"data\":" + JsonConvert.SerializeObject(list) + "}";
                        }
                        else
                        {
                            result = "{\"code\":0,\"msg\":\"\",\"count\":0,\"data\":\"\"}";
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
            return(result);
        }
Пример #4
0
        public string ImageRequest(HttpContext context)
        {
            string        strResult = "";
            string        img       = "";
            List <object> list      = new List <object>();
            var           user      = RequestSession.GetSessionUser();

            if (user != null)
            {
                string goodspath = ConfigurationManager.AppSettings["ImgUmasMapSrc"] + user.CompanyId;
                if (!Directory.Exists(goodspath))
                {
                    Directory.CreateDirectory(goodspath);
                }
                list = JsonConvert.DeserializeObject <List <object> >(context.Request["images"]);
                for (int i = 0; i < list.Count; i++)
                {
                    var           postedFile = list[i].ToString();
                    string        imgpoth    = Uploads(postedFile);
                    ApiSoapClient a          = new ApiSoapClient();
                    string        json       = a.UploadInfoImg(Convert.ToInt32(user.CompanyId), ImgaeFoByte(imgpoth));
                    ImgTag        it         = JsonConvert.DeserializeObject <ImgTag>(json);
                    if (it != null)
                    {
                        if (it.result == 1)
                        {
                            img += it.name + ",";
                        }
                    }
                }
                strResult = img.Substring(0, img.Length - 1);
            }
            else
            {
                strResult = "";
            }
            return(strResult);
        }
Пример #5
0
 public ApiSoapClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
     base(ApiSoapClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Пример #6
0
 public ApiSoapClient(EndpointConfiguration endpointConfiguration) :
     base(ApiSoapClient.GetBindingForEndpoint(endpointConfiguration), ApiSoapClient.GetEndpointAddress(endpointConfiguration))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }