Ejemplo n.º 1
0
 public ActionResult APPAdd()
 {
     #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_paymode        zfbll  = new JMP.BLL.jmp_paymode();
     DataTable                  zfdt   = zfbll.GetList(" 1=1 and p_state='1' ").Tables[0];//获取支付类型在用信息
     List <JMP.MDL.jmp_paymode> zflist = JMP.TOOL.MdlList.ToList <JMP.MDL.jmp_paymode>(zfdt);
     ViewBag.zflist = zflist;
     #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];//获取应用类型在用信息
     List <JMP.MDL.jmp_apptype> yylist = JMP.TOOL.MdlList.ToList <JMP.MDL.jmp_apptype>(yydt);
     ViewBag.yylist = yylist;
     #endregion
     return(View());
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 修改应用
        /// </summary>
        /// <returns></returns>
        public ActionResult UpdateAPP(int a_id)
        {
            JMP.BLL.jmp_app bll    = new JMP.BLL.jmp_app();
            JMP.MDL.jmp_app model  = new JMP.MDL.jmp_app();
            string          glpt   = "";
            string          zf     = "";
            string          szmrdj = "";
            string          yy     = "";

            if (a_id > 0)
            {
                model = bll.SelectId(a_id);
                #region =========获取应用平台在用信息=========
                JMP.BLL.jmp_platform bllpl = new JMP.BLL.jmp_platform();
                DataTable            dt    = bllpl.GetList(" 1=1 and p_state='1' ").Tables[0];//获取应用平台在用信息
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (Int32.Parse(dt.Rows[i]["p_id"].ToString()) == model.a_platform_id)
                    {
                        glpt += "<option value=\"" + dt.Rows[i]["p_id"] + "\" selected=\"selected\" >" + dt.Rows[i]["p_name"] + "</option>";
                    }
                    else
                    {
                        glpt += "<option value=\"" + dt.Rows[i]["p_id"] + "\">" + dt.Rows[i]["p_name"] + "</option>";
                    }
                }
                #endregion
                #region =====获取支付类型在用信息======
                JMP.BLL.jmp_paymode zfbll     = new JMP.BLL.jmp_paymode();
                DataTable           zfdt      = zfbll.GetList(" 1=1 and p_state='1' ").Tables[0];//获取支付类型在用信息
                string[]            a_paymode = model.a_paymode_id.Split(',');
                for (int k = 0; k < zfdt.Rows.Count; k++)
                {
                    bool check = true;
                    for (int i = 0; i < a_paymode.Length; i++)
                    {
                        if (zfdt.Rows[k]["p_id"].ToString() == a_paymode[i])
                        {
                            zf   += "&nbsp;&nbsp;<input type=\"checkbox\" name=\"zflx\" class=\"inputChck\" id=paytype_" + zfdt.Rows[k]["p_id"] + "  data-stat=" + zfdt.Rows[k]["p_islocked"] + "   value=" + zfdt.Rows[k]["p_id"] + " checked=\"checked\" />&nbsp;" + zfdt.Rows[k]["p_name"];
                            check = false;
                            break;
                        }
                    }
                    if (check)
                    {
                        zf += "&nbsp;&nbsp;<input type=\"checkbox\" name=\"zflx\" class=\"inputChck\" id=paytype_" + zfdt.Rows[k]["p_id"] + "  data-stat=" + zfdt.Rows[k]["p_islocked"] + "    value=" + zfdt.Rows[k]["p_id"] + " />&nbsp;" + zfdt.Rows[k]["p_name"];
                    }
                }
                #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 = "";
                for (int j = 0; j < yydt.Rows.Count; j++)
                {
                    yyid = "yy" + yydt.Rows[j]["t_id"].ToString();
                    if (t_topid > 0)
                    {
                        if (Int32.Parse(yydt.Rows[j]["t_id"].ToString()) == models.t_topid)
                        {
                            szmrdj = yyid;
                            yy    += "<input type=\"button\" id='" + yyid + "' name=\"yyname\" onclick=\"xzyylx(this.id,0)\" class=\"xzinput\" value=" + yydt.Rows[j]["t_name"] + "  />";
                        }
                        else
                        {
                            yy += "<input type=\"button\" id='" + yyid + "' name=\"yyname\" onclick=\"xzyylx(this.id,0)\" class=\"inpuwxz\" value=" + yydt.Rows[j]["t_name"] + "  />";
                        }
                    }
                    else
                    {
                        yy += "<input type=\"button\" id='" + yyid + "' name=\"yyname\" onclick=\"xzyylx(this.id,0)\" class=\"inpuwxz\" value=" + yydt.Rows[j]["t_name"] + "  />";
                    }
                }

                #endregion

                #region 根据应用子类型获取风险等级
                JMP.BLL.jmp_risklevelallocation        ribll  = new JMP.BLL.jmp_risklevelallocation();
                List <JMP.MDL.jmp_risklevelallocation> rilist = new List <JMP.MDL.jmp_risklevelallocation>();
                rilist         = ribll.SelectAppType(model.a_apptype_id);
                ViewBag.rilist = rilist;
                #endregion
            }
            ViewBag.model  = model;
            ViewBag.glpt   = glpt;
            ViewBag.zf     = zf;
            ViewBag.yy     = yy;
            ViewBag.szmrdj = szmrdj;
            return(View());
        }