目录
1、 ClaimsettlementController
1.1、 保存三包表
1.2、 审核预约单
1.3、 反审核预约单
using QXQPS.Models;
using QXQPS.Vo;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace QXQPS.Areas.MechanicsManagment.Controllers
{
public class ClaimsettlementController : Controller
{
// GET: MechanicsManagment/Claimsettlement
Models.QXQPEntities myModels = new Models.QXQPEntities();
public ActionResult BavaThreePacks(List<PW_ThreePacks> listThreePacks,int ClaimComID)//保存三包表
{
var ThreePacksID = 0;
try
{
if (listThreePacks[0].ThreePacksID == 0)
{
myModels.PW_ThreePacks.Add(listThreePacks[0]);
}
else {
myModels.Entry(listThreePacks[0]).State = System.Data.Entity.EntityState.Modified;
}
var ThreePacksDetailID = listThreePacks[0].ThreePacksDetailID;
var listThreePacksDetail = myModels.SYS_ThreePacksDetail.Where(m => m.ThreePacksDetailID == ThreePacksDetailID).Single();
listThreePacksDetail.ClaimComID = ClaimComID;
myModels.Entry(listThreePacksDetail).State = System.Data.Entity.EntityState.Modified;
myModels.SaveChanges();
ThreePacksID = listThreePacks[0].ThreePacksID;
}
catch (Exception)
{
return Json(false, JsonRequestBehavior.AllowGet);
}
return Json(ThreePacksID, JsonRequestBehavior.AllowGet);
}
public ActionResult ToAudit(int ThreePacksID)//审核预约单
{
try
{
var list = myModels.PW_ThreePacks.Where(m => m.ThreePacksID == ThreePacksID).Single();
list.ToAudit = true;
myModels.Entry(list).State = System.Data.Entity.EntityState.Modified;
myModels.SaveChanges();
}
catch (Exception)
{
return Json(false, JsonRequestBehavior.AllowGet);
}
return Json(true, JsonRequestBehavior.AllowGet);
}
public ActionResult ToNotAudit(int ThreePacksID)//反审核预约单
{
try
{
var list = myModels.PW_ThreePacks.Where(m => m.ThreePacksID == ThreePacksID).Single();
list.ToAudit = false;
myModels.Entry(list).State = System.Data.Entity.EntityState.Modified;
myModels.SaveChanges();
}
catch (Exception)
{
return Json(false, JsonRequestBehavior.AllowGet);
}
return Json(true, JsonRequestBehavior.AllowGet);
}