コード例 #1
0
ファイル: HomeController.cs プロジェクト: burchin/Contract
        /// <summary>
        /// 获取客户渠道类型数据
        /// </summary>
        /// <returns></returns>
        public JsonResult drpChannelTypeList()
        {
            DaCustomerInfo dal = new DaCustomerInfo();
            IList<ChannelType> types = dal.getChannelTypeList();

            var result = new CustomJsonResult();
            result.Data = types;
            return result;
        }
コード例 #2
0
        /// <summary>
        /// 客户有效期设置界面
        /// </summary>
        /// <returns></returns>
        public ActionResult Validity()
        {
            DaCustomerInfo dal = new DaCustomerInfo();
            ViewBag.days = dal.getCustomerValidity();
            ViewBag.menu = 8;

            return View();
        }
コード例 #3
0
        /// <summary>
        /// 设置客户有效期
        /// </summary>
        /// <param name="days">天数</param>
        /// <returns></returns>
        public JsonResult Validity_edit(string days)
        {
            DaCustomerInfo dal = new DaCustomerInfo();
            var result = new CustomJsonResult();
            result.Data = dal.setCustomerValidity(days);

            return result;
        }
コード例 #4
0
        /// <summary>
        /// 搜索客户列表
        /// </summary>
        /// <param name="name">客户名称</param>
        /// <param name="type">客户类型</param>
        /// <param name="salesman">业务员</param>
        /// <returns></returns>
        public JsonResult Customer_search(string name, string type, string salesman)
        {
            CustomerInfo en = new CustomerInfo();
            en.name = name;

            if (type.Trim() != "")
                en.channelTypeID = Convert.ToInt32(type);

            if (salesman.Trim() != "")
                en.salesmanID = Convert.ToInt32(salesman);

            DaCustomerInfo dal = new DaCustomerInfo();
            var result = new CustomJsonResult();
            result.Data = dal.getList(en, BaseHelper.getCookie().id.ToString());
            return result;
        }
コード例 #5
0
        /// <summary>
        /// 删除客户
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public JsonResult Customer_remove(string id)
        {
            CustomerInfo en = new CustomerInfo();
            en.id = Convert.ToInt32(id);

            DaCustomerInfo dal = new DaCustomerInfo();
            var result = new CustomJsonResult();
            result.Data = dal.delete(en);
            return result;
        }
コード例 #6
0
        /// <summary>
        /// 获取客户列表
        /// </summary>
        /// <returns></returns>
        public JsonResult Customer_getList()
        {
            DaCustomerInfo dal = new DaCustomerInfo();
            IList<CustomerInfo> customers = dal.getList(BaseHelper.getCookie().id.ToString());

            var result = new CustomJsonResult();
            result.dateFormat = "yyyy-MM-dd";
            result.Data = new { total = customers.Count, rows = customers };
            return result;
        }
コード例 #7
0
        public JsonResult Customer_edit(string id, string name, string type, string person, string tel, string officeTel, string eMail, string fex, string address, string state)
        {
            CustomerInfo en = new CustomerInfo();
            en.id = Convert.ToInt32(id);
            en.name = name;
            en.channelTypeID = Convert.ToInt32(type);
            en.person = person;
            en.tel = tel;
            en.officeTel = officeTel;
            en.email = eMail;
            en.fex = fex;
            en.address = address;
            en.stateID = state;

            DaCustomerInfo dal = new DaCustomerInfo();
            var result = new CustomJsonResult();
            result.Data = dal.update(en);
            return result;
        }
コード例 #8
0
        public JsonResult Customer_add(string name, string type, string person, string tel, string officeTel, string eMail, string fex, string address, string state)
        {
            CustomerInfo en = new CustomerInfo();
            en.name = name;
            en.channelTypeID = Convert.ToInt32(type);
            en.person = person;
            en.tel = tel;
            en.officeTel = officeTel;
            en.email = eMail;
            en.fex = fex;
            en.address = address;
            en.salesmanID = BaseHelper.getCookie().id;
            en.stateID = state;

            DaCustomerInfo dal = new DaCustomerInfo();
            var result = new CustomJsonResult();
            result.Data = dal.add(en);
            return result;
        }