コード例 #1
0
        public Map()
        {
            base.CreateMap <Trainer, TrainerDto>();

            base.CreateMap <Student, StudentDto>().ForMember(
                dest => dest.StudentWeights,
                opt => opt.MapFrom(src => src.StudentWeights));

            base.CreateMap <StudentWeight, StudentWeightDto>()
            .ForMember(
                dest => dest.StudentId,
                opt => opt.MapFrom(src => src.StudentId))
            .ForMember(
                dest => dest.StudentName,
                opt => opt.MapFrom(src => string.Format("{0} {1}", src.Student.FirstName, src.Student.LastName)));

            EnumService enumService = new EnumService();

            base.CreateMap <Lesson, LessonDto>()
            .ForMember(
                dest => dest.StudentName,
                opt => opt.MapFrom(src => string.Format("{0} {1}", src.Student.FirstName, src.Student.LastName)))
            .ForMember(
                dest => dest.TrainerName,
                opt => opt.MapFrom(src => string.Format("{0} {1}", src.Trainer.FirstName, src.Trainer.LastName)))
            .ForMember(
                dest => dest.Money,
                opt => opt.MapFrom(src => src.Student.PrepaidMoney))
            .ForMember(
                dest => dest.HourDescription,
                opt => opt.MapFrom(src => enumService.GetDescription(src.Hour)))
            .ForMember(
                dest => dest.MinutesDescription,
                opt => opt.MapFrom(src => enumService.GetDescription(src.Minutes)));
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: AnCalm/PayClient
        void AddDataGridRows(Order order)
        {
            int index = this.dgOrderCharge.Rows.Add();

            dgOrderCharge.Rows[index].Cells["OrderInsideID"].Value     = order.OrderInsideID;
            dgOrderCharge.Rows[index].Cells["OrderExternalID"].Value   = order.OrderExternalID;
            dgOrderCharge.Rows[index].Cells["ProductName"].Value       = order.ProductName;
            dgOrderCharge.Rows[index].Cells["ProductParValue"].Value   = order.ProductParValue;
            dgOrderCharge.Rows[index].Cells["TargetAccount"].Value     = order.TargetAccount;
            dgOrderCharge.Rows[index].Cells["BuyAmount"].Value         = order.BuyAmount;
            dgOrderCharge.Rows[index].Cells["GameName"].Value          = order.GameName;
            dgOrderCharge.Rows[index].Cells["AreaName"].Value          = order.AreaName;
            dgOrderCharge.Rows[index].Cells["ServerName"].Value        = order.ServerName;
            dgOrderCharge.Rows[index].Cells["StartDatetime"].Value     = order.StartDatetime;
            dgOrderCharge.Rows[index].Cells["RechargeStatus"].Value    = EnumService.GetDescription((int)order.RechargeStatus);
            dgOrderCharge.Rows[index].Cells["SuccessfulAmount"].Value  = order.SuccessfulAmount;
            dgOrderCharge.Rows[index].Cells["RechargeMsg"].Value       = order.RechargeMsg;
            dgOrderCharge.Rows[index].Cells["ChargeAccountInfo"].Value = order.ChargeAccountInfo;
            dgOrderCharge.Rows[index].Cells["EndDatetime"].Value       = order.EndDatetime;

            while (dgOrderCharge.Rows.Count > 20)
            {
                dgOrderCharge.Rows.RemoveAt(0);
            }
        }
コード例 #3
0
 private void InitInfo()
 {
     foreach (KnowledgePointAttrEnum item in Enum.GetValues(typeof(KnowledgePointAttrEnum)))
     {
         ddlAttr.Items.Add(new ListItem(EnumService.GetDescription(item), item.ToString()));
     }
 }
コード例 #4
0
ファイル: QueryXunTong.cs プロジェクト: AnCalm/PayClient
        public Order Query(Order order)
        {
            string MerchantID = PayAndQueryXunTong.merchantID;
            string key        = PayAndQueryXunTong.key;
            string QueryUrl   = PayAndQueryXunTong.QueryUrl;


            CookieContainer coockie = new CookieContainer();

            string username  = MerchantID;          //	接入代理用户名
            string type      = "qb";                //	查询类型(固定:qb)
            string sporderid = order.OrderInsideID; //	SP订单号,商户平台的订单号,最长32位(yyyyMMddHHmmss+8)
            string buyhaoma  = order.TargetAccount; //	要进行查询的号码
            string sign      = "";                  //	MD5组合数字签名方式:MD5(username={}&type={}&sporderid={}&buyhaoma={}&key=APIkey加密串均为小写,MD5输出为32位小写


            string strmd5 = "username="******"&type=" + type + "&sporderid=" + sporderid + "&buyhaoma=" + buyhaoma + "&key=" + key;;

            sign = Md5Helper.MD5Encrypt(strmd5);

            StringBuilder str = new StringBuilder();

            str.AppendFormat("username={0}", username);
            str.AppendFormat("&type={0}", type);
            str.AppendFormat("&sporderid={0}", sporderid);
            str.AppendFormat("&buyhaoma={0}", buyhaoma);
            str.AppendFormat("&sign={0}", sign);


            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " XunTong 订单查询参数:" + str.ToString(), LogPathFile.Recharge.ToString());

            string result = PostAndGet.HttpPostString(QueryUrl, str.ToString(), ref coockie);

            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " XunTong 订单查询:" + result, LogPathFile.Recharge.ToString());

            // 001 充值成功 002 充值失败 003 充值处理中 004,已冲正 005,充正中 006其他情况

            if (result.Equals("001") || result.Equals("004"))
            {
                order.RechargeStatus = (int)OrderRechargeStatus.successful;
                order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.successful);
            }
            else if (result.Equals("002"))
            {
                order.RechargeStatus = (int)OrderRechargeStatus.failure;
                order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.failure);
            }
            else if (result.Equals("003") || result.Equals("005") || result.Equals("006"))
            {
                //充值中
            }
            else
            {
                order.RechargeStatus = (int)OrderRechargeStatus.suspicious;
                order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.suspicious);
            }

            return(order);
        }
コード例 #5
0
ファイル: MyResponse.cs プロジェクト: lyc524/AmbAPI
        /// <summary>
        /// 重写ToString()返回JSON
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            Msg = EnumService.GetDescription(Code);
            //string s = JsonConvert.SerializeObject(this);
            string s = "{\"code\":\"" + (int)Code + "\",\"msg\":\"" + Msg + "\",\"count\":\"" + Count + "\",\"data\":" + Data + "}";

            return(s);
        }
コード例 #6
0
 /// <summary>
 /// 备课阶段
 /// </summary>
 private void InitInfo()
 {
     ddlStage.Items.Add(new ListItem("--请选择--", "-1"));//--请选择--;
     foreach (PrpeLessonStageEnum item in Enum.GetValues(typeof(PrpeLessonStageEnum)))
     {
         ddlStage.Items.Add(new ListItem(EnumService.GetDescription(item), item.ToString()));
     }
 }
コード例 #7
0
ファイル: QueryMBJ.cs プロジェクト: AnCalm/PayClient
        public Order Query(Order order)
        {
            string MerchantID = PayAndQueryMBJ.merchantID;
            string key        = PayAndQueryMBJ.key;
            string QueryUrl   = PayAndQueryMBJ.queryUrl;


            CookieContainer coockie = new CookieContainer();

            string        strmd5 = MerchantID + order.OrderInsideID + key;
            string        sign   = Md5Helper.MD5Encrypt(strmd5);
            StringBuilder str    = new StringBuilder();

            str.AppendFormat("MerchantID={0}", MerchantID);                //商家编号
            str.AppendFormat("&MerchantOrderID={0}", order.OrderInsideID); //商家订单编号
            str.AppendFormat("&Sign={0}", sign);                           //数字签名


            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " MBJ 订单查询参数:" + str.ToString(), LogPathFile.Recharge.ToString());

            string result = PostAndGet.HttpPostString(QueryUrl, str.ToString(), ref coockie);

            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " MBJ 订单查询:" + result, LogPathFile.Recharge.ToString());

            string state        = Regex.Match(result, @"<state>(.*?)</state>").Groups[1].Value;
            string mbjOrderId   = Regex.Match(result, @"<order-id>(.*?)</order-id>").Groups[1].Value;
            string mbjStateInfo = Regex.Match(result, @"<state-info>(.*?)</state-info>").Groups[1].Value;


            if (state.Equals("101"))
            {
                order.RechargeStatus = (int)OrderRechargeStatus.successful;
                order.RechargeMsg    = mbjStateInfo + "-" + mbjOrderId;
            }
            else if (state.Equals("201") || state.Equals("202") || state.Equals("203") || state.Equals("301") || state.Equals("302") || state.Equals("304") ||
                     state.Equals("305") || state.Equals("306") || state.Equals("307") || state.Equals("401") || state.Equals("405") || state.Equals("501"))
            {
                order.RechargeStatus = (int)OrderRechargeStatus.failure;
                order.RechargeMsg    = mbjStateInfo + "-" + mbjOrderId;
            }
            else if (state.Equals("601"))
            {
                int status = getOrderStatus(mbjStateInfo, "601");
                order.RechargeStatus = status;
                order.RechargeMsg    = mbjStateInfo + "-" + mbjOrderId;
            }
            else if (state.Equals("102"))
            {//充值中
            }
            else
            {
                order.RechargeStatus = (int)OrderRechargeStatus.suspicious;
                order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.suspicious) + "-" + mbjOrderId;
            }


            return(order);
        }
コード例 #8
0
 public static string GetDataList(string TabName, string TabType, int PageIndex, int PageSize)
 {
     try
     {
         TabName = TabName.Filter();
         TabType = TabType.Filter();
         string strWhere = " 1=1 ";
         if (!string.IsNullOrEmpty(TabName))
         {
             strWhere += string.Format(" and (TabName like '%{0}%' or Tabindex like '%{0}%') ", TabName);
         }
         if (!string.IsNullOrEmpty(TabType))
         {
             strWhere += string.Format(" and TabType='{0}' ", TabType);
         }
         int           intRecordCount = 0;
         List <object> listReturn     = new List <object>();
         BLL_ClientTab bll            = new BLL_ClientTab();
         DataTable     dt             = bll.GetListByPage(strWhere, "TabType,CreateTime", ((PageIndex - 1) * PageSize + 1), PageIndex * PageSize).Tables[0];
         intRecordCount = bll.GetRecordCount(strWhere);
         foreach (DataRow item in dt.Rows)
         {
             listReturn.Add(new
             {
                 Tabindex   = item["Tabindex"].ToString(),
                 TabName    = item["TabName"].ToString(),
                 TabType    = EnumService.GetDescription <Rc.Model.Resources.ClientTabTypeEnum>(item["TabType"].ToString()),
                 CreateTime = pfunction.ConvertToLongDateTime(item["CreateTime"].ToString())
             });
         }
         if (dt.Rows.Count > 0)
         {
             return(JsonConvert.SerializeObject(new
             {
                 err = "null",
                 PageIndex = PageIndex,
                 PageSize = PageSize,
                 TotalCount = intRecordCount,
                 list = listReturn
             }));
         }
         else
         {
             return(JsonConvert.SerializeObject(new
             {
                 err = "暂无数据"
             }));
         }
     }
     catch (Exception ex)
     {
         return(JsonConvert.SerializeObject(new
         {
             err = "error"
         }));
     }
 }
コード例 #9
0
        public Order Query(Order order)
        {
            PayAndQueryFulu pay1 = new PayAndQueryFulu();

            string result = pay1.QueryOrder(order);

            // 直充商品:
            //{
            //    "code": 0,
            //    "message": "接口调用成功",
            //    "result": "{\"area\":\"电信一区\",\"buy_num\":1,\"cards\":null,\"charge_account\":\"888888\",\"create_time\":\"2019-07-01 17:53:32\",\"customer_order_no\":\"201906281030191013526\",\"finish_time\":\"2019-07-01 17:53:41\",\"operator_serial_number\":\"--\",\"order_id\":\"19070134869845421753\",\"order_price\":40.0,\"order_state\":\"success\",\"order_type\":4,\"product_id\":10000373,\"product_name\":\"qb5测试代充账号功能\",\"server\":\"逐鹿中原\",\"type\":\"Q币\"}",
            //    "sign": "06f351b34d9b02bc13bc62e66bdab2c8"
            //}
            //卡密商品:
            //{
            //    "code": 0,
            //    "message": "接口调用成功",
            //    "result": "{\"area\":null,\"buy_num\":2,\"cards\":[{\"CardNumber\":\"12nCp6X/nALmrvr1erxK+D4L8n/kqz/RItKWUfvZrCU=\",\"CardPwd\":\"9HeOgdv+NpLihh2+5Gm0Mj4L8n/kqz/RItKWUfvZrCU=\",\"CardDeadline\":\"2019-06-30 11:15:32\"},{\"CardNumber\":\"12nCp6X/nALmrvr1erxK+BzfvN8D1qbXOYunJrydEWA\",\"CardPwd\":\"9HeOgdv+NpLihh2+5Gm0MhzfvN8D1qbXOYunJrydEWA=\",\"CardDeadline\":\"2019-06-30 11:15:32\"}],\"charge_account\":null,\"create_time\":\"2019-07-01 17:55:38\",\"customer_order_no\":\"201906281230191013521\",\"finish_time\":\"2019-07-01 17:55:41\",\"operator_serial_number\":\"\",\"order_id\":\"19070116656844081755\",\"order_price\":8.9999,\"order_state\":\"success\",\"order_type\":3,\"product_id\":10000481,\"product_name\":\"入库出库专用卡密库存不要随便使用-jfs\",\"server\":null,\"type\":null}",
            //    "sign": "d440344a46479d3fa61883bcc2f1d983"
            //}
            JavaScriptObject jsonObj = (JavaScriptObject)JavaScriptConvert.DeserializeObject(result);

            string code    = jsonObj["code"].ToString();
            string message = jsonObj["message"].ToString();

            string resultJson = jsonObj["result"].ToString();

            JavaScriptObject jsonObj2    = (JavaScriptObject)JavaScriptConvert.DeserializeObject(resultJson);
            string           order_id    = jsonObj2["order_id"].ToString();
            string           order_state = jsonObj2["order_state"].ToString();

            //订单状态: (success:成功,processing:处理中,failed:失败,untreated:未处理)

            switch (order_state)
            {
            case "success":
                order.RechargeStatus = (int)OrderRechargeStatus.successful;
                order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.successful) + "-" + order_state;
                return(order);

            case "failed":

                order.RechargeStatus = (int)OrderRechargeStatus.failure;

                order.RechargeMsg = EnumService.GetDescription(OrderRechargeStatus.failure) + "-" + order_state;
                return(order);

            case "processing":
            case "untreated":
            default:
                break;
            }

            return(order);
        }
コード例 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string key = "duZBIBf3XTNXcBw9VY5K6zMVxTAKBjNn";

            string client_order_no  = Request["client_order_no"];  //	商户订单号	是	32
            string up_order_no      = Request["up_order_no"];      //	充值平台订单号	是	32
            string product_type     = Request["product_type"];     //	产品类型	        是	10
            string phone_no         = Request["phone_no"];         //	充值号码	是	20
            string deduction_amount = Request["deduction_amount"]; //	折扣金额	是	20
            string recharge_status  = Request["recharge_status"];  //	2:充值成功 6:充值失败	是	10
            string elecardID        = Request["elecardID"];        //	运营商充值凭证	否	128
            string desc             = Request["desc"];             //	失败描述(该字段不参与签名)使用UTF-8 URLDECODE编码	否	256
            string channel_type     = Request["channel_type"];     //	渠道编码(该字段不参与签名)参考附录8	否	10
            string sign             = Request["sign"];             //	数据签名	是	32



            WriteLog.Write("方法:ZhiXin回调,client_order_no:" + client_order_no + " up_order_no:" + up_order_no +
                           "recharge_status:" + recharge_status, LogPathFile.Other.ToString());

            string md5str = "client_order_no" + client_order_no + "deduction_amount" + deduction_amount + "elecardID" + elecardID + "phone_no" + phone_no + "product_type" + product_type + "recharge_status" + recharge_status + "up_order_no" + up_order_no + key;

            string checkSign = Md5Helper.MD5Encrypt(md5str);

            if (sign == checkSign)
            {
                int    RechargeStatus = (int)OrderRechargeStatus.processing;
                string RechargeMsg    = string.Empty;

                if (recharge_status.Equals("2"))
                {
                    RechargeStatus = (int)OrderRechargeStatus.successful;
                    RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.successful);
                }
                else if (recharge_status.Equals("6"))
                {
                    RechargeStatus = (int)OrderRechargeStatus.failure;
                    RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.failure);
                }
                else
                {//充值中
                }

                new SQLOrder().UpdateNotifyOrderBySql(client_order_no, RechargeStatus, RechargeMsg);
            }
            else
            {
                WriteLog.Write("方法:ZhiXin回调 本地系统订单号:" + client_order_no +
                               "签名验证错误,ZhiXin数字签名" + sign + "本地签名:" + checkSign, LogPathFile.Other.ToString());
            }


            Response.Write("SUCCESS");
        }
コード例 #11
0
 private void InitInfo()
 {
     foreach (TestQuestions_Type item in Enum.GetValues(typeof(TestQuestions_Type)))
     {
         ddlTestQuestions_Type.Items.Add(new ListItem(EnumService.GetDescription(item), item.ToString()));
     }
     //foreach (ComplexityText item in Enum.GetValues(typeof(ComplexityText)))
     //{
     //    ddlComplexityText.Items.Add(new ListItem(EnumService.GetDescription(item), item.ToString()));
     //}
 }
コード例 #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     strPath   = Request.Url.ToString();
     Module_Id = "90500500";
     if (!IsPostBack)
     {
         ddlTabType.Items.Add(new ListItem("Tab类型", ""));
         foreach (var item in Enum.GetValues(typeof(Rc.Model.Resources.ClientTabTypeEnum)))
         {
             ddlTabType.Items.Add(new ListItem(EnumService.GetDescription <Rc.Model.Resources.ClientTabTypeEnum>(item.ToString()), item.ToString()));
         }
     }
 }
コード例 #13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AudioVideoBookId = Request.QueryString["AudioVideoBookId"];
     BookName         = Server.UrlDecode(Request.QueryString["BookName"]);
     if (!IsPostBack)
     {
         ddlAudioVideoTypeEnum.Items.Add(new ListItem("--视频类型--", "-1"));
         foreach (var item in Enum.GetValues(typeof(Rc.Model.Resources.AudioVideoTypeEnum)))
         {
             ddlAudioVideoTypeEnum.Items.Add(new ListItem(EnumService.GetDescription <Rc.Model.Resources.AudioVideoTypeEnum>(item.ToString()), item.ToString()));
         }
     }
 }
コード例 #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string key = "8af8ef3102bd5361ce69a7c12989a4dd";


            string ste   = Request["ste"];   //	订单状态	必选	String	是	订单状态0为成功,1为失败
            string cid   = Request["cid"];   //	商家ID	必选	String	是	商家在我们系统注册的ID
            string oid   = Request["oid"];   //	商家订单号	必选	String	是	商家系统生成的ID
            string pn    = Request["pn"];    //	充值帐号	必选	String	是	充值帐号
            string sign  = Request["sign"];  //	MD5签名	必选	String	是	原串拼接规则:ste+cid+oid+pn+key 例:0+test+101447975+123456+test
            string info1 = Request["info1"]; //	商家自定义	必选	String	否	可选参数,原样返回(下单商品为卡密商品类型时,这个字段将存放卡密,提取时需用标准3DES解密算法解Decrypt(info1,key)
            string info2 = Request["info2"]; //	商家自定义	必选	String	否	可选参数,原样返回


            WriteLog.Write("方法:RuiLian回调,OrderID:" + oid + " cid:" + cid +
                           "State:" + ste, LogPathFile.Other.ToString());

            string md5str = ste + cid + oid + pn + key;

            string checkSign = Md5Helper.MD5Encrypt(md5str);

            if (sign == checkSign)
            {
                int    RechargeStatus = (int)OrderRechargeStatus.processing;
                string RechargeMsg    = string.Empty;

                if (ste.Equals("1"))
                {
                    RechargeStatus = (int)OrderRechargeStatus.successful;
                    RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.successful);
                }
                else if (ste.Equals("2"))
                {
                    RechargeStatus = (int)OrderRechargeStatus.failure;
                    RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.failure);
                }
                else
                {//充值中
                }

                new SQLOrder().UpdateNotifyOrderBySql(oid, RechargeStatus, RechargeMsg);
            }
            else
            {
                WriteLog.Write("方法:RuiLian回调 本地系统订单号:" + oid +
                               "签名验证错误,Kamen数字签名" + sign + "本地签名:" + checkSign, LogPathFile.Other.ToString());
            }


            Response.Write("success");
        }
コード例 #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string key = "427ee21dec9b49779f2cde44c4c04607";

            string businessId       = Request["businessId"];       //商户号 由平台分配每个商户唯一的一个商户号
            string userOrderId      = Request["userOrderId"];      //	商户订单号(流水号) 最大长度不超过32位的唯一流水号
            string status           = Request["status"];           //	充值结果 01  成功  02 失败
            string mes              = Request["mes"];              //	结果说明 对充值的结果予以说明,特别是充值失败的时候需要对具体充值失败原因简单说明一下
            string kmInfo           = Request["kmInfo"];           //	卡密信息 json字符串数组,格式为[{“cardNo” : “1234567”,”cardPwd” : “7654321”,”outDate”:”2015-12-29”},{“cardNo” : “1234567”,”cardPwd” : “7654321” ,”outDate”:”2015-12-29”}],密码要加密(采用3DES加密方式)
            string payoffPriceTotal = Request["payoffPriceTotal"]; //	结算总金额 系统和进货平台结算金额
            string sign             = Request["sign"];             //	签名 case(md5(businessId + userOrderId + status +密钥))


            WriteLog.Write("方法:PanSuo回调,userOrderId:" + userOrderId + " status:" + status +
                           "mes:" + mes, LogPathFile.Other.ToString());

            string md5str = businessId + userOrderId + status + key;

            string checkSign = Md5Helper.MD5Encrypt(md5str);

            if (sign == checkSign)
            {
                int    RechargeStatus = (int)OrderRechargeStatus.processing;
                string RechargeMsg    = string.Empty;

                if (status.Equals("01"))
                {
                    RechargeStatus = (int)OrderRechargeStatus.successful;
                    RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.successful);
                }
                else if (status.Equals("02"))
                {
                    RechargeStatus = (int)OrderRechargeStatus.failure;
                    RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.failure);
                }
                else
                {//充值中
                }

                new SQLOrder().UpdateNotifyOrderBySql(userOrderId, RechargeStatus, RechargeMsg);
            }
            else
            {
                WriteLog.Write("方法:PanSuo回调 本地系统订单号:" + userOrderId +
                               "签名验证错误,PanSuo数字签名" + sign + "本地签名:" + checkSign, LogPathFile.Other.ToString());
            }


            Response.Write("<receive>ok</receive>");
        }
コード例 #16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     SchoolIF_Id = Request.QueryString["SchoolIF_Id"].ToString().Filter();
     if (!IsPostBack)
     {
         foreach (var item in Enum.GetValues(typeof(Rc.Model.Resources.ThirdPartyEnum)))
         {
             ddlSchoolIF_Code.Items.Add(new ListItem(EnumService.GetDescription <Rc.Model.Resources.ThirdPartyEnum>(item.ToString()), item.ToString()));
         }
         if (!string.IsNullOrEmpty(SchoolIF_Id))
         {
             loadData();
         }
     }
 }
コード例 #17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     tId = Request.QueryString["tId"].ToString().Filter();
     if (!IsPostBack)
     {
         //类型
         foreach (var item in Enum.GetValues(typeof(Rc.Model.Resources.CustomizeHtmlTypeEnum)))
         {
             ddlSType.Items.Add(new ListItem(EnumService.GetDescription <Rc.Model.Resources.CustomizeHtmlTypeEnum>(item.ToString()), item.ToString()));
         }
         if (!string.IsNullOrEmpty(tId))
         {
             loadData();
         }
     }
 }
コード例 #18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ConfigEnum = Request.QueryString["ConfigEnum"].ToString().Filter();
     litIp.Text = Rc.Cloud.Web.Common.pfunction.GetRealIP();;
     if (!IsPostBack)
     {
         foreach (var item in Enum.GetValues(typeof(Rc.Model.Resources.ConfigSchoolTypeEnum)))
         {
             ddlDType.Items.Add(new ListItem(EnumService.GetDescription <Rc.Model.Resources.ConfigSchoolTypeEnum>(item.ToString()), item.ToString()));
         }
         if (!string.IsNullOrEmpty(ConfigEnum))
         {
             loadData();
         }
     }
 }
コード例 #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string key = "ef61aa43fbcd42ab9ccc69722eba5698";

            string username  = Request["username"];  //	接入代理用户名
            string result    = Request["result"];    //	充值结果:success 成功,fail 失败 ,其他结果为未知需要人工核查
            string orderid   = Request["orderid"];   //	平台订单号
            string sporderid = Request["sporderid"]; //	SP订单号,商户平台的订单号
            string sign      = Request["sign"];      //	MD5组合数字签名方式:MD5(username={}&orderid={}&sporderid={}&result={}&key=APIkey)加密串均为小写,MD5输出为32位小写

            WriteLog.Write("方法:XunTong回调,sporderid:" + sporderid + " orderid:" + orderid +
                           "result:" + result, LogPathFile.Other.ToString());

            string md5str = "username="******"&orderid=" + orderid + "&sporderid=" + sporderid + "&result=" + result + "&key=" + key;

            string checkSign = Md5Helper.MD5Encrypt(md5str);

            if (sign == checkSign)
            {
                int    RechargeStatus = (int)OrderRechargeStatus.processing;
                string RechargeMsg    = string.Empty;

                if (result.Equals("success"))
                {
                    RechargeStatus = (int)OrderRechargeStatus.successful;
                    RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.successful);
                }
                else if (result.Equals("fail"))
                {
                    RechargeStatus = (int)OrderRechargeStatus.failure;
                    RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.failure);
                }
                else
                {//充值中
                }

                new SQLOrder().UpdateNotifyOrderBySql(sporderid, RechargeStatus, RechargeMsg);
            }
            else
            {
                WriteLog.Write("方法:XunTong回调 本地系统订单号:" + sporderid +
                               "签名验证错误,Xuntong数字签名" + sign + "本地签名:" + checkSign, LogPathFile.Other.ToString());
            }


            Response.Write("ok");
        }
コード例 #20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AudioVideoIntroId = Request.QueryString["AudioVideoIntroId"].ToString().Filter();
     AudioVideoBookId  = Request.QueryString["AudioVideoBookId"].ToString().Filter();
     if (!IsPostBack)
     {
         ddlAudioVideoTypeEnum.Items.Add(new ListItem("--请选择--", "-1"));
         foreach (var item in Enum.GetValues(typeof(Rc.Model.Resources.AudioVideoTypeEnum)))
         {
             ddlAudioVideoTypeEnum.Items.Add(new ListItem(EnumService.GetDescription <Rc.Model.Resources.AudioVideoTypeEnum>(item.ToString()), item.ToString()));
         }
         if (!string.IsNullOrEmpty(AudioVideoIntroId))
         {
             loadData();
         }
     }
 }
コード例 #21
0
ファイル: MainForm.cs プロジェクト: AnCalm/PayClient
        void AssignmentDatagirdView(Order order)
        {
            try
            {
                this.BeginInvoke(new System.Threading.ThreadStart(delegate()
                {
                    bool isNew = true;
                    foreach (DataGridViewRow item in dgOrderCharge.Rows)
                    {
                        if (dgOrderCharge.Rows[item.Index].Cells["OrderInsideID"].Value.Equals(order.OrderInsideID))
                        {
                            isNew = false;
                            dgOrderCharge.Rows[item.Index].Cells["RechargeStatus"].Value    = EnumService.GetDescription((int)order.RechargeStatus);
                            dgOrderCharge.Rows[item.Index].Cells["SuccessfulAmount"].Value  = order.SuccessfulAmount;
                            dgOrderCharge.Rows[item.Index].Cells["RechargeMsg"].Value       = order.RechargeMsg;
                            dgOrderCharge.Rows[item.Index].Cells["ChargeAccountInfo"].Value = order.ChargeAccountInfo;
                            dgOrderCharge.Rows[item.Index].Cells["EndDatetime"].Value       = order.EndDatetime;

                            SetGirdRowColor(item);
                            break;
                        }
                    }

                    if (isNew)
                    {
                        AddDataGridRows(order);
                    }
                    Application.DoEvents();
                }));
            }
            catch (Exception)
            {
                throw;
            }
            //if (this.InvokeRequired)
            //{
            //    this.Invoke(new DelAssignmentDatagirdView(AssignmentDatagirdView), new object[] { order });
            //}
            //else
            //{
            //    try
            //    {
            //        bool isNew = true;
            //        foreach (DataGridViewRow item in dgOrderCharge.Rows)
            //        {
            //            if (dgOrderCharge.Rows[item.Index].Cells["OrderInsideID"].Value.Equals(order.OrderInsideID))
            //            {
            //                isNew = false;
            //                dgOrderCharge.Rows[item.Index].Cells["RechargeStatus"].Value = EnumService.GetDescription((int)order.RechargeStatus);
            //                dgOrderCharge.Rows[item.Index].Cells["SuccessfulAmount"].Value = order.SuccessfulAmount;
            //                dgOrderCharge.Rows[item.Index].Cells["RechargeMsg"].Value = order.RechargeMsg;
            //                dgOrderCharge.Rows[item.Index].Cells["ChargeAccountInfo"].Value = order.ChargeAccountInfo;
            //                dgOrderCharge.Rows[item.Index].Cells["EndDatetime"].Value = order.EndDatetime;

            //                SetGirdRowColor(item);
            //                break;
            //            }
            //        }

            //        if (isNew)
            //        {
            //            AddDataGridRows(order);
            //        }

            //        Application.DoEvents();
            //    }
            //    catch (Exception)
            //    {
            //        throw;
            //    }
            //}
        }
コード例 #22
0
        public Order Query(Order order)
        {
            string MerchantID = PayAndQueryZhiXin.merchantID;
            string key        = PayAndQueryZhiXin.key;
            string QueryUrl   = PayAndQueryZhiXin.QueryUrl;


            CookieContainer coockie = new CookieContainer();

            string dateStr = DateTime.Now.ToString("yyyyMMddHHmmss");

            string mrch_no         = MerchantID;          //		商户编号	商户代号	是	20
            string request_time    = dateStr;             //	请求时间	格式:yyyyMMddHHmmss	是	14
            string client_order_no = order.OrderInsideID; //		商户订单号		是	32
            string order_time      = dateStr;             //		订单下单时间:yyyyMMddHHmmss
            //注意:
            //1. 充值平台从order_time字段截取订单日期T(yyyyMMdd),查询该日期的订单数据。若无订单,则尝试查询(T-1)及(T+1)日期的订单数据。
            //2. 仅提供近3个月的订单数据	是	14
            string sign = MerchantID;//		签名数据	数据签名	是	32



            string strmd5 = "client_order_no" + client_order_no + "mrch_no" + mrch_no + "order_time" + order_time + "request_time" + request_time + key;

            sign = Md5Helper.MD5Encrypt(strmd5);

            string json = "{\"mrch_no\":\"" + mrch_no + "\",\"request_time\":\"" + request_time + "\",\"client_order_no\":\"" + client_order_no + "\",\"order_time\":\"" + order_time + "\",\"sign\":\"" + sign + "\"}";

            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " ZhiXin 订单查询参数:" + json, LogPathFile.Recharge.ToString());

            string result = PostAndGet.HttpPostString_utf8(QueryUrl, json, ref coockie);

            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " ZhiXin 订单查询:" + result, LogPathFile.Recharge.ToString());

            // 1:充值中 2:充值成功 6:充值失败

            string code            = Regex.Match(result, @"""code"":""(.*?)""").Groups[1].Value;
            string up_order_no     = Regex.Match(result, @"""up_order_no"":""(.*?)""").Groups[1].Value;
            string recharge_status = Regex.Match(result, @"""recharge_status"":""(.*?)""").Groups[1].Value;
            string desc            = Regex.Match(result, @"""desc"":""(.*?)""").Groups[1].Value;
            string message         = Regex.Match(result, @"""message"":""(.*?)""").Groups[1].Value;

            if (code == "2")
            {
                if (recharge_status == "2")
                {
                    order.RechargeStatus = (int)OrderRechargeStatus.successful;
                    order.RechargeMsg    = desc + up_order_no;
                }
                else if (recharge_status == "6")
                {
                    order.RechargeStatus = (int)OrderRechargeStatus.failure;
                    order.RechargeMsg    = desc + up_order_no;
                }
                else if (recharge_status == "1")
                {
                    //充值中
                }
            }
            else if (code == "600" || code == "602" || code == "603" || code == "606" || code == "622" ||
                     code == "623" || code == "624" || code == "615" || code == "637" || code == "715")
            {
                order.RechargeStatus = (int)OrderRechargeStatus.failure;
                order.RechargeMsg    = message + up_order_no;
            }
            else
            {
                order.RechargeStatus = (int)OrderRechargeStatus.suspicious;
                order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.suspicious);
            }

            #region Code
            //2	操作成功	预受理	提交成功,订单充值中
            //600	商户禁用,接口已关闭	预受理	失败
            //602	订单提交失败,未充值	预受理	失败
            //603	请求数据格式错误	预受理	失败
            //606	数据签名错误	预受理	失败
            //622	商户不存在	预受理	失败
            //623	通道维护	预受理	失败
            //624	产品未配置	预受理	失败
            //615	号码归属地未配置	预受理	失败
            //637	流量充值未配置	预受理	失败
            //751	IP地址限制	预受理	失败
            //625	重复订单号	预受理	存疑
            //查询订单状态或人工核实
            //其他返回码	网络问题导致提交异常或其他返回码	预受理	存疑
            //查询订单状态或人工核实
            #endregion

            #region recharge_status
            //2	操作成功	订单状态查询	操作成功,根据recharge_status判定订单状态
            //recharge_status:1,充值中
            //recharge_status:2,充值成功
            //recharge_status:6,充值失败
            //626	未查询到订单信息	订单状态查询	1.	请检查order_time(订单下单时间)字段是否准确,该字段影响订单查询结果。
            //                                  2.	在订单提交10分钟后,订单查询接口仍未查询到订单信息,订单可作失败处理
            //603	请求数据不正确或查询异常	订单状态查询	再次查询或人工核实。若返回该状态码,不能做订单失败处理。
            #endregion

            return(order);
        }
コード例 #23
0
ファイル: QueryPanSuo.cs プロジェクト: AnCalm/PayClient
        public Order Query(Order order)
        {
            string MerchantID = PayAndQueryPanSuo.merchantID;
            string key        = PayAndQueryPanSuo.key;
            string QueryUrl   = PayAndQueryPanSuo.QueryUrl;


            CookieContainer coockie = new CookieContainer();


            string businessId       = MerchantID;                                           // 商户号	由SUP系统分配每个商户唯一的一个商户号
            string userOrderId      = order.OrderInsideID;                                  //	商户订单号(流水号)	最大长度不超过32位的唯一流水号
            string payoffPriceTotal = (order.BuyAmount * order.ProductParValue).ToString(); //结算总金额	系统和进货平台结算金额
            string sign             = "";                                                   //签名 case(md5(businessId + userOrderId +key)) MD5加密后小写


            string strmd5 = businessId + userOrderId + key;

            sign = Md5Helper.MD5Encrypt(strmd5);

            StringBuilder str = new StringBuilder();

            str.AppendFormat("businessId={0}", businessId);
            str.AppendFormat("&userOrderId={0}", userOrderId);
            str.AppendFormat("&payoffPriceTotal={0}", payoffPriceTotal);
            str.AppendFormat("&sign={0}", sign);


            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " PanSuo 订单查询参数:" + str.ToString(), LogPathFile.Recharge.ToString());

            string result = PostAndGet.HttpPostString(QueryUrl, str.ToString(), ref coockie);

            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " PanSuo 订单查询:" + result, LogPathFile.Recharge.ToString());

            //01	成功(订单最终状态)
            //02	失败(订单最终状态)
            //03	处理中(需要等待异步通知结果)
            //04	订单不存在
            //05	未知错误
            //06	签名错误
            //07	参数有误


            string state = Regex.Match(result, @"<result>(.*?)</result>").Groups[1].Value;
            string msg   = Regex.Match(result, @"<mes>(.*?)</mes>").Groups[1].Value;

            if (state.Equals("01"))
            {
                order.RechargeStatus = (int)OrderRechargeStatus.successful;
                order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.successful);
            }
            else if (result.Equals("02") || result.Equals("04") || result.Equals("06"))
            {
                order.RechargeStatus = (int)OrderRechargeStatus.failure;
                if (string.IsNullOrEmpty(msg))
                {
                    order.RechargeMsg = EnumService.GetDescription(OrderRechargeStatus.failure);
                }
                else
                {
                    order.RechargeMsg = msg;
                }
            }
            else if (result.Equals("03"))
            {
                //充值中
            }
            else
            {
                order.RechargeStatus = (int)OrderRechargeStatus.suspicious;
                order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.suspicious);
            }

            return(order);
        }
コード例 #24
0
        public MagicTab(MagicSchool school)
        {
            TabButton.LibraryFile = LibraryFile.Interface;
            TabButton.Hint        = EnumService.GetDescription(school);
            Border = true;

            switch (school)
            {
            case MagicSchool.Passive:
                TabButton.Index = 54;
                break;

            case MagicSchool.WeaponSkills:
                TabButton.Index = 65;
                break;

            case MagicSchool.Neutral:
                TabButton.Index = 64;
                break;

            case MagicSchool.Fire:
                TabButton.Index = 56;
                break;

            case MagicSchool.Ice:
                TabButton.Index = 57;
                break;

            case MagicSchool.Lightning:
                TabButton.Index = 58;
                break;

            case MagicSchool.Wind:
                TabButton.Index = 59;
                break;

            case MagicSchool.Holy:
                TabButton.Index = 61;
                break;

            case MagicSchool.Dark:
                TabButton.Index = 62;
                break;

            case MagicSchool.Phantom:
                TabButton.Index = 60;
                break;

            case MagicSchool.Combat:
                TabButton.Index = 66;
                break;

            case MagicSchool.Assassination:
                TabButton.Index = 67;
                break;

            case MagicSchool.None:
                TabButton.Index = 55;
                break;
            }

            ScrollBar = new DXVScrollBar
            {
                Parent = this,
            };
            ScrollBar.ValueChanged += (o, e) => UpdateLocations();
        }
コード例 #25
0
ファイル: QuerySW.cs プロジェクト: AnCalm/PayClient
        public Order Query(Order order)
        {
            string MerchantID = PayAndQuerySW.merchantID;
            string key        = PayAndQuerySW.key;
            string QueryUrl   = PayAndQuerySW.QueryUrl;

            CookieContainer coockie = new CookieContainer();

            string        strmd5 = MerchantID + order.OrderInsideID + key;
            string        sign   = Md5Helper.MD5Encrypt(strmd5);
            StringBuilder str    = new StringBuilder();

            str.AppendFormat("MerchantID={0}", MerchantID);                //商家编号
            str.AppendFormat("&MerchantOrderID={0}", order.OrderInsideID); //商家订单编号
            str.AppendFormat("&Sign={0}", sign);                           //数字签名


            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " SW 订单查询参数:" + str.ToString(), LogPathFile.Recharge.ToString());

            string result = PostAndGet.HttpPostString(QueryUrl, str.ToString(), ref coockie);

            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " SW 订单查询:" + result, LogPathFile.Recharge.ToString());

            string state       = Regex.Match(result, @"<state>(.*?)</state>").Groups[1].Value;
            string swOrderId   = Regex.Match(result, @"<order-id>(.*?)</order-id>").Groups[1].Value;
            string swStateInfo = Regex.Match(result, @"<state-info>(.*?)</state-info>").Groups[1].Value;


            if (state.Equals("101"))
            {
                order.RechargeStatus = (int)OrderRechargeStatus.successful;
                order.RechargeMsg    = swStateInfo + "-" + swOrderId;
            }
            else if (state.Equals("201") || state.Equals("202") || state.Equals("203") || state.Equals("301") || state.Equals("302") || state.Equals("304") ||
                     state.Equals("305") || state.Equals("306") || state.Equals("307") || state.Equals("401") || state.Equals("405") || state.Equals("501"))
            {
                order.RechargeStatus = (int)OrderRechargeStatus.failure;
                order.RechargeMsg    = swStateInfo + "-" + swOrderId;
            }
            else if (state.Equals("601"))
            {
                int status = getOrderStatus(swStateInfo, "601");
                order.RechargeStatus = status;
                order.RechargeMsg    = swStateInfo;

                //if (swStateInfo.Contains("帐号错误") || swStateInfo.Contains("充值失败:玩家账号不存在") || swStateInfo.Contains("充值失败:玩家账号不存在")
                //    || swStateInfo.Contains("批价失败,你的帐号无法存入Q币!失败原因:单日累计存款金额超过系统限额") || swStateInfo.Contains("交易失败")
                //    || swStateInfo.Contains("您输入的游戏账号无法充值")|| swStateInfo.Contains("充值已达每日上限")|| swStateInfo.Contains("所选金额会超出每日限额"))
                //{
                //    order.RechargeStatus = (int)OrderRechargeStatus.failure;
                //    order.RechargeMsg = swStateInfo;
                //}
                //else
                //{
                //    order.RechargeStatus = (int)OrderRechargeStatus.suspicious;
                //    order.RechargeMsg = swStateInfo;
                //}
            }
            else if (state.Equals("102"))
            {//充值中
            }
            else
            {
                order.RechargeStatus = (int)OrderRechargeStatus.suspicious;
                order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.suspicious) + "-" + swOrderId;
            }

            return(order);
        }
コード例 #26
0
        public static string GetAudioVideoIntroList(string AudioVideoBookId, string AudioVideoTypeEnum, string FileName, string AudioVideoName, int PageIndex, int PageSize)
        {
            try
            {
                AudioVideoTypeEnum = AudioVideoTypeEnum.Filter();
                FileName           = FileName.Filter();
                AudioVideoName     = AudioVideoName.Filter();
                PageIndex          = Convert.ToInt32(PageIndex.ToString().Filter());
                Model_VSysUserRole loginUser = (Model_VSysUserRole)HttpContext.Current.Session["LoginUser"];
                #region 资源信息
                DataTable     dtBook      = new DataTable();
                List <object> listReturn  = new List <object>();
                string        strSql      = string.Empty;
                string        strSqlCount = string.Empty;
                string        StrWhere    = " where AudioVideoBookId='" + AudioVideoBookId + "' ";
                if (!string.IsNullOrEmpty(FileName))
                {
                    StrWhere += " and FileName like '%" + FileName.TrimEnd() + "'%";
                }
                if (!string.IsNullOrEmpty(AudioVideoName))
                {
                    StrWhere += " and AudioVideoName like '%" + AudioVideoName.TrimEnd() + "'%";
                }
                if (!string.IsNullOrEmpty(AudioVideoTypeEnum) && AudioVideoTypeEnum != "-1")
                {
                    StrWhere += " and AudioVideoTypeEnum='" + AudioVideoTypeEnum + "'";
                }

                strSqlCount = @"select count(*) from AudioVideoIntro" + StrWhere + " ";
                strSql      = @"select * from (select ROW_NUMBER() over(ORDER BY A.CreateTime DESC) row,A.* from dbo.AudioVideoIntro A"
                              + StrWhere + " ) t where row between " + ((PageIndex - 1) * PageSize + 1) + " and " + (PageIndex * PageSize) + "  ";
                dtBook = Rc.Common.DBUtility.DbHelperSQL.Query(strSql).Tables[0];
                int rCount = Convert.ToInt32(Rc.Common.DBUtility.DbHelperSQL.GetSingle(strSqlCount).ToString());
                int inum   = 0;
                for (int i = 0; i < dtBook.Rows.Count; i++)
                {
                    inum++;
                    listReturn.Add(new
                    {
                        inum = (i + 1),
                        AudioVideoIntroId      = dtBook.Rows[i]["AudioVideoIntroId"].ToString(),
                        CreateTime             = pfunction.ConvertToLongDateTime(dtBook.Rows[i]["CreateTime"].ToString()),
                        FileName               = dtBook.Rows[i]["FileName"].ToString(),
                        AudioVideoTypeEnum     = dtBook.Rows[i]["AudioVideoTypeEnum"].ToString(),
                        AudioVideoTypeEnumName = EnumService.GetDescription <AudioVideoTypeEnum>(dtBook.Rows[i]["AudioVideoTypeEnum"].ToString()),
                        AudioVideoName         = dtBook.Rows[i]["AudioVideoName"].ToString(),
                        AudioVideoUrl          = File.Exists(HttpContext.Current.Server.MapPath(dtBook.Rows[i]["AudioVideoUrl"].ToString())) ? dtBook.Rows[i]["AudioVideoUrl"].ToString() : "False",
                        AudioVideoBookId       = dtBook.Rows[i]["AudioVideoBookId"].ToString()
                    });
                }
                #endregion

                if (inum > 0)
                {
                    return(JsonConvert.SerializeObject(new
                    {
                        err = "null",
                        PageIndex = PageIndex,
                        PageSize = PageSize,
                        TotalCount = rCount,
                        list = listReturn
                    }));
                }
                else
                {
                    return(JsonConvert.SerializeObject(new
                    {
                        err = "暂无数据"
                    }));
                }
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new
                {
                    err = "error"//ex.Message.ToString()
                }));
            }
        }
コード例 #27
0
        public bool notigyOrderToSUP(Order order, bool isprocessing = false)
        {
            WriteLog.Write("方法:订单开始通知易约,订单号:" + order.OrderInsideID + ",订单状态:"
                           + order.RechargeStatus + "_" + EnumService.GetDescription((int)order.RechargeStatus), LogPathFile.Other.ToString());


            //充值成功=0,充值失败=1, 处理中=2,可疑订单=3
            int    State     = 0;
            string StateInfo = "充值成功";

            if (isprocessing)
            {
                State     = 2;
                StateInfo = EnumService.GetDescription(OrderRechargeStatus.processing);
            }
            else
            {
                switch (order.RechargeStatus)
                {
                case (int)OrderRechargeStatus.successful:
                    State = 0;
                    if (string.IsNullOrEmpty(order.RechargeMsg))
                    {
                        StateInfo = EnumService.GetDescription(OrderRechargeStatus.successful);
                    }
                    else
                    {
                        StateInfo = order.RechargeMsg;
                    }
                    break;

                case (int)OrderRechargeStatus.failure:
                    State = 1;
                    if (string.IsNullOrEmpty(order.RechargeMsg))
                    {
                        StateInfo = EnumService.GetDescription(OrderRechargeStatus.failure);
                    }
                    else
                    {
                        StateInfo = order.RechargeMsg;
                    }
                    break;

                case (int)OrderRechargeStatus.processing:
                    State     = 2;
                    StateInfo = EnumService.GetDescription(OrderRechargeStatus.processing);
                    break;

                case (int)OrderRechargeStatus.untreated:
                case (int)OrderRechargeStatus.suspicious:
                    State = 3;
                    if (string.IsNullOrEmpty(order.RechargeMsg))
                    {
                        StateInfo = EnumService.GetDescription(OrderRechargeStatus.suspicious);
                    }
                    else
                    {
                        StateInfo = order.RechargeMsg;
                    }

                    break;
                }
            }

            string sign = Md5Helper.MD5Encrypt(merchantID + order.OrderExternalID + State + key);

            string postData = string.Format("MerchantID={0}&OrderID={1}&State={2}&StateInfo={3}&ChargeAccount={4}&ChargeMac={5}&Sign={6}",
                                            merchantID, order.OrderExternalID, State, System.Web.HttpUtility.UrlEncode(StateInfo, Encoding.UTF8), "", "", sign);

            System.Net.CookieContainer cookie = new System.Net.CookieContainer();

            string result = PostAndGet.HttpPostString(notifyOrderurl, postData, ref cookie);


            WriteLog.Write("方法:订单通知易约结果,订单号:" + order.OrderInsideID + ", 易约通知返回:" + result, LogPathFile.Other.ToString());

            string notifyStatus = Regex.Match(result, @"<State>(.*?)</State>").Groups[0].Value;

            if (notifyStatus.Contains("0"))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #28
0
ファイル: MainForm.cs プロジェクト: AnCalm/PayClient
        void Recharge(object obj)
        {
            try
            {
                AssignmentDatagirdView((Order)obj);

                Order order = payOrder(obj);
                order.EndDatetime = DateTime.Now;

                string logMsg = string.Format("订单号:{0},代充商品:{1},代充帐号:{2},订单充值状态:{3},订单充值描述:{4}"
                                              , order.OrderInsideID, order.ProductName, order.TargetAccount, EnumService.GetDescription((int)order.RechargeStatus), order.RechargeMsg);
                WriteLog.Write(logMsg, LogPathFile.Recharge.ToString());

                AssignmentDatagirdView(order);

                if (order.MerchantCode == MerchantCodeType.SW)
                {
                    new ManageSW().notigyOrderToSW(order);

                    order.IsNotify = true;
                }

                new SQLOrder().UpdateOrder(order);

                Application.DoEvents();
            }
            catch (Exception ex)
            {
                WriteLog.Write("方法:Recharge异常,信息:" + ex.Message + ex.StackTrace, LogPathFile.Recharge.ToString());
            }
        }
コード例 #29
0
        public Order Query(Order order)
        {
            string MerchantID = PayAndQueryRuiLian.merchantID;
            string key        = PayAndQueryRuiLian.key;
            string QueryUrl   = PayAndQueryRuiLian.QueryUrl;

            CookieContainer coockie = new CookieContainer();

            string        strmd5 = MerchantID + order.OrderInsideID + key;
            string        sign   = Md5Helper.MD5Encrypt(strmd5);
            StringBuilder str    = new StringBuilder();

            str.AppendFormat("cid={0}", MerchantID);           //商家编号
            str.AppendFormat("&oid={0}", order.OrderInsideID); //商家订单编号
            str.AppendFormat("&sign={0}", sign);               //数字签名


            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " Pay1 订单查询参数:" + str.ToString(), LogPathFile.Recharge.ToString());

            string result = PostAndGet.HttpPostString(QueryUrl, str.ToString(), ref coockie);

            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " Pay1 订单查询:" + result, LogPathFile.Recharge.ToString());

            string state = Regex.Match(result, @"result=(.*?)&").Groups[1].Value;
            string msg   = Regex.Match(result, @"&msg=(.*)").Groups[1].Value;


            if (state.Equals("true"))
            {
                if (msg == "1")
                {
                    order.RechargeStatus = (int)OrderRechargeStatus.successful;
                    order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.successful);
                }
                else if (msg == "0")
                {
                    order.RechargeStatus = (int)OrderRechargeStatus.failure;
                    order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.failure);
                }
            }
            else if (state.Equals("false"))
            {
                if (msg == "参数有误" || msg == "商家帐号错误" || msg == "校验失败" || msg == "订单不存在")
                {
                    order.RechargeStatus = (int)OrderRechargeStatus.failure;
                    order.RechargeMsg    = msg;
                }
                else
                {
                    order.RechargeStatus = (int)OrderRechargeStatus.suspicious;
                    order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.suspicious);
                }
            }
            else
            {
                order.RechargeStatus = (int)OrderRechargeStatus.suspicious;
                order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.suspicious);
            }

            return(order);
        }
コード例 #30
0
ファイル: QueryXinqidian.cs プロジェクト: AnCalm/PayClient
        public Order Query(Order order)
        {
            string MerchantID = PayAndQueryXinqidian.merchantID;
            string key        = PayAndQueryXinqidian.key;
            string QueryUrl   = PayAndQueryXinqidian.QueryUrl;


            CookieContainer coockie = new CookieContainer();

            string UserId      = MerchantID;                              //	用户编号	必选	String	是
            string UserOrderId = order.OrderInsideID;                     //	用户订单号	必选	String	是
            string TimeStamp   = DateTime.Now.ToString("yyyyMMddHHmmss"); //时间戳	必选	String	是	格式:yyyyMMddHHmmss 允许最大时间误差为60分钟
            string Sign        = "";                                      //签名字符串	必选	String	否	加密后的字符串

            string strmd5 = "timestamp" + TimeStamp + "userid" + UserId + "userorderid" + UserOrderId + "key" + key;

            Sign = Md5Helper.GetMD5String_Default(strmd5);

            StringBuilder str = new StringBuilder();

            str.AppendFormat("UserId={0}", UserId);
            str.AppendFormat("&UserOrderId={0}", UserOrderId);
            str.AppendFormat("&TimeStamp={0}", TimeStamp);
            str.AppendFormat("&Sign={0}", Sign);


            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " Xinqidian 订单加密参数:" + strmd5.ToString() + " Xinqidian 订单查询参数:" + str.ToString(), LogPathFile.Recharge.ToString());

            string result = PostAndGet.HttpPostString(QueryUrl, str.ToString(), ref coockie);

            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " Xinqidian 订单查询:" + result, LogPathFile.Recharge.ToString());



            string Code      = Regex.Match(result, @"""Code"":(.*?),").Groups[1].Value;
            string Status    = Regex.Match(result, @"""Status"":""(.*?)"",").Groups[1].Value;
            string StatusMsg = Regex.Match(result, @"""Message"":""(.*?)""").Groups[1].Value;
            string OrderId   = Regex.Match(result, @"""OrderId"":""(.*?)""").Groups[1].Value;

            if (Code.Equals("1") && Status.Equals("1"))
            {
                order.RechargeStatus = (int)OrderRechargeStatus.successful;
                if (StatusMsg == "响应成功")
                {
                    StatusMsg = EnumService.GetDescription(OrderRechargeStatus.successful);
                }

                order.RechargeMsg = StatusMsg + OrderId;
            }
            else if (Code.Equals("1") && Status.Equals("2"))
            {
                order.RechargeStatus = (int)OrderRechargeStatus.failure;
                if (StatusMsg == "响应成功")
                {
                    StatusMsg = EnumService.GetDescription(OrderRechargeStatus.failure);
                }
                order.RechargeMsg = StatusMsg + OrderId;
            }
            else
            {
                //充值中
            }


            //只有当返回Code=1 并且 响应Content中Status为1时可作成功处理
            //当返回Code=1并且响应Content中Status为2时可作失败处理

            return(order);
        }