CustomerreceptionController

目录

[1、 CustomerreceptionController](#1、 CustomerreceptionController)

[1.1、 查询客户接待单据信息](#1.1、 查询客户接待单据信息)

[1.1.1、 //修理类别名称](#1.1.1、 //修理类别名称)

[1.1.2、 //单据状态名称](#1.1.2、 //单据状态名称)

[1.1.3、 //客户编号](#1.1.3、 //客户编号)

[1.2、 CompletionDates](#1.2、 CompletionDates)

  1. CustomerreceptionController

using QXQPS.Models;

using QXQPS.Vo;

using System;

using System.Collections;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Web;

using System.Web.Mvc;

namespace QXQPS.Areas.MechanicsManagment.Controllers

{

public class CustomerreceptionController : Controller

{

// GET: MechanicsManagment/Customerreception

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

    1. 查询客户接待单据信息

public ActionResult SelectReception(BsgridPage bsgridPage, string ToAudit, string MaintenanceNum,string CarNum,int DocumentStateID,int BalanceStateID)//查询客户接待单据信息

{

var lingItem = (from tbReception in myModels.PW_Reception

join tbRepair in myModels.SYS_Repair on tbReception.RepairID equals tbRepair.RepairID

join tbDocumentState in myModels.SYS_DocumentState on tbReception.DocumentStateID equals tbDocumentState.DocumentStateID

join tbBalanceState in myModels.SYS_BalanceState on tbReception.BalanceStateID equals tbBalanceState.BalanceStateID

join tbCustomerSou in myModels.SYS_CustomerSou on tbReception.CustomerSouID equals tbCustomerSou.CustomerSouID

select new ReceptionVo

{

ReceptionID = tbReception.ReceptionID,//客户接待ID

RepairID = tbReception.RepairID,//修理类别ID

RepairName = tbRepair.RepairName.Trim(),

      1. //修理类别名称

CustomerSouID = tbReception.CustomerSouID,//客户来源ID

CustomerSou = tbCustomerSou.CustomerSou.Trim(),//客户来源名称

DocumentStateID=tbDocumentState.DocumentStateID,//单据状态ID

DocumentState = tbDocumentState.DocumentState.Trim(),

      1. //单据状态名称

BalanceStateID =tbBalanceState.BalanceStateID,//结算状态ID

BalanceState = tbBalanceState.BalanceState.Trim(),//结算状态名称

CarNum = tbReception.CarNum.Trim(),//车牌

CustomerNum=tbReception.CustomerNum.Trim(),

      1. //客户编号

VehicleType = tbReception.VehicleType.Trim(),//车型

Carder = tbReception.Carder.Trim(),//接车人名称

Mileage = tbReception.Mileage.Trim(),//进厂里程

MaintenanceNum = tbReception.MaintenanceNum.Trim(),//维修单号

Owner = tbReception.Owner.Trim(),//车主

Address = tbReception.Address.Trim(),//地址

OilQuantity = tbReception.OilQuantity.Trim(),//油量

OwnerTele = tbReception.OwnerTele,//车主电话

EngineNum = tbReception.EngineNum.Trim(),//发动机号码

Repairman = tbReception.Repairman.Trim(),//送修人

SelfCoding = tbReception.SelfCoding.Trim(),//自编号

FrameNum = tbReception.FrameNum,//车架号码

RepairmanTele = tbReception.RepairmanTele,//送修人电话

OpenDates = tbReception.OpenDate.ToString(),//开单日期

FactoryDates = tbReception.FactoryDate.ToString(),//进厂日期

BalanceDates = tbReception.BalanceDate.ToString(),//结算日期

openDates = tbReception.OpenDate.ToString(),//开单日期

factoryDates = tbReception.FactoryDate.ToString(),//进厂日期

balanceDates = tbReception.BalanceDate.ToString(),//结算日期

Amount = tbReception.Amount,//总金额

AmountPaid = tbReception.AmountPaid,//应收金额

Describe=tbReception.Describe.Trim(),//描述

ToAudit =tbReception.ToAudit,//审核否

CompletionDates = tbReception.CompletionDate.ToString() != null ? tbReception.CompletionDate.ToString() : "0000-00-00",//完工日期

ToSendWork =tbReception.ToSendWork,//派工状态

CollageState=tbReception.CollageState.Trim(),//领料状态

MaintenAmount =tbReception.MaintenAmount,//维修总费

}).ToList();

#region 拼接条件

if (!string.IsNullOrEmpty(MaintenanceNum))

{

lingItem = lingItem.Where(m => m.MaintenanceNum.Contains(MaintenanceNum)).ToList();

}

if (!string.IsNullOrEmpty(CarNum))

{

lingItem = lingItem.Where(m => m.CarNum==CarNum).ToList();

}

if (!string.IsNullOrEmpty(ToAudit))

{

if (ToAudit == "true")

{

lingItem = lingItem.Where(m => m.ToAudit == true).ToList();

}

else

{

lingItem = lingItem.Where(m => m.ToAudit == false).ToList();

}

}

if (DocumentStateID>0)

{

lingItem = lingItem.Where(m => m.DocumentStateID == DocumentStateID).ToList();

}

if (BalanceStateID > 0)

{

lingItem = lingItem.Where(m => m.BalanceStateID == BalanceStateID).ToList();

}

#endregion

int count = lingItem.Count();

List<ReceptionVo> listReception = lingItem.OrderBy(m => m.ToAudit).Skip(bsgridPage.GetStartIndex()).Take(bsgridPage.pageSize).ToList();

Bsgrid<ReceptionVo> bsgrid = new Bsgrid<ReceptionVo>()

{

success = true,

totalRows = count,

curPage = bsgridPage.curPage,

data = listReception

};

return Json(bsgrid, JsonRequestBehavior.AllowGet);

}

    1. CompletionDates

private string completionDate;//生日

public string CompletionDates

{

set

{

try

{

DateTime dt = Convert.ToDateTime(value);

completionDate = dt.ToString("yyyy/MM/dd");

}

catch (Exception)

{

completionDate = value;

}

}

get

{

return completionDate;

}

}//生日

相关推荐
想做白天梦28 分钟前
多级反馈队列
java·windows·算法
会写代码的孙悟空11 小时前
windows下解决端口被占用,但是找不到占用端口的应用程序;以一种访问权限不允许的方式做了一个访问套接字的尝试;搜索可用端口
运维·网络·windows
sukalot12 小时前
windows 驱动实例分析系列: NDIS 6.0的Filter 驱动改造(二)
windows
喜欢打篮球的普通人13 小时前
2024 Rust现代实用教程:1.3获取rust的库国内源以及windows下的操作
开发语言·windows·rust
sukalot14 小时前
windows 驱动实例分析系列: NDIS 6.0的Filter 驱动改造(四)
windows·单片机·嵌入式硬件
微雨盈萍cbb16 小时前
Windows 上更新OpenSSL 到 1.1.1
windows
askah664416 小时前
无法启动此程序win10玩游戏找不到d3dx9_43.dll缺失的五种常用有效解决方法
windows·游戏·电脑·dll丢失·1024程序员节
admin_2331 天前
rsync部署 附报错解决、配置详解及Windows脚本
windows
cpp_learners1 天前
Windows环境 ffmpeg 命令使用介绍
windows·ffmpeg·ffmpeg命令