Exemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <JMP.MDL.jmp_app> DataTableToList(DataTable dt)
        {
            List <JMP.MDL.jmp_app> modelList = new List <JMP.MDL.jmp_app>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                JMP.MDL.jmp_app model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new JMP.MDL.jmp_app();
                    if (dt.Rows[n]["a_id"].ToString() != "")
                    {
                        model.a_id = int.Parse(dt.Rows[n]["a_id"].ToString());
                    }
                    if (dt.Rows[n]["a_auditstate"].ToString() != "")
                    {
                        model.a_auditstate = int.Parse(dt.Rows[n]["a_auditstate"].ToString());
                    }
                    model.a_secretkey = dt.Rows[n]["a_secretkey"].ToString();
                    if (dt.Rows[n]["a_time"].ToString() != "")
                    {
                        model.a_time = DateTime.Parse(dt.Rows[n]["a_time"].ToString());
                    }
                    model.a_showurl = dt.Rows[n]["a_showurl"].ToString();
                    model.a_auditor = dt.Rows[n]["a_auditor"].ToString();
                    if (dt.Rows[n]["a_rid"].ToString() != "")
                    {
                        model.a_rid = int.Parse(dt.Rows[n]["a_rid"].ToString());
                    }
                    model.a_appurl      = dt.Rows[n]["a_appurl"].ToString();
                    model.a_appsynopsis = dt.Rows[n]["a_appsynopsis"].ToString();
                    if (dt.Rows[n]["a_user_id"].ToString() != "")
                    {
                        model.a_user_id = int.Parse(dt.Rows[n]["a_user_id"].ToString());
                    }
                    model.a_name = dt.Rows[n]["a_name"].ToString();
                    if (dt.Rows[n]["a_platform_id"].ToString() != "")
                    {
                        model.a_platform_id = int.Parse(dt.Rows[n]["a_platform_id"].ToString());
                    }
                    model.a_paymode_id = dt.Rows[n]["a_paymode_id"].ToString();
                    if (dt.Rows[n]["a_apptype_id"].ToString() != "")
                    {
                        model.a_apptype_id = int.Parse(dt.Rows[n]["a_apptype_id"].ToString());
                    }
                    model.a_notifyurl = dt.Rows[n]["a_notifyurl"].ToString();
                    model.a_key       = dt.Rows[n]["a_key"].ToString();
                    if (dt.Rows[n]["a_state"].ToString() != "")
                    {
                        model.a_state = int.Parse(dt.Rows[n]["a_state"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 初始化接口主通道
        /// </summary>
        /// <param name="mode">参数实体</param>
        /// <param name="json">参数json字符串</param>
        /// <param name="CacheTime">缓存时间</param>
        /// <param name="ip">ip地址</param>
        /// <returns></returns>
        public InnerResponse InfoPass(JmPayParameter.Models.Initialization mode, string json, int CacheTime, string ip)
        {
            InnerResponse Inn = new InnerResponse();

            Inn = VerificationParameter(mode, json);
            if (Inn.Success == true)
            {
                if (mode.t_appid > 0)
                {
                    SelectAPP       selectAPP = new SelectAPP();
                    JMP.MDL.jmp_app app       = selectAPP.SelectAppId(mode.t_appid, CacheTime);
                    if (app != null)
                    {
                        jmp_terminal model = EntityEvaluation(mode, ip);
                        if (mode != null)
                        {
                            if (mode.t_isnew == 1)
                            {
                                Inn = Insertliveteral(model);
                            }
                            else
                            {
                                Inn = InsertNew(model);
                            }
                        }
                        else
                        {
                            Inn = Inn.InfoToResponse(InfoErrorCode.Code9998);
                        }
                    }
                    else
                    {
                        Inn = Inn.InfoToResponse(InfoErrorCode.Code9996);
                    }
                }
                else
                {
                    Inn = Inn.InfoToResponse(InfoErrorCode.Code9996);
                }
            }
            return(Inn);
        }
Exemplo n.º 3
0
        public ActionResult Appinfo()
        {
            int appid = string.IsNullOrEmpty(Request["appid"]) ? 0 : Int32.Parse(Request["appid"]);

            JMP.BLL.jmp_app bll    = new JMP.BLL.jmp_app();
            JMP.MDL.jmp_app modapp = new JMP.MDL.jmp_app();
            if (appid > 0)
            {
                modapp = bll.SelectAppId(appid);
            }
            string payfs = SelectPay(modapp.a_paymode_id);

            string[] pay = payfs.Split(',');
            ViewBag.pay    = pay;
            ViewBag.modapp = modapp;
            string helpUrl = System.Configuration.ConfigurationManager.AppSettings["helpUrl"].ToString();

            ViewBag.helpUrl = helpUrl;
            return(View());
        }
Exemplo n.º 4
0
        public JsonResult DeleteApp()
        {
            object retJson = new { success = 0, msg = "操作失败" };

            JMP.MDL.jmp_app model = new JMP.MDL.jmp_app();//应用实体类
            JMP.BLL.jmp_app bll   = new JMP.BLL.jmp_app();
            int             a_id  = string.IsNullOrEmpty(Request["a_id"]) ? 0 : Int32.Parse(Request["a_id"].ToString());

            if (a_id > 0)
            {
                model         = bll.GetModel(a_id);
                model.a_state = -1;
                if (bll.Update(model))
                {
                    Logger.OperateLog("删除应用", "删除应用ID为'" + a_id + "'");
                    retJson = new { success = 1, msg = "操作成功" };
                }
                else
                {
                    retJson = new { success = 0, msg = "操作失败" };
                }
            }
            return(Json(retJson));
        }
Exemplo n.º 5
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(JMP.MDL.jmp_app model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 6
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(JMP.MDL.jmp_app model)
 {
     return(dal.Add(model));
 }
Exemplo n.º 7
0
        public ActionResult UpdateApp()
        {
            int appid = string.IsNullOrEmpty(Request["appid"]) ? 0 : Int32.Parse(Request["appid"]);

            JMP.BLL.jmp_app appbll = new JMP.BLL.jmp_app();
            JMP.MDL.jmp_app model  = new JMP.MDL.jmp_app();

            string yy = "";

            if (appid > 0)
            {
                model = appbll.SelectId(appid);
                #region =========获取应用平台在用信息=========
                JMP.BLL.jmp_platform        bll  = new JMP.BLL.jmp_platform();
                DataTable                   dt   = bll.GetList(" 1=1 and p_state='1' ").Tables[0];//获取应用平台在用信息
                List <JMP.MDL.jmp_platform> yypt = JMP.TOOL.MdlList.ToList <JMP.MDL.jmp_platform>(dt);
                ViewBag.glptdt = yypt;
                #endregion

                #region ========获取应用类型在用信息======
                JMP.BLL.jmp_apptype yybll = new JMP.BLL.jmp_apptype();
                string where = "  t_id in (select  DISTINCT(t_topid) from jmp_apptype where t_topid in( select t_id from jmp_apptype where t_topid='0'   )) and t_state='1' order by t_sort desc";
                DataTable           yydt   = yybll.GetList(where).Tables[0];//获取应用类型在用信息
                JMP.MDL.jmp_apptype models = new JMP.MDL.jmp_apptype();
                int t_topid = 0;
                if (model.a_apptype_id > 0)
                {
                    models  = yybll.GetModel(model.a_apptype_id);//查询单条信息
                    t_topid = models.t_topid;
                }
                string yyid = "";

                if (model.a_auditstate == 1)
                {
                    yy += "<select id='xzyylx' disabled ='disabled' > ";
                }
                else
                {
                    yy += "<select id='xzyylx' onclick='xzyylx()'> ";
                }

                for (int j = 0; j < yydt.Rows.Count; j++)
                {
                    yyid = yydt.Rows[j]["t_id"].ToString();
                    if (t_topid > 0)
                    {
                        if (Int32.Parse(yydt.Rows[j]["t_id"].ToString()) == models.t_topid)
                        {
                            yy += "<option value='" + yyid + "' selected=selected >" + yydt.Rows[j]["t_name"] + "</option>";
                        }
                        else
                        {
                            yy += "<option value='" + yyid + "' >" + yydt.Rows[j]["t_name"] + "</option>";
                        }
                    }
                    else
                    {
                        yy += "<option value='" + yyid + "' >" + yydt.Rows[j]["t_name"] + "</option>";
                    }
                }

                yy += "</select>";
                #endregion
            }
            int userid   = UserInfo.UserId;
            var userlist = _UserService.FindListBySql("relation_type='" + (int)Relationtype.Agent + "' and relation_person_id='" + userid + "' and u_state=1", "");

            ViewBag.userlist = userlist;

            #region 获取所有支付方式

            JMP.BLL.jmp_paymode zfbll = new JMP.BLL.jmp_paymode();

            DataTable zfdt = new DataTable();
            List <JMP.MDL.jmp_paymode> zflist = new List <JMP.MDL.jmp_paymode>();
            zfdt          = zfbll.GetList(" 1=1 and p_state='1' ").Tables[0];//获取支付类型在用信息
            zflist        = JMP.TOOL.MdlList.ToList <JMP.MDL.jmp_paymode>(zfdt);
            ViewBag.appid = appid;
            ViewBag.list  = zflist;
            #endregion

            ViewBag.yy    = yy;
            ViewBag.model = model;
            //支付方式
            string[] zffs = model.a_paymode_id.Split(',');
            ViewBag.zffs = zffs;
            return(View());
        }
Exemplo n.º 8
0
        public JsonResult InsertUpdateApp(JMP.MDL.jmp_app mod)
        {
            object retJson = new { success = 0, msg = "操作失败" };

            JMP.BLL.jmp_app bll = new JMP.BLL.jmp_app();

            if (mod.a_apptype_id == 0)
            {
                retJson = new { success = 0, msg = "请选择应用类型" };
            }
            else
            {
                if (mod.a_id > 0)
                {
                    #region 修改应用
                    string          rzsm   = "";
                    JMP.MDL.jmp_app modapp = new JMP.MDL.jmp_app();
                    modapp = bll.GetModel(mod.a_id);
                    var modcolne = modapp.Clone();
                    modapp.a_name        = mod.a_name;        //应用名称
                    modapp.a_platform_id = mod.a_platform_id; //关联平台ID
                    modapp.a_paymode_id  = mod.a_paymode_id;  //关联支付类型ID
                    modapp.a_apptype_id  = mod.a_apptype_id;  //关联应用类型ID
                    modapp.a_notifyurl   = mod.a_notifyurl;   //回掉地址
                    modapp.a_user_id     = mod.a_user_id;     //开发者ID
                    modapp.a_showurl     = mod.a_showurl;     //同步地址
                    modapp.a_appurl      = mod.a_appurl;      //应用审核地址
                    modapp.a_appsynopsis = mod.a_appsynopsis; //应用简介

                    if (bll.Update(modapp))
                    {
                        Logger.ModifyLog("修改应用", modcolne, mod);
                        retJson = new { success = mod.a_id, msg = "修改成功" };
                    }
                    else
                    {
                        retJson = new { success = 0, msg = "修改失败" };
                    }
                    #endregion
                }
                else
                {
                    #region 添加应用
                    mod.a_rid        = 0;
                    mod.a_auditor    = "";
                    mod.a_state      = 1;
                    mod.a_auditstate = 0;
                    mod.a_key        = "";
                    mod.a_secretkey  = "";
                    mod.a_time       = DateTime.Now;
                    int cg = _AppService.Insert(mod);
                    // int cg = bll.Add(mod);
                    if (cg > 0)
                    {
                        // Logger.CreateLog("新增应用",mod);
                        mod.a_key       = DESEncrypt.Encrypt(mod.a_user_id + ";" + cg + ";" + DateTime.Now.ToString("yyyyMMddssmmfff"));
                        mod.a_secretkey = DESEncrypt.Encrypt(cg + ";" + mod.a_key + ";" + DateTime.Now.ToString("yyyyMMddssmmfff"));
                        mod.a_id        = cg;
                        if (bll.Update(mod))
                        {
                            Logger.CreateLog("新增应用", mod);
                            retJson = new { success = 1, msg = "添加成功" };
                        }
                        else
                        {
                            retJson = new { success = 0, msg = "添加失败" };
                        }
                    }
                    else
                    {
                        retJson = new { success = 0, msg = "添加失败" };
                    }
                    #endregion
                }
            }
            return(Json(retJson));
        }