自学内容网 自学内容网

SalescustomerController

目录

1、 SalescustomerController

1.1、 Sales

1.2、 /// 销售客户单号

1.3、 /// 查询客户区域

using QXQPS.Models;

using QXQPS.Vo;

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.Mvc;

namespace QXQPS.Areas.BasicdataManagment.Controllers

{

  1. SalescustomerController 

    public class SalescustomerController : Controller

    {

        // GET: BasicdataManagment/Salescustomer

        Models.QXQPEntities myModels = new Models.QXQPEntities();

    1. Sales

        public ActionResult Sales()//销售客户设置

        {

            return View();

        }

        /// <summary>

    1.         /// 销售客户单号

        /// </summary>

        /// <returns></returns>

        public ActionResult Num()

        {

            string Num = "";

            var Time = DateTime.Now.ToString("yyyyMMdd");

            try

            {

                int Count = myModels.SYS_SalesCustomer.Where(m => m.CustomerCode.Contains(Time)).Count() + 1;

                if (Count < 10)

                {

                    Num = "XSKH" + "-" + Time + "000" + Count;

                }

                else if (Count > 9 && Count < 100)

                {

                    Num = "XSKH" + "-" + Time + "00" + Count;

                }

                else if (Count > 99 && Count < 1000)

                {

                    Num = "XSKH" + "-" + Time + "0" + Count;

                }

            }

            catch (Exception)

            {

                return Json(Num, JsonRequestBehavior.AllowGet);

            }

            return Json(Num, JsonRequestBehavior.AllowGet);

        }

        /// <summary>

    1.         /// 查询客户区域

        /// </summary>

        /// <returns></returns>

        public ActionResult SelectRegion()

        {

            var list = from tbRegion in myModels.SYS_Region

                       select tbRegion;

            return Json(list, JsonRequestBehavior.AllowGet);

        }

        /// <summary>


原文地址:https://blog.csdn.net/weixin_42132177/article/details/142355747

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!