public ActionResult Edit([Bind(Include = "cabinetNo,width,cengRangeA,cengRangeB,remainWidth,startPaijiaNo")] CabinetInfo cabinetinfo, string action) { if (action == "修改") { if (ModelState.IsValid) { db.Entry(cabinetinfo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("InformationWarehouse")); } } if (action == "删除") { if (ModelState.IsValid) { db.Entry(cabinetinfo).State = EntityState.Deleted; db.SaveChanges(); return(RedirectToAction("InformationWarehouse")); } } if (action == "返回") { return(RedirectToAction("InformationWarehouse")); } return(View(cabinetinfo)); }
public static string ExtractMediaStream(Database msiDb) { string tempFileName = Path.GetTempFileName(); string tempFolder = GetTempFolder(tempFileName); string filePath = Path.ChangeExtension(tempFileName, ".cab"); string str4 = (string)msiDb.ExecuteScalar("SELECT `Cabinet` FROM `Media` WHERE `DiskId` = {0}", new object[] { 1 }); using (View view = msiDb.OpenView("SELECT `Name`, `Data` FROM `_Streams` WHERE `Name` = '{0}'", new object[] { str4.Substring(1) })) { view.Execute(); Record record = view.Fetch(); if (record == null) { throw new InstallerException("Stream not found: " + str4); } using (record) { record.GetStream("Data", filePath); } } CabinetInfo info = new CabinetInfo(filePath); info.ExtractAll(tempFolder); info.Delete(); return(tempFolder); }
public ActionResult CreateNewChief([Bind(Include = "cabinetNo,width,cengRangeA,cengRangeB,remainWidth,startPaijiaNo")] CabinetInfo cabinetinfo, string action) { CabinetInfo Cabinet = new CabinetInfo(); Cabinet.cabinetNo = cabinetinfo.cabinetNo; Cabinet.width = cabinetinfo.width; Cabinet.cengRangeA = cabinetinfo.cengRangeA; Cabinet.cengRangeB = cabinetinfo.cengRangeB; Cabinet.remainWidth = cabinetinfo.remainWidth; Cabinet.startPaijiaNo = cabinetinfo.startPaijiaNo; if (action == "添加") { if (ModelState.IsValid) { db.CabinetInfo.Add(Cabinet); db.SaveChanges(); return(RedirectToAction("InformationWarehouse")); } } if (action == "返回") { return(RedirectToAction("InformationWarehouse")); } return(View(Cabinet)); }
public PartialViewResult StationInfo(string stationCode) { Department department = HttpContext.Session.Get <Department>("SESSION-DEPARTMENT-KEY"); if (string.IsNullOrEmpty(stationCode)) { var query = _context.CabinetInfo.AsQueryable(); if (department != null) { query = query.Where(q => q.DeptID.Equals(department.ID)); } CabinetInfo cabinet = query.OrderByDescending(q => q.ModifyTime).FirstOrDefault(); if (cabinet != null) { stationCode = cabinet.StationCode; } } ViewBag.station = _context.Station.Where(q => q.Code.Equals(stationCode)).FirstOrDefault(); return(PartialView("List")); }
public ActionResult CreateNewChief(string id) { var cabinet = from ad in db.CabinetInfo orderby ad.cabinetNo descending select ad; CabinetInfo Cabinet = new CabinetInfo(); string ID = cabinet.First().cabinetNo; long max = Convert.ToInt32(ID) + 1; Cabinet.cabinetNo = max.ToString(); return(View(Cabinet)); }
/// <summary> /// Access or create a new Archive /// </summary> /// <param name="archiveName">The full name of the archive to create or to access</param> private Archiver(string archiveName) : this() { System.Diagnostics.Debug.Assert(archiveName != null && archiveName.Trim() != string.Empty, "The name of the archive cannot be null nor empty / whitespace only"); _name = Path.GetFileName(archiveName); if (Path.GetDirectoryName(archiveName) != string.Empty) { _directoryName = Path.GetDirectoryName(archiveName); _directoryCleanup = false; } _fullName = Path.Combine(_directoryName, _name); _cabInfo = new CabinetInfo(_fullName); }
public PartialViewResult Carousel(string stationCode) { Department department = HttpContext.Session.Get <Department>("SESSION-DEPARTMENT-KEY"); if (string.IsNullOrEmpty(stationCode)) { var query = _context.CabinetInfo.AsQueryable(); if (department != null) { query = query.Where(q => q.DeptID.Equals(department.ID)); } CabinetInfo cabinet = query.OrderByDescending(q => q.ModifyTime).FirstOrDefault(); if (cabinet != null) { stationCode = cabinet.StationCode; } } ViewBag.user = HttpContext.Session.Get <Guser>("SESSION-ACCOUNT-KEY"); var stationQ = _context.Station.AsQueryable(); if (department != null) { stationQ = stationQ.Where(q => q.DeptID.Equals(department.ID)); } Station station = stationQ.Where(q => q.Code.Equals(stationCode)).FirstOrDefault(); if (station == null) { ViewBag.station = new Station(); return(PartialView("List")); } ViewBag.station = station; DateTime board = DateTime.Now - new TimeSpan(0, 10, 0); ViewBag.board = board; List <Cabinet> list = _context.Cabinet.Where(q => q.StationCode.Equals(stationCode)).OrderBy(q => q.Sort).ToList(); return(PartialView("List", list)); }
/// <summary> /// Creates a new CabinetFileInfo object. For use by subclasses. /// </summary> protected internal CabinetFileInfo(string name, string path, int folderNumber, int cabNumber, FileAttributes attributes, DateTime lastWriteTime, long length) : base() { this.cabinetInfo = null; this.name = name; this.path = path; this.initialized = true; this.exists = true; this.cabFolderNumber = folderNumber; this.cabNumber = cabNumber; this.attributes = attributes; this.lastWriteTime = lastWriteTime; this.length = length; this.OriginalPath = null; this.FullPath = null; }
/// <summary> /// Creates a new CabinetFileInfo object representing a file within a cabinet in a specified path. /// </summary> /// <param name="cabinetInfo">Object representing the cabinet containing the file.</param> /// <param name="filePath">Path to the file within the cabinet. Usually, this is a simple file /// name, but if the cabinet contains a directory structure this may include the directory.</param> public CabinetFileInfo(CabinetInfo cabinetInfo, string filePath) : base() { this.Cabinet = cabinetInfo; if (filePath == null) { throw new ArgumentNullException("filePath"); } this.name = System.IO.Path.GetFileName(filePath); this.path = System.IO.Path.GetDirectoryName(filePath); this.initialized = false; this.exists = false; this.cabFolderNumber = 0; this.cabNumber = 0; this.attributes = FileAttributes.Normal; this.lastWriteTime = DateTime.MinValue; this.length = 0; }
public object Dialog(string cabinetID) { ViewBag.userDept = HttpContext.Session.Get <Department>("SESSION-DEPARTMENT-KEY"); if (string.IsNullOrEmpty(cabinetID)) { return(PartialView("Add")); } CabinetInfo cabinet = _context.CabinetInfo.Where(q => q.ID.Equals(cabinetID)).FirstOrDefault(); if (cabinet == null) { return(Json(new { code = -1, msg = "找不到指定的电气柜" })); } ViewBag.cabinet = cabinet; return(PartialView("Edit")); }
public static void Seed(this ModelBuilder modelBuilder) { var user1 = new User() { UserId = 1, Name = "Andrey", Surname = "Solovyev", BornDate = new DateTime(2000, 04, 03), PassportData = "2020445765", Snills = "1234" }; var user2 = new User() { UserId = 2, Name = "Vasiliy", Surname = "Sychev", BornDate = new DateTime(2000, 10, 10), PassportData = "2020123987", Snills = "2345" }; var user3 = new User() { UserId = 3, Name = "Ivan", Surname = "Tkachenko", BornDate = new DateTime(2000, 04, 07), PassportData = "2020234765", Snills = "3456" }; var user4 = new User() { UserId = 4, Name = "Ivan", Surname = "Menshih", BornDate = new DateTime(2001, 8, 14), PassportData = "2014456765", Snills = "4567" }; var user5 = new User() { UserId = 5, Name = "Lev", Surname = "Makeev", BornDate = new DateTime(2000, 07, 24), PassportData = "2020567123", Snills = "6789" }; modelBuilder.Entity <User>().HasData(user1, user2, user3, user4, user5); var specialty1 = new Specialty() { SpecialtyId = 1, Name = "Endocrinologist" }; var specilaty2 = new Specialty() { SpecialtyId = 2, Name = "Сardiologist" }; var specialty3 = new Specialty() { SpecialtyId = 3, Name = "Therapist" }; var specilaty4 = new Specialty() { SpecialtyId = 4, Name = "Neurologist" }; modelBuilder.Entity <Specialty>().HasData(specialty1, specilaty2, specialty3, specilaty4); var doctor1 = new Doctor() { DoctorId = 1, UserId = user1.UserId, SpecialtyId = specialty1.SpecialtyId, LicenseNumber = "1111" }; var doctor2 = new Doctor() { DoctorId = 2, UserId = user2.UserId, SpecialtyId = specilaty2.SpecialtyId, LicenseNumber = "2222" }; var doctor3 = new Doctor() { DoctorId = 3, UserId = user3.UserId, SpecialtyId = specialty3.SpecialtyId, LicenseNumber = "3333" }; modelBuilder.Entity <Doctor>().HasData(doctor1, doctor2, doctor3); var patient1 = new Patient() { PatientId = 1, Policy = "12321", UserId = user4.UserId }; var patient2 = new Patient() { PatientId = 2, Policy = "213214", UserId = user5.UserId }; modelBuilder.Entity <Patient>().HasData(patient1, patient2); var visit1 = new Visit() { VisitId = 1, PatientId = patient1.PatientId, DoctorId = doctor1.DoctorId, DateVisit = new DateTime(2021, 02, 02), Price = 1300 }; var visit2 = new Visit() { VisitId = 2, PatientId = patient1.PatientId, DoctorId = doctor2.DoctorId, DateVisit = new DateTime(2021, 01, 20), Complaint = "Too expensive", Price = 1000 }; var visit3 = new Visit() { VisitId = 3, PatientId = patient2.PatientId, DoctorId = doctor1.DoctorId, DateVisit = new DateTime(2021, 03, 25), Price = 1200 }; modelBuilder.Entity <Visit>().HasData(visit1, visit2, visit3); var diagnosis1 = new Diagnosis() { DiagnosisId = 1, Name = "Diabetes", Description = "Needs careful treatment" }; var diagnosis2 = new Diagnosis() { DiagnosisId = 2, Name = "Tachycardia", Description = "Nothing serious, just avoid much coffee" }; var diagnosis3 = new Diagnosis() { DiagnosisId = 3, Name = "Headache", Description = "Outflow of blood from the head is disturbed" }; modelBuilder.Entity <Diagnosis>().HasData(diagnosis1, diagnosis2, diagnosis3); var diagnosisInfo1 = new DiagnosisInfo() { DiagnosisInfoId = 1, DiagnosisId = diagnosis1.DiagnosisId, PatientId = patient1.PatientId }; var diagnosisInfo2 = new DiagnosisInfo() { DiagnosisInfoId = 2, PatientId = patient2.PatientId, DiagnosisId = diagnosis2.DiagnosisId }; modelBuilder.Entity <DiagnosisInfo>().HasData(diagnosisInfo1, diagnosisInfo2); var cabinet1 = new Cabinet() { CabinetId = 1, CabinetNumber = 228 }; var cabinet2 = new Cabinet() { CabinetId = 2, CabinetNumber = 320 }; var cabinet3 = new Cabinet() { CabinetId = 3, CabinetNumber = 223 }; modelBuilder.Entity <Cabinet>().HasData(cabinet1, cabinet2, cabinet3); var cabinetInfo1 = new CabinetInfo() { CabinetInfoId = 1, CabinetId = cabinet1.CabinetId, DoctorId = doctor1.DoctorId, DateStart = new DateTime(2019, 3, 23)/*, * DateEnd = default*/ }; var cabinetInfo2 = new CabinetInfo() { CabinetInfoId = 2, CabinetId = cabinet2.CabinetId, DoctorId = doctor2.DoctorId, DateStart = new DateTime(2015, 6, 12), DateEnd = new DateTime(2018, 3, 21) }; var cabinetInfo3 = new CabinetInfo() { CabinetInfoId = 3, CabinetId = cabinet3.CabinetId, DoctorId = doctor2.DoctorId, DateStart = new DateTime(2018, 3, 21)/*, * DateEnd = default*/ }; var cabinetInfo4 = new CabinetInfo() { CabinetInfoId = 4, CabinetId = cabinet2.CabinetId, DoctorId = doctor3.DoctorId, DateStart = new DateTime(2018, 3, 21) }; modelBuilder.Entity <CabinetInfo>().HasData(cabinetInfo1, cabinetInfo2, cabinetInfo3, cabinetInfo4); }
public static extern bool FDIIsCabinet( FdiHandle hfdi, IntPtr hf, ref CabinetInfo pfdici);
/// <summary> /// Gets information about the certain files contained in the cabinte file. /// </summary> /// <param name="searchPattern">The search string, such as "*.txt".</param> /// <returns>An array of <see cref="CabinetFileInfo"/> objects, each containing information about a file in the cabinet.</returns> internal CabinetFileInfo[] GetFiles(string searchPattern) { return(this.GetFiles(new CabinetFilterFileHandler(CabinetInfo.RegexFilterFileHandler), CabinetInfo.FilePatternToRegex(searchPattern))); }