public JsonResult ScAdd() { object retJson = new { success = 0, msg = "操作失败" }; int ServiceFeeRatioGradeId = string.IsNullOrEmpty(Request["ServiceFeeRatioGradeId"]) ? 0 : int.Parse(Request["ServiceFeeRatioGradeId"]); int id = string.IsNullOrEmpty(Request["id"]) ? 0 : int.Parse(Request["id"]); //修改前的数据 modelUser = bllUser.GetModel(id); if (bllUser.UpdateServiceFeeRatioGradeId(id, ServiceFeeRatioGradeId)) { //记录日志(会定期清理) Logger.OperateLog("商务设置直客开发者费率", "商务ID:" + modelUser.relation_person_id + ",操作数据(jmp_user)ID:" + id + ",费率等级由:" + modelUser.ServiceFeeRatioGradeId + ",改为:" + ServiceFeeRatioGradeId + "。"); //记录日志(不会清理) RateLogger.OperateLog("商务设置直客开发者费率", "商务ID:" + modelUser.relation_person_id + ",操作数据(jmp_user)ID:" + id + ",费率等级由:" + modelUser.ServiceFeeRatioGradeId + ",改为:" + ServiceFeeRatioGradeId + "。"); retJson = new { success = 1, msg = "设置成功!" }; } else { retJson = new { success = 0, msg = "设置失败!" }; } return(Json(retJson)); }
/// <summary> /// 流量走势报表统计界面 /// </summary> /// <returns></returns> public ActionResult Trends() { #region 获取用户实名认证状态信息 JMP.BLL.jmp_user sm_bll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user sm_model = new JMP.MDL.jmp_user(); int u_ids = UserInfo.Uid; //查询登录信息 sm_model = sm_bll.GetModel(u_ids); ViewBag.auditstate = sm_model.u_auditstate; ViewBag.linkEmail = sm_model.u_email; #endregion string ksrq = DateTime.Now.ToString("yyyy-MM-01"); //获取本月第一天 ViewBag.ksrq = ksrq; string stime = ""; //开始时间; if (DateTime.Now.ToString("yyyyMM") == DateTime.Now.AddDays(-7).ToString("yyyyMM")) { stime = string.IsNullOrEmpty(Request["stime"]) ? DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd") : Request["stime"];//开始时间 } else { stime = string.IsNullOrEmpty(Request["stime"]) ? DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") : Request["stime"];//开始时间 } ViewBag.stime = stime; string etime = string.IsNullOrEmpty(Request["etime"]) ? DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") : Request["etime"];//结束时间 ViewBag.etime = etime; return(View()); }
public ActionResult down() { #region 获取用户实名认证状态信息 JMP.BLL.jmp_user sm_bll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user sm_model = new JMP.MDL.jmp_user(); int u_ids = UserInfo.Uid; //查询登录信息 sm_model = sm_bll.GetModel(u_ids); ViewBag.auditstate = sm_model.u_auditstate; ViewBag.linkEmail = sm_model.u_email; #endregion 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; return(View()); }
/// <summary> /// 重置开发者提现密码 /// </summary> /// <returns></returns> public JsonResult AppRePassword() { object result = new { success = 0, msg = "重置失败!" }; int id = string.IsNullOrEmpty(Request["id"]) ? 0 : int.Parse(Request["id"]); //默认密码 string RePwd = ConfigurationManager.AppSettings["RePwd"].ToString(); //得到一个实体对象 model_user = bll_user.GetModel(id); //加密 string u_paypwd = DESEncrypt.Encrypt(RePwd); if (bll_user.UpdateUserPayPwd(id, u_paypwd)) { string log = UserInfo.UserName + "重置了开发者ID为:{" + id + "}的提现密码!"; Logger.OperateLog("重置开发者提现密码", log); result = new { success = 1, msg = "重置成功!" }; } else { result = new { success = 0, msg = "重置失败!" }; } return(Json(result)); }
public ActionResult AppUserRiskSh() { int userid = string.IsNullOrEmpty(Request["userid"]) ? 0 : int.Parse(Request["userid"]); JMP.BLL.jmp_user bll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user model = bll.GetModel(userid); ViewBag.usermodel = model; return(View()); }
public JsonResult UserLogin(string logName, string logPwd, string valCode) { //获取开发者平台地址 object result = new { msg = "验证码错误!", success = "0" }; if (valCode == Session["ValidateCode"].ToString()) { string Pwd = DESEncrypt.Encrypt(logPwd); string Userurl = System.Configuration.ConfigurationManager.AppSettings["Userurl"] + "?qs=" + DESEncrypt.Encrypt(logName + ";" + Pwd + ";0;" + System.DateTime.Now.ToString()); JMP.BLL.jmp_limit bll_limit = new JMP.BLL.jmp_limit(); JMP.BLL.jmp_user bll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user model = bll.GetModel(logName); if (model != null && model.u_state == 1) { if ((model.u_email == logName || model.u_phone == logName) && model.u_password == Pwd) { UserInfo.UserId = model.u_id; UserInfo.UserName = model.u_realname; UserInfo.UserNo = model.u_email; UserInfo.UserRoleId = model.u_role_id; DataTable dtLimit = bll_limit.GetAppUserLimitSession(model.u_id, model.u_role_id); if (dtLimit.Rows.Count > 0) { result = new { msg = "登录成功!", success = "1", url = Userurl }; } else { result = new { msg = "权限不足!", success = "2" }; } } else { result = new { msg = "用户名或密码错误!", success = "2" }; } } else { if (model == null) { result = new { msg = "用户名或密码错误!", success = "2" }; } else if (model.u_state != 1) { result = new { msg = "该账号已冻结!", success = "2" }; } } //result = new { msg = "验证码成功!", status = 1, url = Userurl }; } return(Json(result)); }
public ActionResult AppUserAuditing() { int userid = string.IsNullOrEmpty(Request["userid"]) ? 0 : int.Parse(Request["userid"]); JMP.BLL.jmp_user bll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user model = bll.GetModel(userid); ViewBag.usermodel = model; //审核状态 ViewBag.start = model.u_auditstate; ViewBag.userid = userid; return(View()); }
/// <summary> /// 添加应用基本 /// </summary> /// <returns></returns> public ActionResult AppAdd() { #region 获取用户实名认证状态信息 JMP.BLL.jmp_user sm_bll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user sm_model = new JMP.MDL.jmp_user(); int u_ids = UserInfo.Uid; //查询登录信息 sm_model = sm_bll.GetModel(u_ids); ViewBag.auditstate = sm_model.u_auditstate; ViewBag.linkEmail = sm_model.u_email; #endregion #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];//获取应用类型在用信息 List <JMP.MDL.jmp_apptype> yylist = JMP.TOOL.MdlList.ToList <JMP.MDL.jmp_apptype>(yydt); ViewBag.yylist = yylist; #endregion int appid = string.IsNullOrEmpty(Request["appid"]) ? 0 : Int32.Parse(Request["appid"]); #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 return(View()); }
public JsonResult AddUser(JMP.MDL.jmp_user jmpuser) { JMP.BLL.CoServiceFeeRatioGrade grade_bll = new JMP.BLL.CoServiceFeeRatioGrade(); //查询默认费率 JMP.MDL.CoServiceFeeRatioGrade grade_model = grade_bll.GetModelById(); object obj = new { success = 0, msg = "添加失败!" }; JMP.BLL.jmp_user userBll = new JMP.BLL.jmp_user(); jmpuser.u_password = DESEncrypt.Encrypt(jmpuser.u_password); jmpuser.u_role_id = int.Parse(ConfigurationManager.AppSettings["JSRoleID"]); try { if (jmpuser.u_category == 0) { jmpuser.u_photo = string.IsNullOrEmpty(jmpuser.u_photo) ? "" : jmpuser.u_photo; } else { jmpuser.u_blicense = string.IsNullOrEmpty(jmpuser.u_blicense) ? "" : jmpuser.u_blicense; jmpuser.u_photo = string.IsNullOrEmpty(jmpuser.u_photo) ? " " : jmpuser.u_photo; } jmpuser.u_qq = string.IsNullOrEmpty(jmpuser.u_qq) ? "" : jmpuser.u_qq; jmpuser.u_address = string.IsNullOrEmpty(jmpuser.u_address) ? " " : jmpuser.u_address; jmpuser.ServiceFeeRatioGradeId = string.IsNullOrEmpty(grade_model.Id.ToString()) ? 0 : grade_model.Id; jmpuser.u_time = DateTime.Now; bool flag = false; if (!userBll.ExistsEmail(jmpuser.u_email)) { flag = userBll.Add(jmpuser) > 0; } obj = new { success = flag ? 1 : 0, msg = flag ? "添加成功!" : "添加失败!" }; //写日志 if (flag) { Logger.CreateLog("添加开发者", jmpuser); } } catch (Exception ex) { obj = new { success = 0, msg = "添加异常!" }; Logger.OperateLog("添加开发者报错", ex.ToString()); } return(Json(obj)); }
/// <summary> /// 用户手续费设置以及扣量设置 /// </summary> /// <returns></returns> public ActionResult UserSxF() { int userid = string.IsNullOrEmpty(Request["userid"]) ? 0 : Int32.Parse(Request["userid"]); //根据ID查询用户信息 model_user = bll_user.GetModel(userid); JMP.BLL.CoServiceFeeRatioGrade bll = new JMP.BLL.CoServiceFeeRatioGrade(); DataTable dt = bll.GetList(" ").Tables[0];//获取应用平台在用信息 List <JMP.MDL.CoServiceFeeRatioGrade> yypt = JMP.TOOL.MdlList.ToList <JMP.MDL.CoServiceFeeRatioGrade>(dt); ViewBag.glptdt = yypt; ViewBag.user = model_user; ViewBag.id = userid; return(View()); }
public ActionResult Index() { //每日应用汇总 JMP.BLL.jmp_appcount bll = new JMP.BLL.jmp_appcount(); JMP.MDL.jmp_appcount model = new JMP.MDL.jmp_appcount(); JMP.MDL.jmp_user sm_model = new JMP.MDL.jmp_user(); //开发者每日结算详情 JMP.BLL.CoSettlementDeveloperAppDetails cobll = new JMP.BLL.CoSettlementDeveloperAppDetails(); JMP.MDL.CoSettlementDeveloperAppDetails comodel_yesterday = new JMP.MDL.CoSettlementDeveloperAppDetails(); JMP.MDL.CoSettlementDeveloperAppDetails comodel_month = new JMP.MDL.CoSettlementDeveloperAppDetails(); JMP.MDL.CoSettlementDeveloperAppDetails comodel_preceding_month = new JMP.MDL.CoSettlementDeveloperAppDetails(); int u_id = UserInfo.UserId; JMP.BLL.jmp_user sm_bll = new JMP.BLL.jmp_user(); sm_model = sm_bll.GetModel(u_id); ViewBag.FrozenMoney = sm_model.FrozenMoney.ToString("f0"); //今天 string u_time = DateTime.Now.ToString("yyyy-MM-dd"); //昨天 string u_time_yesterday = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); //本月 string u_time_month = DateTime.Now.ToString("yyyy-MM"); //上月 string u_time_preceding_month = DateTime.Now.AddMonths(-1).ToString("yyyy-MM"); //根据日期查询交易金额和笔数(今天) model = bll.DataAppcountAdy(u_time, u_id, 0); //根据不同日期统计查询(昨天) comodel_yesterday = cobll.GetModelKFZ_total(u_id, u_time_yesterday, 0); //根据不同日期统计查询(本月) comodel_month = cobll.GetModelKFZ_total(u_id, u_time_month, 1); //根据不同日期统计查询(上月) comodel_preceding_month = cobll.GetModelKFZ_total(u_id, u_time_preceding_month, 1); //流水及收入金额 ViewBag.comodel_yesterday = comodel_yesterday; ViewBag.comodel_month = comodel_month; ViewBag.comodel_preceding_month = comodel_preceding_month; ViewBag.AppCount = model; return(View()); }
/// <summary> /// 应用列表 /// </summary> /// <returns></returns> public ActionResult AppList() { #region 获取用户实名认证状态信息 JMP.BLL.jmp_user sm_bll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user sm_model = new JMP.MDL.jmp_user(); int u_ids = UserInfo.Uid; //查询登录信息 sm_model = sm_bll.GetModel(u_ids); ViewBag.auditstate = sm_model.u_auditstate; ViewBag.linkEmail = sm_model.u_email; #endregion int pageCount = 0; int pageIndexs = string.IsNullOrEmpty(Request["pageIndexs"]) ? 1 : Int32.Parse(Request["pageIndexs"]); //当前页 int PageSize = string.IsNullOrEmpty(Request["PageSize"]) ? 20 : Int32.Parse(Request["PageSize"]); //每页显示数量 string searchname = string.IsNullOrEmpty(Request["searchname"]) ? "" : Request["searchname"]; //应用名称 ViewBag.searchname = searchname; int terrace = string.IsNullOrEmpty(Request["terrace"]) ? 0 : int.Parse(Request["terrace"]); //运行平台 ViewBag.terrace = terrace; List <JMP.MDL.jmp_app> list = new List <JMP.MDL.jmp_app>(); JMP.BLL.jmp_app bll = new JMP.BLL.jmp_app(); list = bll.SelectUserList(UserInfo.UserId.ToString(), searchname, terrace, pageIndexs, PageSize, out pageCount); ViewBag.pageIndexs = pageIndexs; ViewBag.PageSize = PageSize; ViewBag.pageCount = pageCount; ViewBag.list = list; #region =========获取应用平台在用信息========= JMP.BLL.jmp_platform paybll = new JMP.BLL.jmp_platform(); DataTable dt = paybll.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 return(View()); }
/// <summary> /// 收银台预览 /// </summary> /// <returns></returns> public ActionResult PayBank() { #region 获取用户实名认证状态信息 JMP.BLL.jmp_user sm_bll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user sm_model = new JMP.MDL.jmp_user(); int u_ids = UserInfo.Uid; //查询登录信息 sm_model = sm_bll.GetModel(u_ids); ViewBag.auditstate = sm_model.u_auditstate; ViewBag.linkEmail = sm_model.u_email; #endregion return(View()); }
public ActionResult AppUserEdit() { int userId = !string.IsNullOrEmpty(Request["uid"]) ? int.Parse(Request["uid"]) : 0; JMP.BLL.jmp_user bll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user model = bll.GetModel(userId); ViewBag.UserData = model; ViewBag.UploadUrl = ConfigurationManager.AppSettings["imgurl"]; string DisplayName = ""; // switch (model.relation_type) { case 1: co_model = bll_co.GetModel(model.relation_person_id); if (co_model != null) { DisplayName = co_model.DisplayName; } break; case 2: modelAgent = bllAgent.GetModel(model.relation_person_id); if (modelAgent != null) { DisplayName = modelAgent.DisplayName; } break; } ViewBag.DisplayName = DisplayName; return(View()); }
public ActionResult UserLoginbygw(string qs) { object result = ""; string ms = JMP.TOOL.DESEncrypt.Decrypt(qs); string u_name = ms.Split(';')[0].ToString(); string u_pwd = ms.Split(';')[1].ToString(); string admname = ms.Split(';')[2].ToString(); string admtime = ms.Split(';')[3].ToString(); if (Convert.ToDateTime(admtime).AddMinutes(5) < System.DateTime.Now) { result = new { msg = "登录超时,后台密码失效,请从新刷新后台用户列表!", success = "2" }; } else { JMP.BLL.jmp_limit bll_limit = new JMP.BLL.jmp_limit(); JMP.BLL.jmp_user bll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user model = bll.GetModel(u_name); //加密用户登录密码 string jm_pwd = u_pwd; if (model != null && model.u_state == 1) { if ((model.u_email == u_name || model.u_phone == u_name) && model.u_password == jm_pwd) { UserInfo.UserId = model.u_id; UserInfo.UserName = model.u_realname; UserInfo.UserNo = model.u_email; UserInfo.UserRoleId = model.u_role_id; DataTable dtLimit = bll_limit.GetAppUserLimitSession(model.u_id, model.u_role_id); if (dtLimit.Rows.Count > 0) { Session["dtSession"] = dtLimit; if (admname != "0") { string log = string.Format(admname + "从官网登录。", UserInfo.UserNo, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); AddLocLog.AddUserLog(UserInfo.UserId, 2, RequestHelper.GetClientIp(), admname + "从官网登录。", log); } result = new { msg = "登录成功!", success = "1" }; } else { result = new { msg = "权限不足!", success = "2" }; } } else { result = new { msg = "用户名或密码错误!", success = "2" }; } } else { if (model == null) { result = new { msg = "用户名或密码错误!", success = "2" }; } else if (model.u_state != 1) { result = new { msg = "该账号已冻结!", success = "2" }; } } } ViewBag.message = result; return(View()); }
public JsonResult UpdateUser(JMP.MDL.jmp_user jmpuser) { object obj = new { success = 0, msg = "更新失败!" }; JMP.BLL.jmp_user userBll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user oldUser = userBll.GetModel(jmpuser.u_id); var oldUserColne = oldUser.Clone(); oldUser.u_category = jmpuser.u_category;//类别 oldUser.u_email = jmpuser.u_email; oldUser.u_realname = jmpuser.u_realname; oldUser.u_password = DESEncrypt.Encrypt(jmpuser.u_password); oldUser.u_phone = jmpuser.u_phone; oldUser.u_qq = jmpuser.u_qq; oldUser.u_address = jmpuser.u_address; oldUser.u_account = jmpuser.u_account; oldUser.u_name = jmpuser.u_name; oldUser.u_bankname = jmpuser.u_bankname; oldUser.u_idnumber = jmpuser.u_idnumber; oldUser.FrozenMoney = jmpuser.FrozenMoney; oldUser.BusinessEntity = jmpuser.BusinessEntity; oldUser.RegisteredAddress = jmpuser.RegisteredAddress; oldUser.relation_type = jmpuser.relation_type; oldUser.relation_person_id = jmpuser.relation_person_id; oldUser.u_photof = string.IsNullOrEmpty(jmpuser.u_photof) ? "" : jmpuser.u_photof; oldUser.u_licence = string.IsNullOrEmpty(jmpuser.u_licence) ? "" : jmpuser.u_licence; try { if (oldUser.u_category == 0) { oldUser.u_photo = string.IsNullOrEmpty(jmpuser.u_photo) ? "" : jmpuser.u_photo; } else { oldUser.u_blicense = string.IsNullOrEmpty(jmpuser.u_blicense) ? "" : jmpuser.u_blicense; oldUser.u_photo = string.IsNullOrEmpty(jmpuser.u_photo) ? " " : jmpuser.u_photo; oldUser.u_blicensenumber = jmpuser.u_blicensenumber; } if (string.IsNullOrEmpty(oldUser.u_qq)) { oldUser.u_qq = " "; } if (string.IsNullOrEmpty(oldUser.u_address)) { oldUser.u_address = " "; } bool flag = userBll.Update(oldUser); obj = new { success = flag ? 1 : 0, msg = flag ? "更新成功!" : "更新失败!" }; //写日志 if (flag) { Logger.ModifyLog("修改开发者", oldUserColne, jmpuser); //审核状态改变是发送私信和邮件给用户 if (jmpuser.u_auditstate != oldUserColne.u_auditstate) { JMP.BLL.jmp_message messbll = new JMP.BLL.jmp_message(); JMP.MDL.jmp_message j_mess = new JMP.MDL.jmp_message(); string tipmsg = string.Empty; #region 组装私信实体 j_mess.m_sender = UserInfo.UserId; j_mess.m_receiver = oldUser.u_id.ToString(); j_mess.m_type = 1; j_mess.m_time = DateTime.Now; j_mess.m_state = 0; switch (jmpuser.u_auditstate) { case -1: tipmsg = "你的账号审核未通过!"; break; case 0: tipmsg = "你的账号正在审核中,如有疑问请联系我们!"; break; case 1: tipmsg = "你的账号审核通过!"; break; } j_mess.m_content = tipmsg; j_mess.m_topid = oldUser.u_topid; #endregion //发送私信 if (jmpuser.u_auditstate == 1) { //更改审核状态为通过时,才发送私信 int record = messbll.Add(j_mess); if (record > 0) { Logger.CreateLog("发送私信给用户", j_mess); } } #region 发送邮件 //StringBuilder MailContent = new StringBuilder(); //MailContent.Append("亲爱的开发者:<br/>"); //MailContent.Append(" 您好!" + tipmsg); //MailContent.Append(" 如果你没有用该邮件账号注册过聚米支付平台的账号,请忽视本邮件!"); //MailContent.Append("亲爱的开发者:<br/>"); //bool isSend = MailHelper.SendText("*****@*****.**", "聚米网络科技", jmpuser.u_email, "重置密码", MailContent.ToString(), "smtp.adjumi.com", "*****@*****.**", ""); //if (isSend) //{ // string tmsg = string.Format("用户{0}({1})发送邮件至用户邮箱{2},邮件内容为:{3}", UserInfo.UserName, UserInfo.UserId, jmpuser.u_email, tipmsg); // AddLocLog.AddLog(int.Parse(UserInfo.UserId), 3, RequestHelper.GetClientIp(), "发送邮件给用户" + jmpuser.u_id, tmsg); //} #endregion } } } catch (Exception ex) { Logger.OperateLog("修改开发者报错" + jmpuser.u_id, ex.ToString()); obj = new { success = 0, msg = "更新出错了!" }; } return(Json(obj)); }
/// <summary> /// 订单列表 /// </summary> /// <returns></returns> public ActionResult OrderList() { #region 获取用户实名认证状态信息 JMP.BLL.jmp_user sm_bll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user sm_model = new JMP.MDL.jmp_user(); int u_ids = UserInfo.Uid; //查询登录信息 sm_model = sm_bll.GetModel(u_ids); ViewBag.auditstate = sm_model.u_auditstate; ViewBag.linkEmail = sm_model.u_email; #endregion #region 获取信息 JMP.BLL.jmp_paymode paymodebll = new JMP.BLL.jmp_paymode(); List <JMP.MDL.jmp_paymode> paymodeList = paymodebll.GetModelList("1=1 and p_state='1' ");//支付类型 ViewBag.paymodeList = paymodeList; #endregion #region 查询 //string sql = " select o_id,o_code,o_bizcode,o_tradeno,o_paymode_id,o_app_id,o_goods_id,o_term_key,o_price,o_payuser,o_ctime,o_ptime,o_state,o_times,o_address,o_noticestate,o_noticetimes,o_privateinfo,o_interface_id,o_showaddress,b.a_key,b.a_name,c.p_name,d.g_name from ( ";//组装查询条件 string sql = ""; string sql1 = ""; string TableName = ""; //表名 string order = "o_ptime"; //排序字段 int pageCount = 0; int pageIndexs = string.IsNullOrEmpty(Request["pageIndexs"]) ? 1 : Int32.Parse(Request["pageIndexs"]); //当前页 int PageSize = string.IsNullOrEmpty(Request["PageSize"]) ? 20 : Int32.Parse(Request["PageSize"]); //每页显示数量 int searchType = string.IsNullOrEmpty(Request["searchType"]) ? 0 : Int32.Parse(Request["searchType"]); //查询条件选择 string searchname = string.IsNullOrEmpty(Request["searchname"]) ? "" : Request["searchname"]; //查询类容 string stime = string.IsNullOrEmpty(Request["stime"]) ? DateTime.Now.ToString("yyyy-MM-dd") : Request["stime"]; //开始时间 string etime = string.IsNullOrEmpty(Request["etime"]) ? DateTime.Now.ToString("yyyy-MM-dd") : Request["etime"]; //结束时间 int paymode = string.IsNullOrEmpty(Request["paymode"]) ? 0 : Int32.Parse(Request["paymode"]); //支付类型 string paymentstate = string.IsNullOrEmpty(Request["paymentstate"]) ? "1" : Request["paymentstate"]; //支付状态 string noticestate = string.IsNullOrEmpty(Request["noticestate"]) ? "" : Request["noticestate"]; //通知状态 ArrayList sjfw = JMP.TOOL.WeekDateTime.WeekMonday(DateTime.Parse(stime), DateTime.Parse(etime)); //根据时间返回获取每周周一组装查询语句 string where = "where 1=1"; for (int i = 0; i < sjfw.Count; i++) { TableName = "jmp_order_" + DateTime.Parse(sjfw[i].ToString()).ToString("yyyyMMdd"); // TableName = "jmp_order_20161107"; sql += " SELECT o_id,o_code,o_bizcode,o_tradeno,o_paymode_id,o_app_id,o_goodsname,o_term_key,o_price,o_payuser,o_ctime,o_ptime,o_state,o_times,o_address,o_noticestate,o_noticetimes,o_privateinfo,o_interface_id,o_showaddress FROM " + TableName + " where 1=1 "; if (!string.IsNullOrEmpty(stime) && !string.IsNullOrEmpty(etime)) { sql += " and convert(varchar(10),o_ptime,120)>='" + stime + "' and convert(varchar(10),o_ptime,120)<='" + etime + "' "; } if (paymode > 0) { sql += " and o_paymode_id='" + paymode + "' "; } if (!string.IsNullOrEmpty(paymentstate)) { sql += " and o_state='" + paymentstate + "' "; } if (!string.IsNullOrEmpty(noticestate)) { sql += " and o_noticestate='" + noticestate + "' "; } sql += " UNION ALL "; } if (searchType > 0 && !string.IsNullOrEmpty(searchname)) { switch (searchType) { case 1: where += " and a.o_code='" + searchname + "' "; break; case 2: where += " and b.a_name='" + searchname + "' "; break; case 3: where += " and a.o_goodsname='" + searchname + "' "; break; case 4: where += " and a.o_tradeno= '" + searchname + "' "; break; case 5: where += " and a.o_bizcode like '%" + searchname + "%' "; break; } } where += "and b.a_user_id='" + UserInfo.UserId + "'"; //sql = sql.Remove(sql.Length - 10);//去掉最后一个UNION ALL //sql += " ) a left join jmp_app b on a.o_app_id=b.a_id left join jmp_paymode c on c.p_id=a.o_paymode_id left join jmp_goods d on d.g_id=a.o_goods_id and d.g_app_id=b.a_id and d.g_app_id=a.o_app_id where 1=1 and " + where; //组装时时表数据 sql1 = "SELECT o_id,o_code,o_bizcode,o_tradeno,o_paymode_id,o_app_id,o_goodsname,o_term_key,o_price,o_payuser,o_ctime,o_ptime,o_state,o_times,o_address,o_noticestate,o_noticetimes,o_privateinfo,o_interface_id, o_showaddress FROM jmp_order where 1=1"; if (!string.IsNullOrEmpty(stime) && !string.IsNullOrEmpty(etime)) { sql1 += " and convert(varchar(10),o_ptime,120)>='" + stime + "' and convert(varchar(10),o_ptime,120)<='" + etime + "' "; } if (paymode > 0) { sql1 += " and o_paymode_id='" + paymode + "' "; } if (!string.IsNullOrEmpty(paymentstate)) { sql1 += " and o_state='" + paymentstate + "' "; } if (!string.IsNullOrEmpty(noticestate)) { sql1 += " and o_noticestate='" + noticestate + "' "; } sql = sql + sql1; ViewBag.searchname = searchname; ViewBag.searchType = searchType; ViewBag.stime = stime; ViewBag.etime = etime; ViewBag.paymode = paymode; ViewBag.paymentstate = paymentstate; ViewBag.noticestate = noticestate; List <JMP.MDL.jmp_order> list = new List <JMP.MDL.jmp_order>(); JMP.BLL.jmp_order orderbll = new JMP.BLL.jmp_order(); list = orderbll.SelectPager(where, sql, order, pageIndexs, PageSize, out pageCount); ViewBag.pageIndexs = pageIndexs; ViewBag.PageSize = PageSize; ViewBag.pageCount = pageCount; ViewBag.list = list; #endregion return(View()); }
/// <summary> /// 应用报表 /// </summary> /// <returns></returns> public ActionResult AppReport(string rtype) { #region 获取用户实名认证状态信息 JMP.BLL.jmp_user sm_bll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user sm_model = new JMP.MDL.jmp_user(); int u_ids = UserInfo.Uid; //查询登录信息 sm_model = sm_bll.GetModel(u_ids); ViewBag.auditstate = sm_model.u_auditstate; ViewBag.linkEmail = sm_model.u_email; #endregion rtype = !string.IsNullOrEmpty(rtype) ? rtype : "total"; //日期 string stime = string.IsNullOrEmpty(Request["s_begin"]) ? DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") : Request["s_begin"]; string etime = string.IsNullOrEmpty(Request["s_end"]) ? DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") : Request["s_end"]; //首页跳转标识 int num = string.IsNullOrEmpty(Request["start"]) ? -1 : int.Parse(Request["start"]); //账单管理跳转标识 string time = string.IsNullOrEmpty(Request["time"]) ? "" : Request["time"]; if (time != "") { stime = JMP.TOOL.DESEncrypt.Decrypt(time); etime = JMP.TOOL.DESEncrypt.Decrypt(time); } else { if (rtype == "today") { num = 0; } switch (num) { case 0: stime = DateTime.Now.ToString("yyyy-MM-dd"); etime = DateTime.Now.ToString("yyyy-MM-dd"); break; case 2: stime = DateTime.Now.ToString("yyyy-MM-01"); etime = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); break; case 3: stime = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-01"); etime = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-01")).AddDays(-1).ToString("yyyy-MM-dd"); break; } } ViewBag.rtype = rtype; int pageCount = 0; int pageIndexs = string.IsNullOrEmpty(Request["curr"]) ? 1 : Int32.Parse(Request["curr"]); //当前页 int PageSize = string.IsNullOrEmpty(Request["psize"]) ? 20 : Int32.Parse(Request["psize"]); //每页显示数量 string types = string.IsNullOrEmpty(Request["s_type"]) ? "0" : Request["s_type"]; string searchKey = string.IsNullOrEmpty(Request["s_key"]) ? "" : Request["s_key"]; int sort = string.IsNullOrEmpty(Request["s_sort"]) ? 1 : int.Parse(Request["s_sort"]); string searchTotal = string.IsNullOrEmpty(Request["s_field"]) ? "" : Request["s_field"]; DataTable dt = new DataTable(); DataTable ddt = new DataTable();//用于查询总和CountSect string where = "where 1=1"; string orderby = "order by "; string BsaeDb = System.Configuration.ConfigurationManager.AppSettings["BaseDb"]; string helpUrl = System.Configuration.ConfigurationManager.AppSettings["helpUrl"].ToString(); ViewBag.helpUrl = helpUrl; #region 组装排序字段 //按日期倒序展示 if (!string.IsNullOrEmpty(searchTotal)) { if (searchTotal == "0") { orderby += "a_equipment "; } else if (searchTotal == "1") { orderby += "a_success "; } else if (searchTotal == "2") { orderby += "a_notpay "; } else if (searchTotal == "3") { orderby += "a_alipay "; } else if (searchTotal == "4") { orderby += "a_wechat "; } else { orderby += "a_time "; } } else { orderby += rtype == "total" ? "a_time " : "a_appid "; } orderby += (sort == 1 ? "desc" : "asc"); #endregion #region 查询 if (rtype == "total") { if (!string.IsNullOrEmpty(types)) { if (!string.IsNullOrEmpty(searchKey)) { switch (types) { case "0": //where += " and r_app_key like '%" + searchKey + "%'"; break; case "1": where += " and a.a_appname like '%" + searchKey + "%'"; break; case "2": where += " and b.u_realname like '%" + searchKey + "%'"; break; } } } where += " and b.u_id='" + UserInfo.UserId + "'"; where += " and a_time>='" + stime + "' and a_time<='" + etime + "' "; string sql = string.Format(@"select a_appname,a_appid, isnull(SUM(a_equipment),0) as a_equipment,a_time, isnull(SUM(a_success),0) a_success, isnull(SUM(a_notpay),0) a_notpay, isnull(SUM(a_alipay),0) a_alipay, isnull(SUM(a_wechat),0) a_wechat, isnull(SUM(a_qqwallet),0) a_qqwallet, isnull(SUM(a_count),0) a_count, isnull(SUM(a_curr),0) a_curr, isnull(SUM(a_successratio),0) a_successratio, isnull(SUM(a_arpur),0) a_arpur, isnull(SUM(a_request),0) a_request, isnull(sum(a_unionpay),0) a_unionpay, b.u_realname from jmp_appreport a left join {0}.dbo.jmp_user b on a.a_uerid=b.u_id {1} group by a_appname,b.u_realname,a_appid,a_time", BsaeDb, where); string countsql = string.Format(@"select sum(a_equipment) a_equipment,sum(a_success) a_success,SUM(a_notpay) a_notpay,sum(a_alipay) a_alipay,sum(a_wechat)a_wechat,isnull(SUM(a_qqwallet),0) a_qqwallet,sum(a_unionpay) a_unionpay, sum(a_count)a_count,SUM(a_curr)a_curr,SUM(a_request) a_request,SUM(a_successratio) a_successratio,SUM(a_arpur) a_arpur from jmp_appreport a left join {0}.dbo.jmp_user b on a.a_uerid=b.u_id {1} ", BsaeDb, where); dt = bll_report.GetLists(sql, orderby, pageIndexs, PageSize, out pageCount); ddt = bll_report.CountSect(countsql); } #endregion #region 查询今日 else if (rtype == "today") { where += " and b.u_id='" + UserInfo.UserId + "' "; where += " and a_datetime>='" + DateTime.Now.ToString("yyyy-MM-dd") + " 00:00" + "' and a_datetime<='" + DateTime.Now.ToString("yyyy-MM-dd") + " 23:59" + "' "; if (!string.IsNullOrEmpty(types)) { if (!string.IsNullOrEmpty(searchKey)) { switch (types) { case "0": //where += " and temp.t_appkey like '%" + searchKey + "%' "; break; case "1": where += " and a.a_appname like '%" + searchKey + "%'"; break; case "2": where += " and b.u_realname like '%" + searchKey + "%'"; break; } } } string r_time = DateTime.Now.ToString("yyyy-MM-dd"); string tname = GetOrderTableName(r_time); string query = string.Format(@"select a_appname,a_appid, isnull(SUM(a_equipment),0) as a_equipment,GETDATE() a_time, isnull(SUM(a_success),0) a_success, isnull(SUM(a_notpay),0) a_notpay, isnull(SUM(a_alipay),0) a_alipay, isnull(SUM(a_wechat),0) a_wechat, isnull(SUM(a_qqwallet),0) a_qqwallet, isnull(SUM(a_count),0) a_count, isnull(SUM(a_curr),0) a_curr, isnull(SUM(a_successratio),0) a_successratio, isnull(SUM(a_arpur),0) a_arpur, isnull(SUM(a_request),0) a_request, isnull(sum(a_unionpay),0) a_unionpay, b.u_realname from jmp_appcount a left join {0}.dbo.jmp_user b on a.a_uerid=b.u_id {1} group by a_appname,b.u_realname,a_appid ", BsaeDb, where); string countsql = string.Format(@"select sum(a_equipment) a_equipment,sum(a_success) a_success,SUM(a_notpay) a_notpay,sum(a_alipay) a_alipay,sum(a_wechat)a_wechat,isnull(SUM(a_qqwallet),0) a_qqwallet,sum(a_unionpay) a_unionpay, sum(a_count)a_count,SUM(a_curr)a_curr,SUM(a_request) a_request,SUM(a_successratio) a_successratio,SUM(a_arpur) a_arpur from jmp_appcount a left join {0}.dbo.jmp_user b on a.a_uerid=b.u_id {1}", BsaeDb, where); JMP.BLL.jmp_appcount bll = new JMP.BLL.jmp_appcount(); dt = bll.GetTodayList(query, orderby, pageIndexs, PageSize, out pageCount); if (dt.Rows.Count > 0) { ddt = bll.CountSect(countsql); } } #endregion ViewBag.pageIndexs = pageIndexs; ViewBag.PageSize = PageSize; ViewBag.pageCount = pageCount; ViewBag.ddt = ddt; ViewBag.rtype = rtype; ViewBag.stime = stime; ViewBag.etime = etime; return(View(dt)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(JMP.MDL.jmp_user model) { return(dal.Add(model)); }
/// <summary> /// 账单管理 /// </summary> /// <returns></returns> public ActionResult BillList() { #region 获取用户实名认证状态信息 JMP.BLL.jmp_user sm_bll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user sm_model = new JMP.MDL.jmp_user(); int u_ids = UserInfo.Uid; //查询登录信息 sm_model = sm_bll.GetModel(u_ids); ViewBag.auditstate = sm_model.u_auditstate; ViewBag.linkEmail = sm_model.u_email; #endregion int pageCount = 0; int pageIndexs = string.IsNullOrEmpty(Request["curr"]) ? 1 : Int32.Parse(Request["curr"]); //当前页 int PageSize = string.IsNullOrEmpty(Request["psize"]) ? 20 : Int32.Parse(Request["psize"]); //每页显示数量 string stime = string.IsNullOrEmpty(Request["stime"]) ? DateTime.Now.AddDays(-8).ToString("yyyy-MM-dd") : Request["stime"]; //开始时间 string etime = string.IsNullOrEmpty(Request["etime"]) ? DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") : Request["etime"]; //结束时间 //首页跳转标识 int num = string.IsNullOrEmpty(Request["start"]) ? -1 : int.Parse(Request["start"]); switch (num) { case 2: stime = DateTime.Now.ToString("yyyy-MM-01"); etime = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); break; case 3: stime = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-01"); etime = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-01")).AddDays(-1).ToString("yyyy-MM-dd"); break; } #region 组装查询语句 string where = "where DeveloperId='" + UserInfo.UserId + "'"; if (!string.IsNullOrEmpty(stime) && !string.IsNullOrEmpty(etime)) { where += " and SettlementDay >='" + stime + "' and SettlementDay<='" + etime + "' "; } string orderby = "order by SettlementDay desc"; string sql = string.Format(@"select a.Id,DeveloperId,CreatedOn,SettlementDay,TotalAmount,ServiceFee,PortFee,(TotalAmount-ServiceFee-PortFee) as KFZIncome,isnull(SUM(b.p_money),0) as p_money,ISNULL((OriginalTotalAmount-TotalAmount),0.0000) AS RefundAmount from dx_total.dbo.[CoSettlementDeveloperOverview] as a left join (select * from dx_base.dbo.jmp_pays a,dx_base.dbo.jmp_BankPlaymoney b where a.p_batchnumber=b.b_batchnumber and a.p_state!=-1 and b.b_tradestate!=4 ) as b on a.Id=b.p_bill_id {0} group by a.Id,DeveloperId,CreatedOn,SettlementDay,TotalAmount,ServiceFee,PortFee,OriginalTotalAmount", where); List <JMP.MDL.CoSettlementDeveloperOverview> list = new List <JMP.MDL.CoSettlementDeveloperOverview>(); JMP.MDL.CoSettlementDeveloperOverview model = new JMP.MDL.CoSettlementDeveloperOverview(); list = bll_CoSDO.GetLists(sql, orderby, pageIndexs, PageSize, out pageCount); #endregion #region 合计组装查询语句 string countsql = string.Format(@"select ISNULL(SUM(TotalAmount),0) as TotalAmount,isnull(SUM(ServiceFee),0) as ServiceFee,isnull(SUM(PortFee),0) as PortFee, isnull(SUM(TotalAmount)-SUM(ServiceFee)-SUM(PortFee),0) as KFZIncome,ISNULL(SUM(p_money),0) as p_money, ISNULL(SUM(OriginalTotalAmount)-SUM(TotalAmount),0) as RefundAmount from ( select a.Id,a.SettlementDay,TotalAmount,ServiceFee,PortFee,OriginalTotalAmount,ISNULL(SUM(b.p_money),0) as p_money from dx_total.dbo.CoSettlementDeveloperOverview as a left join (select * from dx_base.dbo.jmp_pays a,dx_base.dbo.jmp_BankPlaymoney b where a.p_batchnumber=b.b_batchnumber and a.p_state!=-1 and b.b_tradestate!=4 ) as b on a.Id=b.p_bill_id {0} group by a.Id,a.SettlementDay,TotalAmount,ServiceFee,PortFee,OriginalTotalAmount ) a", where); if (list.Count > 0) { DataTable dt = bll_CoSDO.SelectSum(countsql); model = dt.Rows.Count > 0 ? JMP.TOOL.MdlList.ToModel <JMP.MDL.CoSettlementDeveloperOverview>(dt) : new JMP.MDL.CoSettlementDeveloperOverview(); } #endregion ViewBag.pageIndexs = pageIndexs; ViewBag.PageSize = PageSize; ViewBag.pageCount = pageCount; ViewBag.stime = stime; ViewBag.etime = etime; ViewBag.list = list; ViewBag.model = model; return(View()); }
/// <summary> /// 修改个人信息 /// </summary> /// <param name="model">用户实体</param> /// <returns></returns> public bool UpdateInfo(JMP.MDL.jmp_user model) { return(dal.UpdateInfo(model)); }
/// <summary> /// 提交认证资料 /// </summary> /// <param name="model">用户实体</param> /// <returns></returns> public bool UpdateByEmail(JMP.MDL.jmp_user model) { return(dal.UpdateByEmail(model)); }
public ActionResult Default() { #region 获取用户实名认证状态信息 JMP.BLL.jmp_user sm_bll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user sm_model = new JMP.MDL.jmp_user(); int u_ids = UserInfo.Uid; //查询登录信息 sm_model = sm_bll.GetModel(u_ids); ViewBag.auditstate = sm_model.u_auditstate; ViewBag.linkEmail = sm_model.u_email; #endregion int r_id = UserInfo.UserRid; string menuStr = GetMenStr(u_ids, r_id); ViewBag.UserName = UserInfo.UserNo; ViewBag.MsgCount = sm_bll.GetUserMsgCount(u_ids); ViewBag.MenuTopStr = menuStr; ViewBag.QQ = ConfigurationManager.AppSettings["linkqq"]; ViewBag.Tel = ConfigurationManager.AppSettings["linkphone"]; //每日应用汇总 JMP.BLL.jmp_appcount bllapp = new JMP.BLL.jmp_appcount(); JMP.MDL.jmp_appcount modelapp = new JMP.MDL.jmp_appcount(); //开发者每日结算详情 JMP.BLL.CoSettlementDeveloperAppDetails cobll = new JMP.BLL.CoSettlementDeveloperAppDetails(); JMP.MDL.CoSettlementDeveloperAppDetails comodel_yesterday = new JMP.MDL.CoSettlementDeveloperAppDetails(); JMP.MDL.CoSettlementDeveloperAppDetails comodel_month = new JMP.MDL.CoSettlementDeveloperAppDetails(); JMP.MDL.CoSettlementDeveloperAppDetails comodel_preceding_month = new JMP.MDL.CoSettlementDeveloperAppDetails(); int u_id = UserInfo.UserId; //今天 string u_time = DateTime.Now.ToString("yyyy-MM-dd"); //昨天 string u_time_yesterday = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); //本月 string u_time_month = DateTime.Now.ToString("yyyy-MM"); //上月 string u_time_preceding_month = DateTime.Now.AddMonths(-1).ToString("yyyy-MM"); //根据日期查询交易金额和笔数(今天) modelapp = bllapp.DataAppcountAdy(u_time, u_id, 0); //根据不同日期统计查询(昨天) comodel_yesterday = cobll.GetModelKFZ_total(u_id, u_time_yesterday, 0); //根据不同日期统计查询(本月) comodel_month = cobll.GetModelKFZ_total(u_id, u_time_month, 1); //根据不同日期统计查询(上月) comodel_preceding_month = cobll.GetModelKFZ_total(u_id, u_time_preceding_month, 1); //流水及收入金额 ViewBag.comodel_yesterday = comodel_yesterday; ViewBag.comodel_month = comodel_month; ViewBag.comodel_preceding_month = comodel_preceding_month; ViewBag.AppCount = modelapp; return(View()); }
/// <summary> /// 获得数据列表 /// </summary> public List <JMP.MDL.jmp_user> DataTableToList(DataTable dt) { List <JMP.MDL.jmp_user> modelList = new List <JMP.MDL.jmp_user>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { JMP.MDL.jmp_user model; for (int n = 0; n < rowsCount; n++) { model = new JMP.MDL.jmp_user(); if (dt.Rows[n]["u_id"].ToString() != "") { model.u_id = int.Parse(dt.Rows[n]["u_id"].ToString()); } model.u_email = dt.Rows[n]["u_email"].ToString(); model.u_password = dt.Rows[n]["u_password"].ToString(); model.u_realname = dt.Rows[n]["u_realname"].ToString(); model.u_phone = dt.Rows[n]["u_phone"].ToString(); model.u_qq = dt.Rows[n]["u_qq"].ToString(); model.u_bankname = dt.Rows[n]["u_bankname"].ToString(); model.u_name = dt.Rows[n]["u_name"].ToString(); model.u_account = dt.Rows[n]["u_account"].ToString(); if (dt.Rows[n]["u_category"].ToString() != "") { model.u_category = int.Parse(dt.Rows[n]["u_category"].ToString()); } model.u_idnumber = dt.Rows[n]["u_idnumber"].ToString(); model.u_photo = dt.Rows[n]["u_photo"].ToString(); model.u_blicense = dt.Rows[n]["u_blicense"].ToString(); model.u_blicensenumber = dt.Rows[n]["u_blicensenumber"].ToString(); if (dt.Rows[n]["u_count"].ToString() != "") { model.u_count = int.Parse(dt.Rows[n]["u_count"].ToString()); } if (dt.Rows[n]["u_state"].ToString() != "") { model.u_state = int.Parse(dt.Rows[n]["u_state"].ToString()); } if (dt.Rows[n]["u_auditstate"].ToString() != "") { model.u_auditstate = int.Parse(dt.Rows[n]["u_auditstate"].ToString()); } if (dt.Rows[n]["u_topid"].ToString() != "") { model.u_topid = int.Parse(dt.Rows[n]["u_topid"].ToString()); } model.u_address = dt.Rows[n]["u_address"].ToString(); //if (dt.Rows[n]["u_poundage"].ToString() != "") //{ // model.u_poundage = decimal.Parse(dt.Rows[n]["u_poundage"].ToString()); //} if (dt.Rows[n]["u_role_id"].ToString() != "") { model.u_role_id = int.Parse(dt.Rows[n]["u_role_id"].ToString()); } if (dt.Rows[n]["u_drawing"].ToString() != "") { model.u_drawing = int.Parse(dt.Rows[n]["u_drawing"].ToString()); } if (dt.Rows[n]["u_merchant_id"].ToString() != "") { model.u_merchant_id = int.Parse(dt.Rows[n]["u_merchant_id"].ToString()); } if (dt.Rows[n]["u_time"].ToString() != "") { model.u_time = DateTime.Parse(dt.Rows[n]["u_time"].ToString()); } model.u_auditor = dt.Rows[n]["u_auditor"].ToString(); modelList.Add(model); } } return(modelList); }
public JsonResult UserLogin(string u_name, string u_pwd, string code) { object result = new { msg = "操作失败!", status = "0" }; JMP.BLL.jmp_limit bll_limit = new JMP.BLL.jmp_limit(); JMP.BLL.jmp_user bll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user model = new JMP.MDL.jmp_user(); var isDebug = ConfigurationManager.AppSettings["IsDebug"]; if (!string.IsNullOrEmpty(isDebug) && isDebug == "true") { string yzcode = Session["ValidateCode"].ToString(); if (yzcode != code) { result = new { msg = "验证码错误!", success = "2" }; return(Json(result)); } } model = bll.GetModel(u_name); //加密用户登录密码 string jm_pwd = DESEncrypt.Encrypt(u_pwd); if (model != null && model.u_state == 1) { if ((model.u_email == u_name || model.u_phone == u_name) && model.u_password == jm_pwd) { UserInfo.UserId = model.u_id; UserInfo.UserName = model.u_realname; UserInfo.UserNo = model.u_email; UserInfo.UserRoleId = model.u_role_id; UserInfo.auditstate = model.u_auditstate.ToString(); DataTable dtLimit = bll_limit.GetAppUserLimitSession(model.u_id, model.u_role_id); if (dtLimit.Rows.Count > 0) { Session["dtSession"] = dtLimit; model.u_count += 1; string log = string.Format("开发者{0}于{1}登录聚米支付平台。", UserInfo.UserNo, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); AddLocLog.AddUserLog(UserInfo.UserId, 2, RequestHelper.GetClientIp(), "用户" + UserInfo.UserName + "登录。", log); result = new { msg = "登录成功!", success = "1" }; return(Json(result)); } else { result = new { msg = "权限不足!", success = "2" }; } } else { result = new { msg = "用户名或密码错误!", success = "2" }; } } else { if (model == null) { result = new { msg = "用户名或密码错误!", success = "2" }; } else if (model.u_state != 1) { result = new { msg = "该账号已冻结!", success = "2" }; } } return(Json(result)); }
public JsonResult paysAdd() { object result = new { success = 0, msg = "操作失败!" }; JMP.BLL.jmp_user userbll = new JMP.BLL.jmp_user(); JMP.BLL.jmp_system systembll = new JMP.BLL.jmp_system(); //可提现金额 decimal ketiMoney = Convert.ToDecimal(Request["ketiMoney"] ?? "0"); //提现金额 decimal payMoney = Convert.ToDecimal(Request["payMoney"] ?? "0"); //提现银行卡信息 string b_bankid = string.IsNullOrEmpty(Request["b_bankid"]) ? "" : Request["b_bankid"]; //提现选中账单ID string payid = string.IsNullOrEmpty(Request["payid"]) ? "0" : Request["payid"]; //支付密码 string PayPwd = string.IsNullOrEmpty(Request["PayPwd"]) ? "" : Request["PayPwd"]; //提现类型(1:单卡提现,2:多卡提现) int WithdrawalsType = string.IsNullOrEmpty(Request["WithdrawalsType"]) ? 0 : int.Parse(Request["WithdrawalsType"]); //查询开发者信息 JMP.MDL.jmp_user j_user = userbll.GetModel(UserInfo.UserId); //查询超级密码 JMP.MDL.jmp_system j_sys = systembll.GetModel_name("password"); //提现最小金额 string WithdrawalsMinimum = System.Configuration.ConfigurationManager.AppSettings["WithdrawalsMinimum"].ToString(); //验证提现金额 if (payMoney >= decimal.Parse(WithdrawalsMinimum)) { if (payMoney > ketiMoney) { result = new { success = 0, msg = "提现金额不能超过可提金额!" }; } else { #region 提现金额验证成功,后续处理 //判断是否验证原支付密码 if (!string.IsNullOrEmpty(PayPwd)) { string temp = DESEncrypt.Encrypt(PayPwd); if (temp == j_user.u_paypwd || temp == j_sys.s_value) { #region 拼装提款表与银行打款对接表sql if (WithdrawalsType == 1 || WithdrawalsType == 2) { List <string> sqllist = new List <string>(); if (WithdrawalsType == 1) { sqllist = BankPaySongle(payMoney, b_bankid, payid); } else { sqllist = BankPay(payMoney, b_bankid, payid); } if (sqllist.Count > 0) { JMP.BLL.jmp_BankPlaymoney bankBll = new JMP.BLL.jmp_BankPlaymoney(); //执行多条SQL语句,实现数据库事务。 int num = bankBll.SelectBankPayMoney(sqllist); if (num > 0) { string log = "用户:" + UserInfo.UserId + ",申请提现:" + payMoney + ",申请时间:" + DateTime.Now; Logger.OperateLog("提现申请", log); result = new { success = 1, msg = "提现申请成功,请等待审核通过!" }; } else { result = new { success = 0, msg = "提现申请失败!" }; } } else { result = new { success = 0, msg = "提现申请失败!" }; } } else { Logger.OperateLog("提现申请失败", "提现类型(1:单卡提现,2:多卡提现):" + WithdrawalsType); result = new { success = 0, msg = "提现申请失败!" }; } #endregion } else { result = new { success = 0, msg = "支付密码输入错误!" }; } } else { result = new { success = 0, msg = "请输入支付密码!" }; } #endregion } } else { result = new { success = 0, msg = "提现金额不能为空且必须大于等于100!" }; } return(Json(result)); }
public ActionResult UpdateApp() { #region 获取用户实名认证状态信息 JMP.BLL.jmp_user sm_bll = new JMP.BLL.jmp_user(); JMP.MDL.jmp_user sm_model = new JMP.MDL.jmp_user(); int u_ids = UserInfo.Uid; //查询登录信息 sm_model = sm_bll.GetModel(u_ids); ViewBag.auditstate = sm_model.u_auditstate; ViewBag.linkEmail = sm_model.u_email; #endregion 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 } #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()); }