CRM.Web/Controllers/CustomerManagerController.cs

(开头部分) 14KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CRM.Model;
using CRM.BLL;

namespace CRM.Web.Controllers
{
    [MyException]
    [LoginValidator]
    public class CustomerManagerController : BaseController
    {
        #region 客户信息

        //
        // GET: /CustomerManager/
        /// <summary>
        /// 客户信息
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            cst_customer searchEntity = new cst_customer();
            ViewData["pagerHelper"] = new PageHelper<cst_customer>(new cst_customerService().GetCustomersBySearchEntity(searchEntity), 1, PageSize);
            ViewData["region"] = new SelectList(new bas_dictService().GetDictsByType("地区"), "dict_value", "dict_item");
            ViewData["level"] = new SelectList(new bas_dictService().GetDictsByType("客户等级"), "dict_value", "dict_item");
            return View(new cst_customer());
        }

        /// <summary>
        /// 客户信息查询
        /// </summary>
        /// <param name="forms"></param>
        /// <returns></returns>
        [HttpPost]
        public ActionResult Index(FormCollection forms)
        {
            int curPage = int.Parse(forms["curPage"]);
            cst_customer searchEntity = new cst_customer();
            UpdateModel<cst_customer>(searchEntity);
            ViewData["pagerHelper"] = new PageHelper<cst_customer>(new cst_customerService().GetCustomersBySearchEntity(searchEntity), curPage, PageSize);
            ViewData["region"] = new SelectList(new bas_dictService().GetDictsByType("地区"), "dict_value", "dict_item");
            ViewData["level"] = new SelectList(new bas_dictService().GetDictsByType("客户等级"), "dict_value", "dict_item");
            return View(searchEntity);
        }

        public ActionResult Delete(int? id)
        {
            new cst_customerService().DeleteCustomerById(id.Value);
            return RedirectToAction("Index");
        }

        public ActionResult AddUser()
        {
            ViewData["region"] = new SelectList(new bas_dictService().GetDictsByType("地区"), "dict_value", "dict_item");
            ViewData["sys_user"] = new SelectList(new sys_userService().GetAllWaiter(), "usr_id", "usr_name");
            ViewData["level"] = new SelectList(new bas_dictService().GetDictsByType("客户等级"), "dict_value", "dict_item");
            ViewData["satisfy"] = new SelectList(new bas_dictService().GetDictsByType("客户满意度"), "dict_value", "dict_item");
后面还有 295 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。