Пример #1
0
        public ActionResult CoServiceList()
        {
            JMP.BLL.CoServiceFeeRatioGrade bll   = new JMP.BLL.CoServiceFeeRatioGrade();
            JMP.MDL.CoServiceFeeRatioGrade model = new JMP.MDL.CoServiceFeeRatioGrade();
            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    searchDesc = string.IsNullOrEmpty(Request["searchDesc"]) ? 0 : Int32.Parse(Request["searchDesc"]); //排序方式
            int    type       = string.IsNullOrEmpty(Request["type"]) ? 0 : Int32.Parse(Request["type"]);             //查询条件选择
            string sea_name   = string.IsNullOrEmpty(Request["sea_name"]) ? "" : Request["sea_name"];                 //查询条件内容

            List <JMP.MDL.CoServiceFeeRatioGrade> list = new List <JMP.MDL.CoServiceFeeRatioGrade>();

            list = bll.SelectList(sea_name, type, searchDesc, pageIndexs, PageSize, out pageCount);

            ViewBag.searchDesc = searchDesc;
            ViewBag.type       = type;
            ViewBag.sea_name   = sea_name;
            ViewBag.pageIndexs = pageIndexs;
            ViewBag.PageSize   = PageSize;
            ViewBag.pageCount  = pageCount;
            ViewBag.list       = list;

            return(View());
        }
Пример #2
0
        public ActionResult ServiceFeeRatioGradeList()
        {
            JMP.BLL.CoServiceFeeRatioGrade bll   = new JMP.BLL.CoServiceFeeRatioGrade();
            JMP.MDL.CoServiceFeeRatioGrade model = new JMP.MDL.CoServiceFeeRatioGrade();
            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    searchDesc = string.IsNullOrEmpty(Request["searchDesc"]) ? 0 : Int32.Parse(Request["searchDesc"]); //排序方式
            string status     = string.IsNullOrEmpty(Request["status"]) ? "" : Request["status"];                     //工单状态
            string progress   = string.IsNullOrEmpty(Request["progress"]) ? "" : Request["progress"];                 //工单进度
            int    type       = string.IsNullOrEmpty(Request["type"]) ? 0 : Int32.Parse(Request["type"]);             //查询条件选择
            string stime      = string.IsNullOrEmpty(Request["r_begin"]) ? DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd") : Request["r_begin"];
            string etime      = string.IsNullOrEmpty(Request["r_end"]) ? DateTime.Now.ToString("yyyy-MM-dd") : Request["r_end"];
            string sea_name   = string.IsNullOrEmpty(Request["sea_name"]) ? "" : Request["sea_name"];//查询条件内容
            List <JMP.MDL.CoServiceFeeRatioGrade> list = new List <JMP.MDL.CoServiceFeeRatioGrade>();

            list = bll.SelectList(sea_name, type, searchDesc, pageIndexs, PageSize, out pageCount);
            ViewBag.searchDesc = searchDesc;
            ViewBag.type       = type;
            ViewBag.sea_name   = sea_name;
            ViewBag.stime      = stime;
            ViewBag.etime      = etime;
            ViewBag.pageIndexs = pageIndexs;
            ViewBag.PageSize   = PageSize;
            ViewBag.pageCount  = pageCount;
            ViewBag.list       = list;
            ViewBag.status     = status;
            ViewBag.progress   = progress;
            ViewBag.locUrl     = GetVoidHtml();
            return(View());
        }
Пример #3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public JMP.MDL.CoServiceFeeRatioGrade GetModel(int Id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select Id, CreatedByName, Name, ServiceFeeRatio, CustomerWithoutAgentRatio, BusinessPersonnelAgentRatio, AgentPushMoneyRatio, Description, CreatedOn, CreatedById  ");
            strSql.Append("  from CoServiceFeeRatioGrade ");
            strSql.Append(" where Id=@Id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Id", SqlDbType.Int, 4)
            };
            parameters[0].Value = Id;


            JMP.MDL.CoServiceFeeRatioGrade model = new JMP.MDL.CoServiceFeeRatioGrade();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["Id"].ToString() != "")
                {
                    model.Id = int.Parse(ds.Tables[0].Rows[0]["Id"].ToString());
                }
                model.CreatedByName = ds.Tables[0].Rows[0]["CreatedByName"].ToString();
                model.Name          = ds.Tables[0].Rows[0]["Name"].ToString();
                if (ds.Tables[0].Rows[0]["ServiceFeeRatio"].ToString() != "")
                {
                    model.ServiceFeeRatio = decimal.Parse(ds.Tables[0].Rows[0]["ServiceFeeRatio"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CustomerWithoutAgentRatio"].ToString() != "")
                {
                    model.CustomerWithoutAgentRatio = decimal.Parse(ds.Tables[0].Rows[0]["CustomerWithoutAgentRatio"].ToString());
                }
                if (ds.Tables[0].Rows[0]["BusinessPersonnelAgentRatio"].ToString() != "")
                {
                    model.BusinessPersonnelAgentRatio = decimal.Parse(ds.Tables[0].Rows[0]["BusinessPersonnelAgentRatio"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AgentPushMoneyRatio"].ToString() != "")
                {
                    model.AgentPushMoneyRatio = decimal.Parse(ds.Tables[0].Rows[0]["AgentPushMoneyRatio"].ToString());
                }
                model.Description = ds.Tables[0].Rows[0]["Description"].ToString();
                if (ds.Tables[0].Rows[0]["CreatedOn"].ToString() != "")
                {
                    model.CreatedOn = DateTime.Parse(ds.Tables[0].Rows[0]["CreatedOn"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CreatedById"].ToString() != "")
                {
                    model.CreatedById = int.Parse(ds.Tables[0].Rows[0]["CreatedById"].ToString());
                }

                return(model);
            }
            else
            {
                return(null);
            }
        }
Пример #4
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(JMP.MDL.CoServiceFeeRatioGrade model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update CoServiceFeeRatioGrade set ");

            strSql.Append(" CreatedByName = @CreatedByName , ");
            strSql.Append(" Name = @Name , ");
            strSql.Append(" ServiceFeeRatio = @ServiceFeeRatio , ");
            strSql.Append(" CustomerWithoutAgentRatio = @CustomerWithoutAgentRatio , ");
            strSql.Append(" BusinessPersonnelAgentRatio = @BusinessPersonnelAgentRatio , ");
            strSql.Append(" AgentPushMoneyRatio = @AgentPushMoneyRatio , ");
            strSql.Append(" Description = @Description , ");
            strSql.Append(" CreatedOn = @CreatedOn , ");
            strSql.Append(" CreatedById = @CreatedById  ");
            strSql.Append(" where Id=@Id ");

            SqlParameter[] parameters =
            {
                new SqlParameter("@Id",                          SqlDbType.Int,        4),
                new SqlParameter("@CreatedByName",               SqlDbType.NVarChar,  50),
                new SqlParameter("@Name",                        SqlDbType.NVarChar,  50),
                new SqlParameter("@ServiceFeeRatio",             SqlDbType.Decimal,    5),
                new SqlParameter("@CustomerWithoutAgentRatio",   SqlDbType.Decimal,    5),
                new SqlParameter("@BusinessPersonnelAgentRatio", SqlDbType.Decimal,    5),
                new SqlParameter("@AgentPushMoneyRatio",         SqlDbType.Decimal,    5),
                new SqlParameter("@Description",                 SqlDbType.NVarChar,  -1),
                new SqlParameter("@CreatedOn",                   SqlDbType.DateTime),
                new SqlParameter("@CreatedById",                 SqlDbType.Int, 4)
            };

            parameters[0].Value = model.Id;
            parameters[1].Value = model.CreatedByName;
            parameters[2].Value = model.Name;
            parameters[3].Value = model.ServiceFeeRatio;
            parameters[4].Value = model.CustomerWithoutAgentRatio;
            parameters[5].Value = model.BusinessPersonnelAgentRatio;
            parameters[6].Value = model.AgentPushMoneyRatio;
            parameters[7].Value = model.Description;
            parameters[8].Value = model.CreatedOn;
            parameters[9].Value = model.CreatedById;
            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #5
0
        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));
        }
Пример #6
0
        public ActionResult SerViceFeeRationGradeAdd()
        {
            int id = string.IsNullOrEmpty(Request["id"]) ? 0 : Int32.Parse(Request["id"]);

            JMP.BLL.CoServiceFeeRatioGrade bll   = new JMP.BLL.CoServiceFeeRatioGrade();
            JMP.MDL.CoServiceFeeRatioGrade model = new JMP.MDL.CoServiceFeeRatioGrade();
            if (id > 0)
            {
                model = bll.SelectId(id);
                model.AgentPushMoneyRatio         = decimal.Parse((model.AgentPushMoneyRatio * 100).ToString("f2"));
                model.BusinessPersonnelAgentRatio = decimal.Parse((model.BusinessPersonnelAgentRatio * 100).ToString("f2"));
                model.CustomerWithoutAgentRatio   = decimal.Parse((model.CustomerWithoutAgentRatio * 100).ToString("f2"));
                model.ServiceFeeRatio             = decimal.Parse((model.ServiceFeeRatio * 100).ToString("f2"));
            }
            ViewBag.model = model == null ? new JMP.MDL.CoServiceFeeRatioGrade() : model;
            return(View());
        }
Пример #7
0
        public JMP.MDL.CoServiceFeeRatioGrade GetModelByName(string Name)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select *  ");
            strSql.Append("from CoServiceFeeRatioGrade ");
            strSql.Append(" where ");
            strSql.Append(" Name = @Name");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Name", SqlDbType.NVarChar, 50)
            };
            parameters[0].Value = Name;
            JMP.MDL.CoServiceFeeRatioGrade model = new JMP.MDL.CoServiceFeeRatioGrade();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["id"].ToString() != "")
                {
                    model.Id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Name"].ToString() != "")
                {
                    model.Name = ds.Tables[0].Rows[0]["Name"].ToString();
                }
                if (ds.Tables[0].Rows[0]["ServiceFeeRatio"].ToString() != "")
                {
                    model.ServiceFeeRatio = decimal.Parse(ds.Tables[0].Rows[0]["ServiceFeeRatio"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CustomerWithoutAgentRatio"].ToString() != "")
                {
                    model.CustomerWithoutAgentRatio = decimal.Parse(ds.Tables[0].Rows[0]["CustomerWithoutAgentRatio"].ToString());
                }
                if (ds.Tables[0].Rows[0]["BusinessPersonnelAgentRatio"].ToString() != "")
                {
                    model.BusinessPersonnelAgentRatio = decimal.Parse(ds.Tables[0].Rows[0]["BusinessPersonnelAgentRatio"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Пример #8
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(JMP.MDL.CoServiceFeeRatioGrade model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into CoServiceFeeRatioGrade(");
            strSql.Append("CreatedByName,Name,ServiceFeeRatio,CustomerWithoutAgentRatio,BusinessPersonnelAgentRatio,AgentPushMoneyRatio,Description,CreatedOn,CreatedById");
            strSql.Append(") values (");
            strSql.Append("@CreatedByName,@Name,@ServiceFeeRatio,@CustomerWithoutAgentRatio,@BusinessPersonnelAgentRatio,@AgentPushMoneyRatio,@Description,@CreatedOn,@CreatedById");
            strSql.Append(") ");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@CreatedByName",               SqlDbType.NVarChar,  50),
                new SqlParameter("@Name",                        SqlDbType.NVarChar,  50),
                new SqlParameter("@ServiceFeeRatio",             SqlDbType.Decimal,    5),
                new SqlParameter("@CustomerWithoutAgentRatio",   SqlDbType.Decimal,    5),
                new SqlParameter("@BusinessPersonnelAgentRatio", SqlDbType.Decimal,    5),
                new SqlParameter("@AgentPushMoneyRatio",         SqlDbType.Decimal,    5),
                new SqlParameter("@Description",                 SqlDbType.NVarChar,  -1),
                new SqlParameter("@CreatedOn",                   SqlDbType.DateTime),
                new SqlParameter("@CreatedById",                 SqlDbType.Int, 4)
            };

            parameters[0].Value = model.CreatedByName;
            parameters[1].Value = model.Name;
            parameters[2].Value = model.ServiceFeeRatio;
            parameters[3].Value = model.CustomerWithoutAgentRatio;
            parameters[4].Value = model.BusinessPersonnelAgentRatio;
            parameters[5].Value = model.AgentPushMoneyRatio;
            parameters[6].Value = model.Description;
            parameters[7].Value = model.CreatedOn;
            parameters[8].Value = model.CreatedById;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Пример #9
0
        /// <summary>
        /// 添加或修改服务费等级信息
        /// </summary>
        /// <returns></returns>
        public JsonResult InsertUpdateSerViceFeeRationGrade(JMP.MDL.CoServiceFeeRatioGrade model)
        {
            object retJson = new { success = 0, msg = "操作失败" };

            JMP.BLL.CoServiceFeeRatioGrade bll = new JMP.BLL.CoServiceFeeRatioGrade();
            model.AgentPushMoneyRatio         = model.AgentPushMoneyRatio / 100;
            model.BusinessPersonnelAgentRatio = model.BusinessPersonnelAgentRatio / 100;
            model.CustomerWithoutAgentRatio   = model.CustomerWithoutAgentRatio / 100;
            model.ServiceFeeRatio             = model.ServiceFeeRatio / 100;
            var exists = bll.GetModelByName(model.Name);

            if (model.Id > 0)
            {
                // 修改
                JMP.MDL.CoServiceFeeRatioGrade oldmodel = new JMP.MDL.CoServiceFeeRatioGrade();
                oldmodel = bll.GetModel(model.Id);
                var oldmodelConle = oldmodel.Clone();
                oldmodel.Name                        = model.Name;
                oldmodel.ServiceFeeRatio             = model.ServiceFeeRatio;
                oldmodel.BusinessPersonnelAgentRatio = model.BusinessPersonnelAgentRatio;
                oldmodel.CustomerWithoutAgentRatio   = model.CustomerWithoutAgentRatio;
                oldmodel.AgentPushMoneyRatio         = model.AgentPushMoneyRatio;
                oldmodel.Description                 = model.Description;
                if (exists != null && model.Id != exists.Id)
                {
                    retJson = new { success = 0, msg = "此服务费级别名称已存在" };
                    return(Json(retJson));
                }
                if (bll.Update(oldmodel))
                {
                    Logger.ModifyLog("修改服务费等级信息", oldmodelConle, model);
                    RateLogger.ModifyLog("修改服务费等级信息", oldmodelConle, model);
                    retJson = new { success = 1, msg = "修改成功" };
                }
                else
                {
                    retJson = new { success = 0, msg = "修改失败" };
                }
            }
            else
            {
                model.CreatedOn     = DateTime.Now;
                model.CreatedById   = UserInfo.UserId;
                model.CreatedByName = UserInfo.UserName;

                if (exists != null)
                {
                    retJson = new { success = 0, msg = "此服务费级别名称已存在" };
                    return(Json(retJson));
                }
                int cg = bll.Add(model);
                if (cg > 0)
                {
                    Logger.CreateLog("添加服务费等级信息", model);
                    RateLogger.CreateLog("添加服务费等级信息", model);
                    retJson = new { success = 1, msg = "添加成功" };
                }
                else
                {
                    retJson = new { success = 1, msg = "添加失败" };
                }
            }
            return(Json(retJson));
        }