//下拉式選單讀任務類別 public JsonResult GetEventClassRead(string type) { var db = new NSMMSEntities(); var temp = eventClassRespository.ReadEventClassList().ToList(); if(type == "1") temp.Add(new EventClassViewModel { Class = "C01&M01", Name = "C01 : 叫修 + M01 : 保養" }); //return Json(db.EventClass.Select(p => new { Name = p.Name, Class = p.Class }), JsonRequestBehavior.AllowGet); return Json(temp.AsQueryable().Select(p => new { Name = p.Name, Class = p.Class }).OrderBy(x => x.Name), JsonRequestBehavior.AllowGet); }
public JsonResult GetKnowledgeList() { var db = new NSMMSEntities(); return Json(db.KnowledgeBase.Select(p => new { KnowledgeID = p.KnowledgeID, Name = p.FileName }), JsonRequestBehavior.AllowGet); }
////// //手機零件選擇(改外部篩選) public JsonResult GetMaterialList(string str) { var db = new NSMMSEntities(); var temp = db.ProductData.Select(p => new { ProductNum = p.ProductNum, Name = p.Name + " - " + p.ProductID }); if (str != null && str != "") temp = temp.Where(x => x.Name.Contains(str)); var jsonResult = Json(temp, JsonRequestBehavior.AllowGet); jsonResult.MaxJsonLength = int.MaxValue; return jsonResult; //return Json(db.ProductData.Select(p => new { ProductNum = p.ProductNum, Name = p.Name }), JsonRequestBehavior.AllowGet); }
//下拉式選單讀大區分類 public JsonResult GetAreaRead() { var db = new NSMMSEntities(); return Json(db.Area.Select(p => new { Name = p.Name, AreaID = p.AreaID }), JsonRequestBehavior.AllowGet); }
public FilesRepository() { this.db = new NSMMSEntities(); }
public ContractRespositiory() { this.db = new NSMMSEntities(); }
public AlertSettingRepository() { this.db = new NSMMSEntities(); }
public RoleRespositiory() { this.db = new NSMMSEntities(); }
public JsonResult GetPhrase() { var db = new NSMMSEntities(); return Json(db.QuestionPhrase.Select(p => new { Note = p.Note }), JsonRequestBehavior.AllowGet); }
public JsonResult GetCustomerDetail(int CRef) { var db = new NSMMSEntities(); CustomerViewModel t = new CustomerViewModel(); t = db.Customer.Where(x => x.CustomerRef == CRef).Select(c => new CustomerViewModel { CustomerStatus = c.CustomerStatus, CustomerRef = c.CustomerRef, FullName = c.FullName, ShortName = c.ShortName, PostalCode = c.PostalCode, Addr = c.Addr, Phone1 = c.Phone1, Phone2 = c.Phone2, Fax = c.Fax, ContactPersonName = c.ContactPersonName, ContactPersonPhone = c.ContactPersonPhone, UniformNumbers = c.UniformNumbers, Notes = c.Notes, GroupSW = c.GroupSW, GroupID = c.GroupID, BranchID = c.BranchID, ResponsibleID = c.ResponsibleID, RegionID = c.RegionID, DefaultUserName = c.SubArea.ResponsibleClass.UserData2.UserName }).First(); var jsonResult = Json(t, JsonRequestBehavior.AllowGet); jsonResult.MaxJsonLength = int.MaxValue; return jsonResult; //return Json(lookupList, JsonRequestBehavior.AllowGet); }
//public JsonResult GetCustomers() //{ // var db = new NSMMSEntities(); // return Json(db.Customer.Select(c => new { CustomerID = c.CustomerID, CustomerSName = c.ShortName }), JsonRequestBehavior.AllowGet); //} //public JsonResult GetCustomerList(string CGroupSW, string CGroupID, string Area) //{ // var db = new NSMMSEntities(); // var lookupList = new List<CustomerViewModel>(); // var qry = db.Customer.Where(x => x.CustomerRef != 0 && x.CustomerStatus != "0"); // if (CGroupSW != null && CGroupSW != "") // { // qry = qry.Where(x => x.GroupSW == CGroupSW && x.GroupID != null); // } // if (CGroupID != null && CGroupID != "") // { // qry = qry.Where(x => x.GroupID == CGroupID); // } // if (Area != null && Area != "") // { // qry = qry.Where(x => x.SubArea.AreaID == Area); // } // lookupList = qry.Select(c => new CustomerViewModel // { // CustomerStatus = c.CustomerStatus, // CustomerRef = c.CustomerRef, // FullName = c.FullName, // ShortName = c.ShortName, // PostalCode = c.PostalCode, // Addr = c.Addr, // Phone1 = c.Phone1, // Phone2 = c.Phone2, // Fax = c.Fax, // ContactPersonName = c.ContactPersonName, // ContactPersonPhone = c.ContactPersonPhone, // UniformNumbers = c.UniformNumbers, // Notes = c.Notes, // GroupSW = c.GroupSW, // GroupID = c.GroupID, // BranchID = c.BranchID, // ResponsibleID = c.ResponsibleID, // RegionID = c.RegionID, // DefaultUserName = c.SubArea.ResponsibleClass.UserData2.UserName // }).ToList(); // lookupList.Where(w => w.CustomerStatus == "0").ToList().ForEach(s => s.ShortName += " - 停用"); // //foreach (var item in lookupList) // // if (item.CustomerStatus == "0") // // item.ShortName += "-停用"; // var jsonResult = Json(lookupList.OrderBy(x => x.ShortName), JsonRequestBehavior.AllowGet); // jsonResult.MaxJsonLength = int.MaxValue; // return jsonResult; // //return Json(lookupList, JsonRequestBehavior.AllowGet); //} public JsonResult GetCustomerList(string CGroupSW, string CGroupID, string Area) { var db = new NSMMSEntities(); var lookupList = new List<CustomerViewModel2>(); var qry = db.Customer.Where(x => x.CustomerRef != 0 && x.CustomerStatus != "0"); if (CGroupSW != null && CGroupSW != "") { qry = qry.Where(x => x.GroupSW == CGroupSW && x.GroupID != null); } if (CGroupID != null && CGroupID != "") { qry = qry.Where(x => x.GroupID == CGroupID); } if (Area != null && Area != "") { qry = qry.Where(x => x.SubArea.AreaID == Area); } lookupList = qry.Select(c => new CustomerViewModel2 { CustomerStatus = c.CustomerStatus, CustomerRef = c.CustomerRef, //FullName = c.FullName, ShortName = c.ShortName, }).ToList(); lookupList.Where(w => w.CustomerStatus == "0").ToList().ForEach(s => s.ShortName += " - 停用"); //foreach (var item in lookupList) // if (item.CustomerStatus == "0") // item.ShortName += "-停用"; var jsonResult = Json(lookupList.OrderBy(x=>x.ShortName), JsonRequestBehavior.AllowGet); jsonResult.MaxJsonLength = int.MaxValue; return jsonResult; //return Json(lookupList, JsonRequestBehavior.AllowGet); }
public JsonResult GetCascadeQuestions(int? item) { var db = new NSMMSEntities(); var questionClass = db.QuestionClass.AsQueryable(); if (item != null) { questionClass = questionClass.Where(q => q.ItemClassID == item); } return Json(questionClass.Select(q => new { QuestionID = q.QuestionClassID, QuestionName = q.Note }), JsonRequestBehavior.AllowGet); }
public JsonResult GetCascadeItems(int? product) { var db = new NSMMSEntities(); var itemClass = db.ItemClass.AsQueryable(); if (product != null) { itemClass = itemClass.Where(i => i.ProductClassID == product); } return Json(itemClass.Select(i => new { ItemID = i.ItemClassID, ItemName = i.Note }), JsonRequestBehavior.AllowGet); }
public JsonResult GetCascadeProducts() { var db = new NSMMSEntities(); return Json(db.ProductClass.Select(p => new { ProductID = p.ProductClassID, ProductName = p.Note }), JsonRequestBehavior.AllowGet); }
//取得合約產品 public JsonResult GetProductID() { var db = new NSMMSEntities(); return Json(db.ProductData.Where(x=>x.ProductClassID != null).Select(p => new { ProductID = p.ProductID, ProductName = p.Name }), JsonRequestBehavior.AllowGet); }
public AssignSettingRepository() { this.db = new NSMMSEntities(); }
public QuestionRespositiory() { this.db = new NSMMSEntities(); }
public JsonResult GetCCProduct(string CustomerRef) { var db = new NSMMSEntities(); var jsonResult = Json(contractRespositiory.ReadProduct(CustomerRef), JsonRequestBehavior.AllowGet); jsonResult.MaxJsonLength = int.MaxValue; return jsonResult; //return Json(db.ProductClass.Select(p => new { ProductID = p.ProductClassID, ProductName = p.Note }), JsonRequestBehavior.AllowGet); }
public EventClassRespository() { this.db = new NSMMSEntities(); }
//以下為工作任務指派管理頁面 public ActionResult WBSAssignMain(string area, string cid, string data) { if (!User.Identity.IsAuthenticated) return RedirectToAction("Logon", "Account"); // 先取得該使用者的 FormsIdentity FormsIdentity id = (FormsIdentity)User.Identity; // 再取出使用者的 FormsAuthenticationTicket FormsAuthenticationTicket ticket = id.Ticket; String roleID = userDataRepository.GetUserRole(ticket.Name); if (!roleToMFucRespositiory.CheckedRoleFunction(roleID, 400)) return RedirectToAction("MainPage", "Home"); ViewBag.RoleID = roleID; if (Session["removeMenuButton"] == null) Session.Add("removeMenuButton", roleToMFucRespositiory.GetRemoveButtonName(roleID)); ViewBag.RemoveMenu = Session["removeMenuButton"]; ViewBag.area = area; ViewBag.cid = cid; ViewBag.data = data; NSMMSEntities db = new NSMMSEntities(); List<PageRemarkViewModel> list = new List<PageRemarkViewModel>(); list.Add(pageRemarkRespositiory.Read(17)); ViewData["PageRemark"] = list; return View(db.Area); //return View(); }
public PageRemarkRespositiory() { this.db = new NSMMSEntities(); }
public MessageRepository() { this.db = new NSMMSEntities(); }
public AreaRespositiory() { this.db = new NSMMSEntities(); }
public ResponsibleClassRespositiory() { this.db = new NSMMSEntities(); }
//下拉式選單讀任務類別 public JsonResult GetEventClassRead() { var db = new NSMMSEntities(); //return Json(db.EventClass.Select(p => new { Name = p.Name, Class = p.Class }), JsonRequestBehavior.AllowGet); return Json(eventClassRespository.ReadEventClassList().Select(p => new { Name = p.Name, Class = p.Class }), JsonRequestBehavior.AllowGet); }
public SystemUseRepository() { this.db = new NSMMSEntities(); }
public UserLocationRepositiory() { this.db = new NSMMSEntities(); }
public SystemSettingRepository() { this.db = new NSMMSEntities(); }
public WBSEventRepository() { this.db = new NSMMSEntities(); }
public UserDataRepository() { this.db = new NSMMSEntities(); }