コード例 #1
0
ファイル: JMP_APPTYPE.cs プロジェクト: sunman001/dxpay
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <JMP.MDL.jmp_apptype> DataTableToList(DataTable dt)
        {
            List <JMP.MDL.jmp_apptype> modelList = new List <JMP.MDL.jmp_apptype>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                JMP.MDL.jmp_apptype model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new JMP.MDL.jmp_apptype();
                    if (dt.Rows[n]["t_id"].ToString() != "")
                    {
                        model.t_id = int.Parse(dt.Rows[n]["t_id"].ToString());
                    }
                    model.t_name = dt.Rows[n]["t_name"].ToString();
                    model.t_sort = dt.Rows[n]["t_sort"].ToString();
                    if (dt.Rows[n]["t_topid"].ToString() != "")
                    {
                        model.t_topid = int.Parse(dt.Rows[n]["t_topid"].ToString());
                    }
                    if (dt.Rows[n]["t_state"].ToString() != "")
                    {
                        model.t_state = int.Parse(dt.Rows[n]["t_state"].ToString());
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #2
0
ファイル: JMP_APPTYPE.cs プロジェクト: sunman001/dxpay
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(JMP.MDL.jmp_apptype model)
 {
     return(dal.Add(model));
 }
コード例 #3
0
ファイル: JMP_APPTYPE.cs プロジェクト: sunman001/dxpay
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(JMP.MDL.jmp_apptype model)
 {
     return(dal.Update(model));
 }
コード例 #4
0
ファイル: AppController.cs プロジェクト: sunman001/dxpay
        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());
        }