public ActionResult Form2(string id) { DepartmentBLL deptBll = new DepartmentBLL(); Operator user = OperatorProvider.Provider.Current(); var dept = deptBll.GetEntity(user.DeptId); if (dept == null) { user.DeptCode = "0"; } else if (dept.Nature == "部门") { var pdept = deptBll.GetEntity(dept.ParentId); user.DeptCode = pdept == null ? dept.EnCode : pdept.EnCode; } var model = new ToolInventoryEntity(); model.ID = Guid.NewGuid().ToString(); model.CreateDate = DateTime.Now; model.DeptId = user.DeptId; model.DeptCode = user.DeptCode == null ? "0" : user.DeptCode; if (!string.IsNullOrEmpty(id)) { model = tibll.GetEntity(id); } var entity = new DataItemBLL().GetEntityByName("工器具类型"); var list = new DataItemDetailBLL().GetList(entity.ItemId); ViewData["types"] = list.Select(x => new SelectListItem() { Value = x.ItemName, Text = x.ItemName }); return(View(model)); }
/// <summary> /// 保存表单(新增、修改) /// </summary> /// <param name="keyValue">主键值</param> /// <param name="entity">实体对象</param> /// <returns></returns> public void SaveForm(string keyValue, ToolInventoryEntity entity) { try { service.SaveForm(keyValue, entity); } catch (Exception) { throw; } }
public JsonResult SaveToolInventory(string id, ToolInventoryEntity model) { FileInfoBLL fibll = new FileInfoBLL(); tibll.SaveForm(model.ID, model); var files = fibll.GetFilesByRecIdNew(model.ID).Where(x => x.Description.Contains("二维码")); if (files.Count() == 0) { fibll.SaveForm(this.BuildImage(model.ID)); } return(Json(new { success = true, message = "操作成功" })); }
public ActionResult GlassWareVideo(string id) { ToolInventoryEntity d = tibll.GetEntity(id); ViewData["glasswarename"] = d.Name; string path = ""; FileInfoEntity f = new FileInfoEntity(); f = fileBll.GetFilesByRecIdNew(id).Where(x => x.Description == "1").FirstOrDefault(); if (f != null) { path = f.FilePath; } ViewBag.path = path; return(View()); }