Exemplo n.º 1
0
        public JsonResult AddUpdateNews(SystemNews news)
        {
            //FormCollection form
            DataFornat dataformat = new DataFornat();

            JsonResult result = null;

            try
            {
                news.NewsContent = HttpUtility.UrlDecode(news.NewsContent);
                news.NewsContent = dataformat.ReplaceImageSrc(news.NewsContent, AppConfigHelper.MainSiteUrl);
                BaseResultDto <string> resultDto = new BaseResultDto <string>();
                //添加或者修改
                if (news.Id > 0)
                {
                    //修改
                    resultDto = HttpHelper.CreatHelper().DoPostObject <BaseResultDto <string> >(string.Format("{0}News/Update", this.WebApiUrl), news);
                }
                else
                {
                    news.NewsRealseTime = System.DateTime.Now;
                    news.UserName       = this.UserInfo.UserName;
                    news.UserId         = this.UserInfo.ID;
                    //添加
                    resultDto = HttpHelper.CreatHelper().DoPostObject <BaseResultDto <string> >(string.Format("{0}News/Add", this.WebApiUrl), news);
                }
                result = Json(new { status = resultDto.ErrorCode, message = resultDto.ErrorMsg }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                result = Json(new { status = -1, message = ex.Message }, JsonRequestBehavior.AllowGet);
            }
            return(result);
        }
Exemplo n.º 2
0
        public void MyTestMethod()
        {
            YeePayNotify yeePayNotify = new YeePayNotify();
            YeePay       yeePay       = new YeePay();
            string       xmlStr       = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" +
                                        "<notify>" +
                                        "<requestNo>c81d5f6f03d14a1ab2b1f4ae6f1b335f</requestNo>" +
                                        "<platformNo>10012425968</platformNo>" +
                                        "<bizType>REGISTER</bizType>" +
                                        "<code>1</code>" +
                                        "<message>注册成功</message>" +
                                        "<platformUserNo>cd01</platformUserNo>" +
                                        "</notify>";

            xmlStr = readFile(System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "\\notify.txt");
            string sign = readFile(System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "\\sign.txt");//@"MIIFLQYJKoZIhvcNAQcCoIIFHjCCBRoCAQExCzAJBgUrDgMCGgUAMC8GC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STCxPPUNGQ0EgT3BlcmF0aW9uIENBMixDPUNOP2NlcnRpZmljYXRlUmV2b2NhdGlvbkxpc3Q/YmFzZT9vYmplY3RjbGFzcz1jUkxEaXN0cmlidXRpb25Qb2ludDATBgMqVgEEDBMKeWVlcGF5LmNvbTANBgkqhkiG9w0BAQUFAAOBgQBoIXByRAavrQaQ4blG0X6+n0Z6IOhdhkabLWobkK49l3Fhv2KuUsU+4vNCFa99cDWPKaV+IlNpk29f1i849GXPefAiWMCFggZkJOxUIdJU6gm8OZCEtteCiTq1Z8M6ywktM5Jmm5/y/aYeKSbHNcHMbIbs+BrS6IkZUssl4S1mcTGB4zCB4AIBATA+MCoxCzAJBgNVBAYTAkNOMRswGQYDVQQKExJDRkNBIE9wZXJhdGlvbiBDQTICEF2FbCYInongjsU5cO39BcswCQYFKw4DAhoFADANBgkqhkiG9w0BAQEFAASBgDUircc2OtIL19e0kR3FpNkO+EKRDDTxc15vl3pzs0MQffngdy7D+JcY6bixp/E9aDrrgkxMSLkgPn/YVKmNhyLEdP7cYsEsrbKp0QFesMPSY2E6oBzMSmqFlSaSRmGc4+z3yZpng1VvDF3a8t6Xjy9OWRJGvwTdmcXV5ZSQ1bdw";
            //string url = "http://211.149.204.89:8088/verify";
            //string strHttpPost = yeePay.HttpPost(url, "req=" + xmlStr + "&sign=" + sign);

            DataFornat http = new DataFornat();

            xmlStr = http.UrlEncode(xmlStr);
            sign   = http.UrlEncode(sign);
            string postData = string.Format("sign={0}&notify={1}", sign, xmlStr);
            //string postData = string.Format("url={0}&type=post&sign={1}&notify={2}", "http://211.149.204.89:81/YeePayNotify/Notify", sign, xmlStr);
            //string TestUrl = "http://211.149.204.89:81/TransData.aspx";
            string TestUrl = "http://211.149.204.89:81/YeePayNotify/Notify";
            string dd      = http.HttpPost(TestUrl, postData);
        }
Exemplo n.º 3
0
        public void MyTestMethods()
        {
            string dir = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "//2015-01-151.txt";

            System.IO.StreamReader sr = new StreamReader(dir, System.Text.Encoding.Default);

            string str = sr.ReadToEnd();

            string xml = str;

            string dir2 = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "//2015-01-152.txt";

            System.IO.StreamReader sr2 = new StreamReader(dir2, System.Text.Encoding.Default);

            string sign = sr2.ReadToEnd();


            string url = "http://211.149.204.89:81/YeePayNotify/Notify";


            YeePay yeepay = new YeePay();

            DataFornat df = new DataFornat();

            sign = df.UrlEncode(sign);

            //xml = df.UrlEncode(xml);


            string stringNoty = yeepay.HttpPost(url, "notify=" + xml + "&sign=" + sign);

            stringNoty = stringNoty + "";
        }
Exemplo n.º 4
0
        public JsonResult DelImage(int Id, string imgUrl)
        {
            JsonResult result = null;

            try
            {
                if (Id > 0)
                {
                    RQUpdate <SystemClaims> model        = new RQUpdate <SystemClaims>();
                    SystemClaims            systemClaims = new SystemClaims();
                    systemClaims.ID             = Id;
                    systemClaims.TitleImagePath = "";
                    model.Tag = systemClaims;
                    //更新审核字段数据
                    model.UpdateFileds.AddRange(new string[] {
                        "TitleImagePath"
                    });
                    bool rs = HttpHelper.CreatHelper().DoPostObject <bool>(string.Format("{0}Claims/UpdatePartal", this.WebApiUrl), model);
                }
                try
                {
                    DataFornat dataformat = new DataFornat();
                    string     strPath    = dataformat.GetResovePath(imgUrl);
                    if (System.IO.File.Exists(strPath))
                    {
                        System.IO.File.Delete(strPath);
                    }
                    string strThumbnailFileName = System.IO.Path.GetFullPath(strPath) + "\\64_" + System.IO.Path.GetFileName(strPath);
                    if (System.IO.File.Exists(strThumbnailFileName))
                    {
                        System.IO.File.Delete(strThumbnailFileName);
                    }
                }
                catch (Exception)
                {
                }
                result = Json(new { status = 1, message = "删除成功" }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                result = Json(new { status = -1, message = ex.Message }, JsonRequestBehavior.AllowGet);
            }
            return(result);
        }
Exemplo n.º 5
0
        public JsonResult AddUpdateClaims(SystemClaims systemClaims, int clickType)
        {
            JsonResult result = null;

            try
            {
                Type           type       = systemClaims.GetType();
                PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.GetProperty);
                foreach (var item in properties)
                {
                    if (item.PropertyType == typeof(string) && item.GetValue(systemClaims, null) == null)
                    {
                        item.SetValue(systemClaims, "", null);
                    }
                }
                //操作数据之前  对的补齐和正确性的验证
                //审核通过之类的该状态的调用存储过程 暂时未处理
                //......

                if (clickType == 1)//审核未通过
                {
                    systemClaims.IsApproved       = false;
                    systemClaims.ApproverUserName = this.UserInfo.RealName;
                    systemClaims.ApproverTime     = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                }
                else if (clickType == 2)//审核通过
                {
                    systemClaims.IsApproved       = true;
                    systemClaims.ApproverUserName = this.UserInfo.RealName;
                    systemClaims.ApproverTime     = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                }

                systemClaims.DetailsImages1 = HttpUtility.UrlDecode(systemClaims.DetailsImages1);
                systemClaims.DetailsImages2 = HttpUtility.UrlDecode(systemClaims.DetailsImages2);
                systemClaims.DetailsImages3 = HttpUtility.UrlDecode(systemClaims.DetailsImages3);
                systemClaims.DetailsImages4 = HttpUtility.UrlDecode(systemClaims.DetailsImages4);
                systemClaims.DetailsImages5 = HttpUtility.UrlDecode(systemClaims.DetailsImages5);

                DataFornat dataformat = new DataFornat();
                systemClaims.TitleImagePath = dataformat.ReplaceDomain(systemClaims.TitleImagePath, AppConfigHelper.MainSiteUrl);
                systemClaims.DetailsImages1 = dataformat.ReplaceImageSrc(systemClaims.DetailsImages1, AppConfigHelper.MainSiteUrl);
                systemClaims.DetailsImages2 = dataformat.ReplaceImageSrc(systemClaims.DetailsImages2, AppConfigHelper.MainSiteUrl);
                systemClaims.DetailsImages3 = dataformat.ReplaceImageSrc(systemClaims.DetailsImages3, AppConfigHelper.MainSiteUrl);
                systemClaims.DetailsImages4 = dataformat.ReplaceImageSrc(systemClaims.DetailsImages4, AppConfigHelper.MainSiteUrl);
                systemClaims.DetailsImages5 = dataformat.ReplaceImageSrc(systemClaims.DetailsImages5, AppConfigHelper.MainSiteUrl);



                string           strIcons      = HttpUtility.UrlDecode(systemClaims.Icons);
                List <IconModel> IconModelList = new List <IconModel>();
                string[]         strArr        = strIcons.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
                foreach (var item in strArr)
                {
                    IconModel model   = new IconModel();
                    string[]  strItem = item.Split('^');
                    if (strItem.Length >= 3)
                    {
                        model.IconType    = strItem[0];
                        model.Title       = strItem[1];
                        model.Description = strItem[2];
                        model.StyleName   = strItem[3];
                    }
                    if (strItem.Length >= 4)
                    {
                        model.AtrrCode = strItem[4];
                    }
                    IconModelList.Add(model);
                }
                systemClaims.Icons = IconModelList.ToJsonString <List <IconModel> >();

                //添加或者修改
                BaseResultDto <string> resultDto = new BaseResultDto <string>();
                string message = string.Empty;
                if (systemClaims.ID > 0)
                {
                    #region 修改
                    RQUpdate <SystemClaims> model = new RQUpdate <SystemClaims>();
                    model.Tag = systemClaims;
                    bool rs = false;
                    if (clickType == 0 || clickType == 2)//修改资料
                    {
                        //更新修改的字段数据
                        model.UpdateFileds.AddRange(new string[] {
                            "Title", "TitleImagePath", "LoanAmount", "APR", "LoanPeriod", "SingleAmount",
                            "GuaranteeWay", "RepaymentWat", "InvestmentEndTime", "EarningsStartTime", "PawnSpec",
                            "Icons", "DetailsImages1", "DetailsImages2", "DetailsImages3", "DetailsImages4", "DetailsImages5"
                        });
                        rs = HttpHelper.CreatHelper().DoPostObject <bool>(string.Format("{0}Claims/UpdatePartal", this.WebApiUrl), model);
                    }
                    if (clickType == 2 && rs)
                    {
                        //更新审核字段数据
                        RQAduitApplay aduitApplay = new RQAduitApplay();
                        aduitApplay.ApplyID          = systemClaims.ClaimsApplayID;
                        aduitApplay.ClaimsID         = systemClaims.ID;
                        aduitApplay.ApproverUserName = systemClaims.ApproverUserName;
                        aduitApplay.OperatorUserId   = this.UserInfo.ID;
                        aduitApplay.Succeed          = systemClaims.IsApproved;
                        aduitApplay.IP = this.RequestIP;
                        aduitApplay.OperatorContent = (clickType == 1 ? "审核未通过" : "审核通过");
                        rs = HttpHelper.CreatHelper().DoPostObject <bool>(string.Format("{0}ClaimsApplay/AduitApplayClaims", this.WebApiUrl), aduitApplay);
                    }
                    //修改
                    if (rs)
                    {
                        resultDto.ErrorCode = 1;
                        resultDto.ErrorMsg  = "成功";
                    }
                    else
                    {
                        resultDto.ErrorMsg = "失败";
                    }
                    #endregion
                }
                else
                {
                    systemClaims.PublishTime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    systemClaims.Publisher   = this.UserInfo.RealName;
                    int rs = HttpHelper.CreatHelper().DoPostObject <int>(string.Format("{0}Claims/Add", this.WebApiUrl), systemClaims);
                    //添加
                    if (rs > 0)
                    {
                        resultDto.ErrorCode = 1;
                        resultDto.ErrorMsg  = "成功";
                    }
                    else
                    {
                        resultDto.ErrorMsg = "失败";
                    }
                }
                result = Json(new { status = resultDto.ErrorCode, message = resultDto.ErrorMsg }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                result = Json(new { status = -1, message = ex.Message }, JsonRequestBehavior.AllowGet);
            }
            return(result);
        }
Exemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string        result = string.Empty;
            StringBuilder sbLog  = new StringBuilder();

            try
            {
                if (Request["url"] != null)
                {
                    DataFornat dataFornat     = new DataFornat();
                    string     strUrl         = dataFornat.UrlDecode(Request["url"].ToString());
                    string     strRequestType = Request["type"].ToString();
                    sbLog.AppendFormat("转发类型:{0}\r\n", strRequestType);
                    string strResult             = string.Empty;
                    NameValueCollection nv       = new NameValueCollection();
                    List <string>       datalist = new List <string>();
                    if (strRequestType.ToUpper() == "GET")
                    {
                        nv = Request.QueryString;
                        StringBuilder sbData = new StringBuilder();

                        foreach (string key in nv.Keys)
                        {
                            if (key != "url" && key != "type")
                            {
                                if (key == "sign")
                                {
                                    datalist.Add(key + "=" + dataFornat.UrlEncode(dataFornat.HtmlDiscode(dataFornat.UrlDecode(nv[key]))));
                                }
                                else
                                {
                                    datalist.Add(key + "=" + dataFornat.HtmlDiscode(nv[key]));
                                }
                            }
                        }
                        sbData.AppendFormat("{0}?{1}", strUrl, string.Join("&", datalist.ToArray()));
                        sbLog.AppendFormat("转发数据:{0}\r\n", sbData.ToString());
                        HttpHelper helper = new HttpHelper();
                        result = helper.DoGet(sbData.ToString(), 60);
                    }
                    else if (strRequestType.ToUpper() == "POST")
                    {
                        nv = Request.Form;
                        foreach (string key in nv.Keys)
                        {
                            if (key != "url" && key != "type")
                            {
                                if (key == "sign")
                                {
                                    datalist.Add(key + "=" + dataFornat.UrlEncode(nv[key]));
                                }
                                else if (key == "notify")
                                {
                                    datalist.Add(key + "=" + dataFornat.UrlEncode(nv[key]));
                                }
                                else
                                {
                                    if (key == "req")
                                    {
                                        string aa = dataFornat.HtmlDiscode(nv[key]);
                                        datalist.Add(key + "=" + dataFornat.UrlEncode(aa));
                                    }
                                    else
                                    {
                                        datalist.Add(key + "=" + dataFornat.UrlEncode(dataFornat.HtmlDiscode(nv[key])));
                                    }
                                }
                            }
                        }
                        sbLog.AppendFormat("转发Url:{0}\r\n", strUrl);
                        sbLog.AppendFormat("转发数据:{0}\r\n", string.Join("&", datalist.ToArray()));
                        result = dataFornat.HttpPost(strUrl, string.Join("&", datalist.ToArray()));
                    }
                    sbLog.AppendFormat("返回结果:{0}\r\n", result);
                }
                else
                {
                    sbLog.Append("没有此方法");
                }
            }
            catch (Exception ex)
            {
                sbLog.Append(ex.Message);
            }
            finally
            {
                Log.RecordLog("TransData", sbLog.ToString(), false);
                Response.Write(result);
            }
        }