public ActionResult HistorySearch(int pageSize, int pageIndex) { HistoryQuery query = HistoryQueryUtility.GetHistoryQuery(base.Request); int recordCount = 0; IList <VwWafer_History> list = historyService.HistoryList(query, pageSize, pageIndex, out recordCount); if (list != null && list.Count > 0) { foreach (VwWafer_History history in list) { if (history.IsVendor) { history.DisposeText = "Confirmed"; } else { history.DisposeText = WaferHelper.WaferSelectionDes(history.Dispose); } } } var json = JsonConvert.SerializeObject(new { currentPage = pageIndex, totalPages = PagerUtility.GetPageCount(recordCount, pageSize), rows = list, }); base.Response.Write(json); return(null); }
public ActionResult ExportHistory() { string xlsName = string.Format("History_{0}", DateTime.Now.ToString("yyyyMMdd_hhmmss")); HistoryQuery query = HistoryQueryUtility.GetHistoryQuery(base.Request); int recordCount = 0; IList <VwWafer_History> list = historyService.HistoryList(query, 0xf423f, 0, out recordCount); if (list != null && list.Count > 0) { foreach (VwWafer_History history in list) { if (history.IsVendor) { history.DisposeText = "Confirmed"; } else { history.DisposeText = WaferHelper.WaferSelectionDes(history.Dispose); } } } string nextUrl = Exporthelper.GetExport <VwWafer_History>("Historys", list, "/Export/Excels/History/", "/Content/Exports/ExportHistory.xml", xlsName, 0, 0); ResponseTypes redirect = ResponseTypes.Redirect; TipTypes information = TipTypes.Information; base.Response.Write(new HandlerResponse("0", "导出Excel文件", redirect.ToString(), information.ToString(), nextUrl, "", "").GenerateJsonResponse()); return(null); }
public static void CreateCpOSATConfirmNotificationsWhilePeDispose(string osatID, Lot_Transformed lot, string message, int dispose) { new Dictionary <string, string>(); foreach (OSATUser user in UserService.GetCPOSATUsersByOSATID(osatID)) { //Notification newNotification = new Notification //{ // CreateTime = DateTime.Now, // EmailID = Guid.NewGuid().ToString(), // LotID = lot.ID, // Message = message, // MessageID = Guid.NewGuid().ToString(), // NotificationType = NotificationTypes.Confirm, // Opened = false, // ReadTime = Convert.ToDateTime("1999-12-31"), // RecipientID = user.MD5CID, // RecordState = 0, // UpdateTime = DateTime.Now //}; //notificationGateway.AddNew(newNotification); string newvalue = WaferHelper.WaferSelectionDes(dispose); string str = emailGateway.GetEmailByID("OSATNotificationCP").Body.Replace("InsertFullNameHere", user.SupUserName).Replace("insertLotNoHere", lot.LotId).Replace("InsertUrlHere", string.Format("https://lhd.unisoc.com/Lots/wafer/list?transformID={0}", lot.ID)).Replace("InsertTimeHere", DateTime.Now.ToString("yyyy-MM-dd hh:MM:ss")).Replace("insertDisposeTextHere", newvalue); string subject = string.Format("Please confirm Lot {0} dispose", lot.LotId); CreateEmail(Guid.NewGuid().ToString(), user.MD5CID, user.SupMail, subject, str, lot.ID); } }
public ActionResult Search(int pageSize, int pageIndex) { WaferQuery query = WaferQueryUtility.GetWaferQuery(base.Request); if (StringHelper.isNullOrEmpty(query.OrderBy)) { query.OrderBy = "CreateDate"; query.OrderDesc = true; } if (CurrentUserInfo.Role == UserRoles.Fab || CurrentUserInfo.Role == UserRoles.FabAdmin) { query.Osat = CurrentUserInfo.BUName; query.Status = (int)WaferStatus.WaitVendor; } int recordCount = 0; IList <Wafer> list = service.GetAllWaferBy(query, pageSize, pageIndex, out recordCount); if (list != null && list.Count > 0) { foreach (Wafer item in list) { item.StatusText = WaferHelper.waferStatusDes(item.Status); item.PEDisposeText = WaferHelper.WaferSelectionDes(item.PEDispose); item.QADisposeText = WaferHelper.WaferSelectionDes(item.QADispose); item.SPRDDecisionText = WaferHelper.WaferSelectionDes(item.SPRDDecision); Boolean IsTriggered = false; IList <Wafer_Sbin> ListSbin = sbinService.GetWaferSbin(item.TransformID, item.ID); foreach (Wafer_Sbin sbin in ListSbin) { if (sbin.IsTriggered) { IsTriggered = true; } } item.IsTriggered = IsTriggered; } } var json = JsonConvert.SerializeObject(new { currentPage = pageIndex, totalPages = PagerUtility.GetPageCount(recordCount, pageSize), rows = list, }); base.Response.Write(json); return(null); }
public ActionResult ExportData() { WaferQuery query = WaferQueryUtility.GetWaferQuery(base.Request); int recordCount = 0; string xlsName = string.Format("Wafer_{0}", DateTime.Now.ToString("yyyyMMdd_hhmmss")); if (StringHelper.isNullOrEmpty(query.OrderBy)) { query.OrderBy = "CreateDate"; query.OrderDesc = true; } if (CurrentUserInfo.Role == UserRoles.Fab || CurrentUserInfo.Role == UserRoles.FabAdmin) { query.Osat = CurrentUserInfo.BUName; query.Status = (int)WaferStatus.WaitVendor; } IList <Wafer> list = service.GetAllWaferBy(query, 0xf423f, 0, out recordCount); if (list != null && list.Count > 0) { foreach (Wafer item in list) { item.StatusText = WaferHelper.waferStatusDes(item.Status); item.PEDisposeText = WaferHelper.WaferSelectionDes(item.PEDispose); item.QADisposeText = WaferHelper.WaferSelectionDes(item.QADispose); item.SPRDDecisionText = WaferHelper.WaferSelectionDes(item.SPRDDecision); } } string path = "/Export/Excels/Wafer/"; string mp = Server.MapPath("~") + path; if (!Directory.Exists(mp)) { Directory.CreateDirectory(mp); } string nextUrl = Exporthelper.GetExport <Wafer>("LOTS", list, "/Export/Excels/Wafer/", "/Content/Exports/ExportWafer.xml", xlsName, 0, 0); ResponseTypes redirect = ResponseTypes.Redirect; TipTypes information = TipTypes.Information; base.Response.Write(new HandlerResponse("0", "导出Excel文件", redirect.ToString(), information.ToString(), nextUrl, "", "").GenerateJsonResponse()); return(null); }