SalescustomerController
目录
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
{
public class SalescustomerController : Controller
{
// GET: BasicdataManagment/Salescustomer
Models.QXQPEntities myModels = new Models.QXQPEntities();
public ActionResult Sales()//销售客户设置
{
return View();
}
/// <summary>
/// </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>
/// </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)!