public static bool 更新验收单(验收单 content) { return Mongo.更新(content); }
public static bool 添加验收单(验收单 content) { return Mongo.添加(content); }
public ActionResult Add_Service_Evaluate(验收单 model) { try { if (string.IsNullOrWhiteSpace(Request.Form["selectSh_unit"])) { return Content("<script>alert('没有这个验收单位编码!');window.location='/供应商后台/Service_Evaluate';</script>"); } else { 验收单 ysd = 验收单管理.查找验收单(long.Parse(Request.Form["selectSh_unit"].ToString())); var smjs = Request.Form["smj"].ToString(); var smjarr = smjs.Split(new[] { "|" }, StringSplitOptions.RemoveEmptyEntries); foreach (var item in smjarr) { ysd.验收单扫描件.Add(new _回传信息 { 回传单路径 = item }); } //if (!string.IsNullOrEmpty(Request.Form["zb_contact"])) //{ // try // { // model.所属项目.招标采购项目ID = int.Parse(Request.Form["zb_contact"]); // } // catch // { // } //} //model.服务信息.验收时间 = DateTime.Now; //model.供应商链接.用户ID = currentUser.Id; 验收单管理.更新验收单(ysd); return Content("<script>alert('添加成功!您可以继续添加');window.location='/供应商后台/Service_Evaluate';</script>"); } } catch { return Redirect("/供应商后台/AddAcceptanceForm"); } }
public ActionResult Editform(验收单 ysd) { string[] attachPath = Request.Form["pic"].ToString().Split('|'); string[] price = Request.Form["attachSum"].ToString().Split(','); List<验收单._物资或服务条目> list = new List<验收单._物资或服务条目>(); if (ysd.物资服务列表 != null && ysd.物资服务列表.Count() != 0) { for (int k = 0; k < ysd.物资服务列表.Count(); k++)//去除物资列表中信息为空的内容 { if (ysd.物资服务列表[k].单价 == 0 && ysd.物资服务列表[k].数量 == 0) { continue; } else { list.Add(ysd.物资服务列表[k]); } } } 验收单 y = 验收单管理.查找验收单(ysd.Id); y.供货单位开票人 = ysd.供货单位开票人; y.管理单位审核人.用户ID = ysd.管理单位审核人.用户ID; y.收货单位 = ysd.收货单位; y.某批物资名称 = ysd.某批物资名称; List<_其他费用> other_cost = new List<_其他费用>(); foreach (var mm in ysd.其他费用) { if (!string.IsNullOrWhiteSpace(mm.费用名称) && mm.金额 != 0) { other_cost.Add(mm); } } y.其他费用 = other_cost; y.服务费 = ysd.服务费; y.维修费 = ysd.维修费; y.运费 = ysd.运费; y.物资服务列表 = list; List<_验收单附件> ysdlist = new List<_验收单附件>(); if (y.验收单附件 != null) { ysdlist = y.验收单附件; } for (int j = 0; j < attachPath.Length - 1; j++) { _验收单附件 attach = new _验收单附件(); attach.附件路径 = attachPath[j]; attach.价格 = decimal.Parse(price[j]); ysdlist.Add(attach); } if (y.验收单附件 != null) { for (int m = 0; m < y.验收单附件.Count(); m++) { if (!System.IO.File.Exists(Server.MapPath(@y.验收单附件[m].附件路径))) { y.验收单附件.Remove(y.验收单附件[m]); } } } //y.物资服务列表 = ysd.物资服务列表; 验收单管理.更新验收单(y); return Redirect("/供应商后台/EditForm?id=" + ysd.Id); }
public ActionResult AddAcceptence(验收单 model) { string[] attachPath = Request.Form["pic"].ToString().Split('|'); string[] price = Request.Form["attachSum"].ToString().Split(','); var cost = Request.Form["costJson"]; List<验收单._物资或服务条目> list = new List<验收单._物资或服务条目>(); foreach (var k in model.物资服务列表)//去除物资列表中信息为空的内容 { if (k.单价 >= 0 && k.数量 >= 0 && k.总价 >= 0 && k.商品链接.商品ID != -1) { list.Add(k); } } 验收单 ysd = new 验收单(); ysd.供应商链接.用户ID = currentUser.Id; ysd.收货单位 = model.收货单位; ysd.管理单位审核人.用户ID = model.管理单位审核人.用户ID; ysd.供货单位开票人 = model.供货单位开票人; ysd.物资服务列表 = list; if (!string.IsNullOrWhiteSpace(cost)) { var costs = cost.Split(';'); foreach (var k in costs) { ysd.其他费用.Add(new _其他费用() { 费用名称 = k.Split(',')[0], 金额 = decimal.Parse(k.Split(',')[1]), }); } } ysd.维修费 = model.维修费; ysd.运费 = model.运费; ysd.服务费 = model.服务费; ysd.某批物资名称 = model.某批物资名称; for (int j = 0; j < attachPath.Length - 1; j++) { _验收单附件 attach = new _验收单附件(); attach.附件路径 = attachPath[j]; attach.价格 = decimal.Parse(price[j]); ysd.验收单附件.Add(attach); } if (!string.IsNullOrWhiteSpace(ysd.收货单位) && ysd.管理单位审核人.用户ID != -1 && !string.IsNullOrWhiteSpace(ysd.供货单位开票人)) { 验收单管理.添加验收单(ysd); } else { throw new Exception("信息不完善!"); } return Redirect("/供应商后台/AddAcceptanceForm"); }
public Acceptance() { this.Y = new 验收单(); }
public ActionResult Part_Service_Evaluate() { if (currentUser.审核数据.审核状态 == 审核状态.审核通过) { ViewBag.Shen = true; } else { ViewBag.Shen = false; } ViewData["行业列表"] = 商品分类管理.查找子分类(); IEnumerable<招标采购项目> l = 招标采购项目管理.查询招标采购项目(0, 0, MongoDB.Driver.Builders.Query.EQ("审核数据.审核状态", 审核状态.审核通过).And(MongoDB.Driver.Builders.Query.NE("中标公告链接.公告ID", -1))); ViewData["需求列表"] = l; 验收单 item = new 验收单(); var Iysd = new List<验收单>(); var ysd_number = 验收单管理.查询验收单(0, 0, Query<验收单>.Where(o => o.是否已经打印 && !o.是否作废 && o.供应商链接.用户ID == currentUser.Id)); foreach (var k in ysd_number) { if ((k.打印信息.Count > 0 && k.打印信息.Last().打印时间.AddDays(20) > DateTime.Now) || k.扫描件审核状态 == "审核未通过") { Iysd.Add(k); } } ViewData["验收单号"] = Iysd; //TD:先检查用户是否持有U盾,且未过期 var payysd = "0"; var gys = 用户管理.查找用户<供应商>(currentUser.Id); if (!string.IsNullOrWhiteSpace(gys.供应商用户信息.U盾信息.序列号) && !string.IsNullOrWhiteSpace(gys.供应商用户信息.U盾信息.加密参数) && gys.供应商用户信息.U盾信息.年检结束时间 > DateTime.Now) { payysd = "1"; } ViewData["id"] = currentUser.Id; ViewData["是否持有U盾"] = payysd; if (payysd == "1") { Random randomGenerator = new Random(DateTime.Now.Millisecond); String RndStr = ""; for (int i = 0; i < 32; i++) RndStr += Convert.ToChar(randomGenerator.Next(97, 122)); ViewData["Message"] = RndStr; } ViewData["供应商ID"] = currentUser.Id; //先检查用户是否持有U盾,且未过期 return PartialView("Gys_Part/Part_Service_Evaluate", item); }