Exemple #1
0
        public HttpResponseMessage paycode(string OrderID, string tid)
        {
            try
            {
                pram       pram   = new pram();
                RuleCommon common = new RuleCommon();
                DataTable  dt     = common.GetQueryDate("", "tblAlipay", "1=1 and fldOrderID='" + OrderID + "' and fldtransactionnum='" + tid + "'");
                DataTable  dt1    = common.GetQueryDate("", "tblOrdertable", "1=1 and fldOrdernum='" + OrderID + "' and fldtransactionnum='" + tid + "'");
                string     url    = "http://47.112.131.178:8066/404/";
                if (dt.Rows.Count > 0)
                {
                    pram.url    = dt.Rows[0]["fldPayUrl"].ToString();
                    pram.amount = dt1.Rows[0]["fldOrderAmount"].ToString();
                }
                //HttpResponseMessage resp = new HttpResponseMessage(HttpStatusCode.Moved);
                //resp.Headers.Location = new Uri(url);
                //return resp;
                string rest = JsonHelper.SerializeObject(pram);

                return(new HttpResponseMessage {
                    Content = new StringContent(rest, System.Text.Encoding.UTF8, "application/json")
                });
            }
            catch (Exception e)
            {
                throw new InsertException(e.Message, "alipayController", "pay", OrderID);
            }
        }
        public HttpResponseMessage InsetDoc(pram tbl)
        {
            string result = string.Empty;

            #region 查询本月是否有导入附件
            DataTable    dt           = rule.getdt("select fldSTCode,fldSTName,fldAutoId,fldParentID from LAPtblFW_RegCity");
            tblDocManage tblDocManage = new tblDocManage();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (tbl.cityid == dt.Rows[i]["fldAutoid"].ToString())
                {
                    tblDocManage.fldSTCode = dt.Rows[i]["fldSTCode"].ToString();
                    tblDocManage.fldSTName = dt.Rows[i]["fldSTName"].ToString();
                }
            }
            string    filname = "";
            string    path    = "";
            DataTable dt1     = rule.getdt("select * from tblDocManage where fldSTName='" + tblDocManage.fldSTName + "'");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DateTime timedoc = DateTime.Parse(dt1.Rows[i]["fldDocDate"].ToString());
                if (timedoc.Month == DateTime.Now.Month && timedoc.Year == DateTime.Now.Year)
                {
                    filname = dt.Rows[i]["fldDocName"].ToString();
                    path    = dt.Rows[i]["fldDocPath"].ToString();
                }
            }
            #endregion
            #region 插入
            if (filname == "" && path == "")
            {
                tblDocManage.fldBusinessType   = System.Web.HttpUtility.UrlDecode(tbl.fldBusinessType);
                tblDocManage.fldDocDate        = DateTime.Now.ToShortDateString();
                tblDocManage.fldDocName        = tbl.DocName;
                tblDocManage.fldDocPath        = System.Web.HttpUtility.UrlDecode(tbl.docpath);
                tblDocManage.fldOperate_UserID = tbl.userid;
                tblDocManage.fldisReport       = false;
                tblDocManage.fldFileClassify   = "区县上传-上报说明";
                tblDocManage.fldUpLoadDate     = DateTime.Now.ToString();
                tblDocManage.fldReportingDate  = "";
                usp_tblDocManage_Insert uspInsert = new usp_tblDocManage_Insert();
                uspInsert.ReceiveParameter(tblDocManage);
                int idex = uspInsert.ExecNoQuery();

                if (idex > 0)
                {
                    result = rule.JsonStr("ok", "", "");
                }
            }
            else
            {
                result = rule.JsonStr("repeat", "本月已经上传过附件!不能重复上传!", "");
            }
            #endregion
            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }
        public HttpResponseMessage FrozenAccountDate(pram prams)
        {
            string result = string.Empty;

            try
            {
                using (Model1 context = new Model1())
                {
                    List <tblFW_User> tblFW = (from x in context.tblFW_User
                                               where x.fldDuty == prams.paypass
                                               select x).ToList();
                    //验证支付密码是否正确
                    if (tblFW.Count > 0)
                    {
                        RuleFrozenAccount ruleFrozen = new RuleFrozenAccount();
                        int       fldAutoID          = 1;
                        DataTable table = ruleFrozen.FrozenAccount(prams.MerchID, prams.Accoun, out fldAutoID);
                        if (fldAutoID == 0)
                        {
                            result = rule.JsonStr("error", "余额不足", fldAutoID);
                        }
                        else
                        {
                            result = rule.JsonStr("ok", "", table);
                        }
                    }
                    else
                    {
                        result = rule.JsonStr("error", "支付密码错误", "");
                    }
                }
            }
            catch (Exception e)
            {
                //错误保存日志
                throw new InsertException(e.Message, " Accountflow", "FrozenAccount", prams.ToString());
            }
            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }
Exemple #4
0
        public HttpResponseMessage UpdateMerchantList(pram prams)
        {
            string result = string.Empty;

            try
            {
                using (YYPlayContext db = new YYPlayContext())
                {
                    tbleMerchant info = (from c in db.tbleMerchant
                                         where c.fldAutoID == prams.fldAutoID
                                         select c).Single();
                    info.fldMerchName = prams.fldMerchName;
                    info.fldIdCare    = prams.fldIdCare;
                    info.fldIPaddress = prams.fldIPaddress;
                    info.fldPhone     = prams.fldPhone;
                    info.fldRemark    = "";
                    info.fldContacts  = prams.fldContacts;
                    info.fldAgent     = prams.fldAgent;
                    int ret = db.SaveChanges();
                    if (ret <= 0)
                    {
                        result = rule.JsonStr("error", "更新失败!", ret);
                    }
                    else
                    {
                        result = rule.JsonStr("ok", "", info);
                    }
                }
            }
            catch (Exception e)
            {
                result = rule.JsonStr("error", e.Message, "");
            }
            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }
Exemple #5
0
        public HttpResponseMessage AddDMerchantList(pram tbleMerchantpram)
        {
            string result = string.Empty;

            try
            {
                using (YYPlayContext db = new YYPlayContext())
                {
                    RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();

                    Random random = new Random();
                    string nowid  = "100" + random.Next(100, 1000);;

                    tbleMerchant maxid = (from x in db.tbleMerchant
                                          orderby x.fldMerchID descending
                                          select x).FirstOrDefault();

                    RulePayBehavior rulePay      = new RulePayBehavior();
                    string          fldSecretKey = Guid.NewGuid().ToString("N").ToUpper();
                    tbleMerchant    info         = new tbleMerchant();
                    info.fldMerchID    = nowid.ToString();//当前时间加上身份证后四位组成商户ID
                    info.fldMerchName  = tbleMerchantpram.fldMerchName;
                    info.fldCreateTime = DateTime.Now;
                    info.fldIdCare     = tbleMerchantpram.fldIdCare;
                    info.fldIPaddress  = tbleMerchantpram.fldIPaddress;
                    info.fldMaPass     = rulePay.EncryptionMd5(tbleMerchantpram.fldIdCare.Substring(tbleMerchantpram.fldIdCare.Length - 6, 6), "x2");//身份证后6位,为初始密码
                    info.fldPhone      = tbleMerchantpram.fldPhone;
                    info.fldRemark     = "";
                    info.fldPayPass    = rulePay.EncryptionMd5(DateTime.Now.Year + tbleMerchantpram.fldIdCare.Substring(tbleMerchantpram.fldIdCare.Length - 6, 6), "x2");
                    info.fldContacts   = tbleMerchantpram.fldContacts;
                    info.fldAgent      = tbleMerchantpram.fldAgent;
                    info.fldSecretKey  = fldSecretKey;

                    db.tbleMerchant.Add(info);
                    int ret = db.SaveChanges();
                    if (ret <= 0)
                    {
                        result = rule.JsonStr("error", "添加失败!", ret);
                    }
                    else
                    {
                        int       count = 0;
                        DataTable dt    = rule.getpaging("tbleMerchant", "[fldAutoID],[fldMerchID],[fldMerchName],[fldContacts],[fldPhone],[fldCreateTime],[fldIPaddress],[fldIdCare],[fldAgent],[fldRemark],fldisstand", "1=1" + tbleMerchantpram.where, tbleMerchantpram.page, tbleMerchantpram.limit, tbleMerchantpram.sort, out count);

                        getdata getdatas = new getdata();
                        getdatas.total = count;
                        getdatas.Table = dt;
                        //查询所有的数据  用于前端筛选
                        List <tbleMerchant> tbleMerchants = (from x in db.tbleMerchant select x).ToList();
                        getdatas.tbleMerchants = tbleMerchants;
                        result = rule.JsonStr("ok", "", getdatas);
                    }
                }
            }
            catch (Exception e)
            {
                result = rule.JsonStr("error", e.Message, "");
            }
            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }