Exemplo n.º 1
0
        public ActionResult Index([Bind(Include = "StudentScheduleGeneratorId,StudentNumber,StartTerm,DepartmentName,ProgramOptionName,IncludeSummer,DateGenerated")] StudentScheduleGenerator generator)
        {
            int? studentId = StudentController.LoggedInStudentID;
            generator.StudentNumber = db.Students.Find(studentId).StudentNumber;
            generator.DateGenerated = DateTime.Now;
            db.StudentScheduleGenerators.Add(generator);

            //Object containing course sequences, initialize once
            Programs p = new Programs();
            //Scheduler object, first parameter is student (change to logged in student), second parameter is the program option (from Programs object).

            Scheduler s = new Scheduler(db.Students.Find(StudentController.LoggedInStudentID), Programs.SOEN_General);

            //Generate a schedule. Argument is semester. If fall, you get fall and winter schedule. If winter, only winter schedule
            if (generator.StartTerm == "Fall 2015")
            {
                s.GenerateSchedule(Semester.Fall); //LAY: if starting term is fall, put Semester.Fall. If winter, put Semester.Winter
            }
            else if (generator.StartTerm == "Winter 2016")
            {
                s.GenerateSchedule(Semester.Winter);
            }
            else
            {
                s.GenerateSchedule(Semester.Summer);
            }

            //Once generated, retrieve the list of scheduled sections. These are the sections to put on the schedule.
            List<Section> sectionsFall = s.ScheduledSectionsFall;
            List<Section> sectionsWinter = s.ScheduledSectionsWinter;
            List<StudentSchedule> scheduleList = new List<StudentSchedule>();

            foreach (var item in sectionsFall)
            {
                StudentSchedule schedule = new StudentSchedule();

                schedule.StudentId = studentId;
                schedule.SectionId = item.SectionId;
                scheduleList.Add(schedule);
            }

            foreach (var item in sectionsWinter)
            {
                StudentSchedule schedule = new StudentSchedule();

                schedule.StudentId = studentId;
                schedule.SectionId = item.SectionId;
                scheduleList.Add(schedule);
            }

            db.StudentSchedules.AddRange(scheduleList);
            db.SaveChanges();

            return RedirectToAction("Index", "StudentSchedule");
        }
Exemplo n.º 2
0
		protected override Backend.Program CreateProgram(Programs program)
		{
			string code = null;
			switch (program)
			{
				case Programs.MonochromeToBgr:
					code = @"uniform sampler2D texture; void main() { vec4 value = texture2D(texture, gl_TexCoord[0].xy); float y = value.x; gl_FragColor = vec4(y, y, y, 1.0); }";
					break;
				case Programs.BgrToMonochrome:
					code = @"uniform sampler2D texture; void main() { vec4 value = texture2D(texture, gl_TexCoord[0].xy); float y = value.x * 0.299 + value.y * 0.587 + value.z * 0.114; gl_FragColor = vec4(y, y, y, 1.0); }";
					break;
				case Programs.BgrToU:
					code = @"uniform sampler2D texture; void main() { vec4 value = texture2D(texture, gl_TexCoord[0].xy); float u = value.x * (-0.168736) + value.y * (-0.331264) + value.z * 0.5000 + 0.5; gl_FragColor = vec4(u, u, u, 1.0); }";
					break;
				case Programs.BgrToV:
					code = @"uniform sampler2D texture; void main() { vec4 value = texture2D(texture, gl_TexCoord[0].xy); float v = value.x * 0.5 + value.y * (-0.418688) + value.z * (-0.081312) + 0.5; gl_FragColor = vec4(v, v, v, 1.0); }";
					break;
				case Programs.Yuv420ToBgr:
					code = @"
						uniform sampler2D texture0;
						uniform sampler2D texture1;
						uniform sampler2D texture2;
						vec4 YuvToRgba(vec4 t);
						void main()
						{
							vec2 position = gl_TexCoord[0].xy;
							gl_FragColor = YuvToRgba(vec4(texture2D(texture0, position).x, texture2D(texture1, position).x - 0.5, texture2D(texture2, position).x - 0.5, 1.0));
						}
						// Convert yuva to rgba
						vec4 YuvToRgba(vec4 t)
						{	
								mat4 matrix = mat4(1,	                1,                  1,   	                    0,
												-0.000001218894189, -0.344135678165337,  1.772000066073816,         0,
												1.401999588657340, -0.714136155581812,   0.000000406298063,         0, 
												0,	                0,                  0,                          1);   
										
							return matrix * t;
						}";
					break;
				default:
					break;
			}
			Backend.Program result = null;
			if (code.NotEmpty())
				result = this.CreateProgram(null, code);
			return result;
		}
Exemplo n.º 3
0
        public void Install(GameMenu game, Programs programs, int k)//i - 1(system), 2(programming)
        {
            switch (programs)
            {
            case Programs.System:
                if (game.Computer.InstalSystem == 4)
                {
                    break;
                }

                if (k <= game.Computer.Comp && k <= game.Computer.Memory && k <= game.Computer.HDD)
                {
                    game.Computer.InstalSystem = k;
                    _personService.PointsCalculate(game);
                }
                else
                {
                    //Слабый комп
                }
                break;

            case Programs.Programming:
                if (game.Computer.InstalProgramming == 4)
                {
                    break;
                }

                if (k <= (game.Computer.InstalSystem + 1) && game.Person.Points >= k * 15 && game.Computer.InstalSystem != 0)
                {
                    game.Computer.InstalProgramming = k;
                    _personService.PointsCalculate(game);
                }
                else
                {
                    //Недостаточно опыта или слабая система
                }
                break;
            }
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitialFilter = false;
                if (Request.QueryString.Count > 0)
                {
                    InitialFilter           = PrepareFilter();
                    Page.PreRenderComplete += (s, args) =>
                    {
                        EnactFilter();
                    };
                }

                if (!InitialFilter)
                {
                    var criteria = new EventSearchCriteria();
                    SaveFilter(criteria);
                    DoFilter(criteria);
                }
            }

            int programId;
            var sessionProgramId = Session["ProgramID"];

            if (sessionProgramId == null ||
                !int.TryParse(sessionProgramId.ToString(), out programId))
            {
                programId = Programs.GetDefaultProgramID();
            }
            var program = Programs.FetchObject(programId);

            this.FirstAvailableDate = program.StartDate.ToShortDateString();
            this.LastAvailableDate  = program.EndDate.ToShortDateString();

            var basePage = (BaseSRPPage)Page;

            this.NoneAvailableText = basePage.GetResourceString("events-none-available");
        }
Exemplo n.º 5
0
        ///<summary>Launches the program using a combination of command line characters and the patient.Cur data.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);
            List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);;

            if (pat != null)
            {
                ProgramProperty PPCur   = ProgramProperties.GetCur(ForProgram, "Storage Path");
                string          comline = "-P" + PPCur.PropertyValue + @"\";
                //Patient id can be any string format
                PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");;
                if (PPCur.PropertyValue == "0")
                {
                    comline += pat.PatNum.ToString();
                }
                else
                {
                    comline += pat.ChartNumber;
                }
                comline += " -N" + pat.LName + ", " + pat.FName;
                comline  = comline.Replace("\"", "");           //gets rid of any quotes
                comline  = comline.Replace("'", "");            //gets rid of any single quotes
                try{
                    Process.Start(path, comline);
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }            //if patient is loaded
            else
            {
                try{
                    Process.Start(path);                    //should start Trophy without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }
        }
Exemplo n.º 6
0
        public async Task <ActionResult> UpdateProgram(int collegeId, int id, [FromBody] ProgramForUpdateDto program)
        {
            if (program == null)
            {
                return(BadRequest());
            }

            if (program.Description == program.Name)
            {
                ModelState.AddModelError("Description", "The provided description should be different from the name.");
            }

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (!await _studyRouteRepository.CollegeExists(collegeId))
            {
                return(NotFound());
            }

            Programs oldProgramEntity = await _studyRouteRepository.GetProgramForCollege(collegeId, id);

            if (oldProgramEntity == null)
            {
                return(NotFound());
            }

            _mapper.Map(program, oldProgramEntity);


            if (!await _studyRouteRepository.Save())
            {
                return(StatusCode(500, "A problem happened while handling your request."));
            }

            return(NoContent());
        }
Exemplo n.º 7
0
        ///<summary>Shows a message box on error.</summary>
        public static PayConnectService.transResponse ProcessCreditCard(PayConnectService.creditCardRequest request, long clinicNum)
        {
            try {
                Program prog = Programs.GetCur(ProgramName.PayConnect);
                PayConnectService.Credentials     cred = GetCredentials(prog, clinicNum);
                PayConnectService.MerchantService ms   = new PayConnectService.MerchantService();
#if DEBUG
                ms.Url = "https://prelive2.dentalxchange.com/merchant/MerchantService?wsdl";
#else
                ms.Url = "https://webservices.dentalxchange.com/merchant/MerchantService?wsdl";
#endif
                PayConnectService.transResponse response = ms.processCreditCard(cred, request);
                ms.Dispose();
                if (response.Status.code != 0 && response.Status.description.ToLower().Contains("duplicate"))
                {
                    MessageBox.Show(Lan.g("PayConnect", "Payment failed") + ". \r\n" + Lan.g("PayConnect", "Error message from") + " Pay Connect: \""
                                    + response.Status.description + "\"\r\n"
                                    + Lan.g("PayConnect", "Try using the Force Duplicate checkbox if a duplicate is intended."));
                }
                if (response.Status.code != 0 && response.Status.description.ToLower().Contains("invalid user"))
                {
                    MessageBox.Show(Lan.g("PayConnect", "Payment failed") + ".\r\n"
                                    + Lan.g("PayConnect", "PayConnect username and password combination invalid.") + "\r\n"
                                    + Lan.g("PayConnect", "Verify account settings by going to") + "\r\n"
                                    + Lan.g("PayConnect", "Setup | Program Links | PayConnect. The PayConnect username and password are probably the same as the DentalXChange login ID and password."));
                }
                else if (response.Status.code != 0)               //Error
                {
                    MessageBox.Show(Lan.g("PayConnect", "Payment failed") + ". \r\n" + Lan.g("PayConnect", "Error message from") + " Pay Connect: \""
                                    + response.Status.description + "\"");
                }
                return(response);
            }
            catch (Exception ex) {
                MessageBox.Show(Lan.g("PayConnect", "Payment failed") + ". \r\n" + Lan.g("PayConnect", "Error message") + ": \"" + ex.Message + "\"");
            }
            return(null);
        }
Exemplo n.º 8
0
        public List <IGame> GetInstalledGamesFromRegistry()
        {
            var games    = new List <IGame>();
            var programs = Programs.GetUnistallProgramsList();

            foreach (var program in programs)
            {
                var match = Regex.Match(program.RegistryKeyName, @"(\d+)_is1");
                if (!match.Success || program.Publisher != "GOG.com")
                {
                    continue;
                }

                var gameId = match.Groups[1].Value;
                var game   = new Game()
                {
                    InstallDirectory = program.InstallLocation,
                    ProviderId       = gameId,
                    Provider         = Provider.GOG,
                    Name             = program.DisplayName
                };

                try
                {
                    var tasks = GetGameTasks(game.ProviderId, game.InstallDirectory);
                    game.PlayTask   = tasks.Item1;
                    game.OtherTasks = tasks.Item2;
                }
                catch (Exception e) when(!PlayniteEnvironment.ThrowAllErrors)
                {
                    logger.Error(e, $"Failed to get action for GOG game {game.ProviderId}, game not imported.");
                }

                games.Add(game);
            }

            return(games);
        }
Exemplo n.º 9
0
        public ActionResult CopyProgram(int id)
        {
            if (Request.IsAuthenticated)
            {
                var details = from p in PBL.WeeklyProgram()
                              where p.ProgramID == id
                              select p;

                Programs Program = details.FirstOrDefault();

                CultureInfo ci = new CultureInfo("Es-Es");

                string day = ci.DateTimeFormat.GetDayName(Program.ProgramDate.DayOfWeek).ToString();

                ViewBag.DayName = day.First().ToString().ToUpper() + day.Substring(1);

                ViewBag.PDate = Program.ProgramDate.ToString("dd/MM/yyyy");

                ViewBag.PSchedule = Program.ProgramSchedule;

                ViewBag.PID = id;

                var ProgramsList = from p in PBL.AvailableProgramsForCopy(id)
                                   select p;

                CopyProgram CP = new CopyProgram()
                {
                    ProgramIDTarget = id,
                    ProgramList     = ProgramsList.ToList()
                };

                return(View(CP));
            }
            else
            {
                return(this.RedirectToAction("Login", "Account"));
            }
        }
Exemplo n.º 10
0
        ///<summary>Sends data for Patient.Cur by command line interface.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (pat == null)
            {
                return;
            }
            //Example: c:\vixwin\vixwin -I 123ABC -N Bill^Smith -P X:\VXImages\
            string info        = "-I ";
            bool   isChartNum  = PIn.Bool(ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum"));
            string ppImagePath = ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Optional Image Path");

            if (isChartNum)
            {
                info += pat.ChartNumber;              //max 64 char
            }
            else
            {
                info += pat.PatNum.ToString();
            }
            info += " -N " + pat.FName.Replace(" ", "") + "^" + pat.LName.Replace(" ", ""); //no spaces allowed
            if (ppImagePath != "")                                                          //optional image path
            {
                if (!ODBuild.IsWeb() && !Directory.Exists(ppImagePath))
                {
                    MessageBox.Show("Unable to find image path " + ppImagePath);
                    return;
                }
                info += " -P " + ppImagePath;
            }
            try {
                ODFileUtils.ProcessStart(path, info, createDirIfNeeded: ppImagePath);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message + "\r\nFile and command line:\r\n" + path + " " + info);
            }
        }
Exemplo n.º 11
0
        ///<summary>Launches the program using command line.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string    path       = Programs.GetProgramPath(ProgramCur);
            ArrayList ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);

            if (pat != null)
            {
                string info = "";
                //Patient id can be any string format
                ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");
                if (PPCur.PropertyValue == "0")
                {
                    info += " " + pat.PatNum.ToString();
                }
                else
                {
                    info += " " + pat.ChartNumber;
                }
                //We remove double-quotes from the first and last name of the patient so extra double-quotes don't
                //cause confusion in the command line parameters for Sopro.
                info += " " + pat.LName.Replace("\"", "") + " " + pat.FName.Replace("\"", "");
                try{
                    Process.Start(path, ProgramCur.CommandLine + info);
                }
                catch {
                    MessageBox.Show(path + " is not available, or there is an error in the command line options.");
                }
            }            //if patient is loaded
            else
            {
                try{
                    Process.Start(path);                    //should start Sopro without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }
        }
Exemplo n.º 12
0
        ///<summary>Launches the program using command line.</summary>
        private static void SendData4(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);
            //Usage: mediadent.exe /P<Patient Name> /D<Practitioner> /L<Language> /F<Image folder> /B<Birthdate>
            //Example: mediadent.exe /PJan Met De Pet /DOtté Gunter /L1 /Fc:\Mediadent\patients\1011 /B27071973
            ArrayList ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);;

            if (pat == null)
            {
                return;
            }
            string   info = "/P" + Cleanup(pat.FName + " " + pat.LName);
            Provider prov = Providers.GetProv(Patients.GetProvNum(pat));

            info += " /D" + prov.FName + " " + prov.LName
                    + " /L1 /F";
            ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Image Folder");

            info += PPCur.PropertyValue;
            PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");;
            if (PPCur.PropertyValue == "0")
            {
                info += pat.PatNum.ToString();
            }
            else
            {
                info += Cleanup(pat.ChartNumber);
            }
            info += " /B" + pat.Birthdate.ToString("ddMMyyyy");
            //MessageBox.Show(info);
            //not used yet: /inputfile "path to file"
            try {
                Process.Start(path, info);
            }
            catch {
                MessageBox.Show(path + " " + info + " is not available.");
            }
        }
Exemplo n.º 13
0
        private void cboStatus_SelectedValueChanged(object sender, EventArgs e)
        {
            if (cboStatus.SelectedItem != null)
            {
                dtDate.Value        = DateTime.Now;
                dtDate.CustomFormat = "MM/dd/yyyy";
                DateTime dtCur = new DateTime();// Convert.ToDateTime(dtDate.Text);
                try
                {
                    dtCur = Convert.ToDateTime(dtDate.Text);
                }
                catch
                {
                    string dtValid = "";
                    string yer     = "";
                    if (Convert.ToInt32(dtDate.Text.Substring(0, 2)) == 13)
                    {
                        dtValid = dtDate.Text;
                        yer     = dtValid.Substring(dtValid.Length - 4, 4);
                        dtCur   = Convert.ToDateTime("12/30/" + yer);
                    }
                    else if (Convert.ToInt32(dtDate.Text.Substring(0, 2)) == 2)
                    {
                        dtValid = dtDate.Text;
                        yer     = dtValid.Substring(dtValid.Length - 4, 4);
                        dtCur   = Convert.ToDateTime("2/28/" + yer);
                    }
                }
                int month = Convert.ToInt32(cboMonth.SelectedValue);
                int year  = (month < 11) ? dtCur.Year : dtCur.Year - 1;

                Programs prog = new Programs();
                prog.GetProgramByName("Family Planning");
                Items     itm   = new Items();
                DataTable dtItm = itm.GetItemsByProgram(prog.ID);
                PopulateItemListByMonth(dtItm, month, year);
            }
        }
Exemplo n.º 14
0
        public static bool PatronNeedsPostTest()
        {
            var p  = (Patron)HttpContext.Current.Session["Patron"];
            var pg = Programs.FetchObject(p.ProgID);

            if (pg.PostTestID != 0)
            {
                var resID = 0;
                if (PatronHasCompletedTest(p.PID, pg.PostTestID, 2, pg.PID, out resID))
                {
                    return(false);
                }
                else
                {
                    if (pg.PostTestStartDate > DateTime.Now)
                    {
                        return(false);
                    }

                    var QNum = 0;
                    if (resID > 0)
                    {
                        var sr = SurveyResults.FetchObject(resID);
                        QNum = sr.LastAnswered;
                        // has started ... needs to continue ...
                    }

                    HttpContext.Current.Session["SRID"]   = resID;            // which results to continue
                    HttpContext.Current.Session["SID"]    = pg.PostTestID;    // the test to restart
                    HttpContext.Current.Session["QNum"]   = QNum;             // question to restart from
                    HttpContext.Current.Session["SSrc"]   = Survey.Source(2); // pre - testing
                    HttpContext.Current.Session["SSrcID"] = pg.PID;           // program id

                    HttpContext.Current.Response.Redirect("AddlSurvey.aspx");
                }
            }
            return(false);
        }
Exemplo n.º 15
0
        ///<summary>Launches the program using a combination of command line characters and the patient.Cur data.///</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (pat == null)
            {
                try {
                    ODFileUtils.ProcessStart(path);                    //should start NewTomNNT without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }
            else
            {
                string args = " /PATID ";
                if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
                {
                    args += pat.PatNum + " ";
                }
                else
                {
                    args += pat.ChartNumber + " ";
                }
                args += "/NAME \"" + pat.FName + "\" /SURNAME \"" + pat.LName + "\" /DATEB " + pat.Birthdate.ToString("d,M,yyyy");
                if (pat.SSN != "")                  //SSN is not required in all countries.
                {
                    args += " /SSNM " + pat.SSN;
                }
                args += " /SEX " + (pat.Gender == PatientGender.Female ? "F" : "M");
                try {
                    ODFileUtils.ProcessStart(path, args);
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }
        }
        internal Dictionary <string, GameInfo> GetInstalledGames()
        {
            var games    = new Dictionary <string, GameInfo>();
            var programs = Programs.GetUnistallProgramsList();

            foreach (var program in programs)
            {
                if (program.UninstallString?.Contains("Amazon Game Remover.exe") != true)
                {
                    continue;
                }

                if (!Directory.Exists(program.InstallLocation))
                {
                    continue;
                }

                var match  = Regex.Match(program.UninstallString, @"-p\s+([a-zA-Z0-9\-]+)");
                var gameId = match.Groups[1].Value;
                if (!games.ContainsKey(gameId))
                {
                    var game = new GameInfo()
                    {
                        InstallDirectory = Paths.FixSeparators(program.InstallLocation),
                        GameId           = gameId,
                        Source           = "Amazon",
                        Name             = program.DisplayName.RemoveTrademarks(),
                        IsInstalled      = true,
                        PlayAction       = GetPlayAction(gameId),
                        Platform         = "PC"
                    };

                    games.Add(game.GameId, game);
                }
            }

            return(games);
        }
Exemplo n.º 17
0
        ///<summary>Launches the program using a combination of command line characters and the patient.Cur data.  They also have an available file based method which passes more information, but we don't use it yet.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);
            List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);;

            if (pat != null)
            {
                string          info  = "-";
                ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");;
                if (PPCur.PropertyValue == "0")
                {
                    info += ClipTo(pat.PatNum.ToString(), 10) + ";";
                }
                else
                {
                    info += ClipTo(pat.ChartNumber, 10) + ";";
                }
                info += ClipTo(pat.FName, 25) + ";"
                        + ClipTo(pat.LName, 25) + ";"
                        + ClipTo(pat.SSN, 15) + ";"
                        + pat.Birthdate.ToString("MM/dd/yyyy") + ";";
                try{
                    ODFileUtils.ProcessStart(path, info);
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }            //if patient is loaded
            else
            {
                try{
                    ODFileUtils.ProcessStart(path);                    //should start ImageFX without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }
        }
Exemplo n.º 18
0
        ///<summary>Sends data for Patient.Cur by command line interface.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (pat == null)
            {
                MsgBox.Show("VixWinBase36", "Please select a patient first.");
                return;
            }
            //Example: c:\vixwin\vixwin -I 12ABYZ -N Bill^Smith -P X:\VXImages\12AB#$\
            string info        = "-I " + ConvertToBase36(pat.PatNum);
            string ppImagePath = ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Image Path");

            if (pat.FName.ToString() != "")
            {
                info += " -N " + Tidy(pat.FName) + "^" + Tidy(pat.LName);
            }
            if (ppImagePath != "")           //optional image path
            {
                if (!Directory.Exists(ppImagePath))
                {
                    MessageBox.Show("Unable to find image path " + ppImagePath);
                    return;
                }
                if (!ppImagePath.EndsWith("\\"))                 //if program path doesn't end with "\" then add it to the end.
                {
                    ppImagePath += "\\";
                }
                ppImagePath += ConvertToBase36(pat.PatNum) + "\\";            //if we later allow ChartNumbers, then we will have to validate them to be 6 digits or less.
                info        += " -P " + ppImagePath;
            }
            try {
                Process.Start(path, info);
            }
            catch {
                MessageBox.Show(path + " is not available. Ensure that the program and image paths are valid.");
            }
        }
Exemplo n.º 19
0
        ///<summary>Launches the program using a combination of command line characters and the patient.Cur data.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (pat == null)
            {
                try {
                    Process.Start(path);                    //should start HandyDentist without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
                return;
            }
            string info = "-no:\"";

            if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
            {
                info += pat.PatNum.ToString();
            }
            else
            {
                if (pat.ChartNumber == null || pat.ChartNumber == "")
                {
                    MsgBox.Show("HandyDentist", "This patient does not have a chart number.");
                    return;
                }
                info += Tidy(pat.ChartNumber);
            }
            info += "\" -fname:\"" + Tidy(pat.FName) + "\" ";
            info += "\" -lname:\"" + Tidy(pat.LName) + "\" ";
            try {
                Process.Start(path, info);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 20
0
        public void AddNew(string id)
        {
            var      proc      = Process.GetProcessById(int.Parse(id));
            DateTime date      = DateTime.Now;
            var      procStart = proc.StartTime;

            // Работа с коллекцией в UI потоке

            Dispatcher?.BeginInvoke((Action)(() =>
            {
                lock (Programs) // локируем Programs от изменений в других потоках
                    Programs.Add(
                        new ProgramModels()
                    {
                        Id = id,
                        Date = date.ToShortDateString(),
                        Name = proc.ProcessName,
                        TimeStart = procStart
                    });
            }));

            //_fileOpenAndSave.SaveDate(_programs);
        }
Exemplo n.º 21
0
        public async Task <IActionResult> PutPrograms([FromRoute] int id, [FromBody] Programs programs)
        {
            if (!ModelState.IsValid)
            {
                _logger.Log(LogLevel.Debug, "In putting programs model state is invalid");
                return(BadRequest(ModelState));
            }

            if (id != programs.Program_Id)
            {
                return(BadRequest());
            }

            if (await _adminRepository.UpdateAsync(programs))
            {
                return(Ok());
            }
            else
            {
                _logger.Log(LogLevel.Debug, "Mistake while updating programs");
                return(NotFound());
            }
        }
Exemplo n.º 22
0
        public override bool Check(object os_obj)
        {
            var os = (OS)os_obj;

            if (Computer == null || Directory == null)
            {
                throw new FormatException("TestCondition: Need a node ID and directory!");
            }

            if (Comp == null)
            {
                Comp = Programs.getComputer(os, Computer);
            }

            var folder = Comp.getFolderFromPath(Directory);

            if (File == null)
            {
                return(folder.files.Count == 0);
            }

            return(folder.files.All(x => x.name != File));
        }
Exemplo n.º 23
0
        public async Task <ActionResult> DeleteProgram(int collegeId, int id)
        {
            if (!await _studyRouteRepository.CollegeExists(collegeId))
            {
                return(NotFound());
            }

            Programs programToDelete = await _studyRouteRepository.GetProgramForCollege(collegeId, id);

            if (programToDelete == null)
            {
                return(NotFound());
            }

            _studyRouteRepository.DeleteProgram(programToDelete);

            if (!await _studyRouteRepository.Save())
            {
                return(StatusCode(500, "A problem happened while handling your request."));
            }

            return(NoContent());
        }
Exemplo n.º 24
0
        public Gris5aControlViewModel(MophAppProxy mophApp)
        {
            _mophApp         = mophApp;
            ControlViewState = Gri5aControlViewState.Manual;

            Programs.Add("Program 1");
            Programs.Add("Program 2");
            Programs.Add("Program 3");
            Programs.Add("Program 4");
            Programs.Add("Program 5");
            Programs.Add("Program 6");
            Programs.Add("Program 7");
            Programs.Add("Program 8");
            SelectedProgram = "Program 1";

            LU.PropertyChanged += LU_PropertyChanged;
            LL.PropertyChanged += LL_PropertyChanged;
            RU.PropertyChanged += RU_PropertyChanged;
            RL.PropertyChanged += RL_PropertyChanged;
            GA.PropertyChanged += GA_PropertyChanged;

            _patternGenerator = new MotionPatternGenerator(OnCylinderPositionsChanged);
        }
Exemplo n.º 25
0
        ///<summary>Surround by try/catch. This should be followed by ReadField calls.  Then, when done, CloseDatabase.</summary>
        public static void ReadRecord(string iapNumber)
        {
            string dbFile = Programs.GetCur(ProgramName.IAP).Path; //@"C:\IAPlus\";

            IAPInitSystem("test");                                 //any value
            int result = IAPOpenDatabase(dbFile);

            if (result == FILE_NOT_FOUND)
            {
                throw new ApplicationException("File not found: " + dbFile);
            }
            if (result == BAD_VERSION)
            {
                throw new ApplicationException("Bad version: " + dbFile);
            }
            int iReadAction = SEARCH;          //EXACT;

            result = IAPReadARecord(ref iReadAction, "N", iapNumber);
            if (result == KEY_NOT_FOUND)
            {
                throw new ApplicationException("Key not found: " + iapNumber);
            }
        }
        public sealed override void Trigger(object os_obj)
        {
            if (delayHost == null && DelayHost != null)
            {
                var delayComp = Programs.getComputer(OS.currentInstance, DelayHost);
                if (delayComp == null)
                {
                    throw new FormatException($"{this.GetType().Name}: DelayHost could not be found");
                }
                delayHost = DelayableActionSystem.FindDelayableActionSystemOnComputer(delayComp);
            }

            if (delay <= 0f || delayHost == null)
            {
                Trigger((OS)os_obj);
                return;
            }

            DelayHost = null;
            Delay     = null;
            delayHost.AddAction(this, delay);
            delay = 0f;
        }
Exemplo n.º 27
0
        ///<summary></summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            _path = Programs.GetProgramPath(Programs.GetCur(ProgramName.DemandForce));
            if (!File.Exists(_path))
            {
                MessageBox.Show(_path + " could not be found.");
                return;
            }
            if (MessageBox.Show(Lan.g("DemandForce", "This may take 20 minutes or longer") + ".  " + Lan.g("DemandForce", "Continue") + "?", "", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                return;
            }
            _formProg        = new FormProgress();
            _formProg.MaxVal = 100;
            _formProg.NumberMultiplication = 1;
            _formProg.DisplayText          = "";
            _formProg.NumberFormat         = "F";  //Show whole percentages, not fractional percentages.
            Thread workerThread = new Thread(new ThreadStart(InstanceBridgeExport));

            workerThread.Start();
            if (_formProg.ShowDialog() == DialogResult.Cancel)
            {
                workerThread.Abort();
                MessageBox.Show(Lan.g("DemandForce", "Export cancelled") + ". " + Lan.g("DemandForce", "Partially created file has been deleted") + ".");
                CheckCreatedFile(CodeBase.ODFileUtils.CombinePaths(Path.GetDirectoryName(_path), "extract.xml"));
                _formProg.Dispose();
                return;
            }
            MessageBox.Show(Lan.g("DemandForce", "Export complete") + ". " + Lan.g("DemandForce", "Press OK to launch DemandForce") + ".");
            try {
                ODFileUtils.ProcessStart(_path);                //We might have to add extract.xml to launch command in the future.
            }
            catch {
                MessageBox.Show(_path + " is not available.");
            }
            _formProg.Dispose();
        }
Exemplo n.º 28
0
        // AAD External Call declaration for Owandy bridge (nd)

        //static extern long SendMessage(long hWnd, long Msg, long wParam, string lParam);
        ///<summary>Launches the program using command line, then passes some data using Windows API.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);
            //ProgramProperties.GetForProgram();
            string info;

            if (pat != null)
            {
                try {
                    //formHandle = Parent.Handle;
                    System.Diagnostics.Process.Start(path, ProgramCur.CommandLine);                   //"C /LINK "+ formHandle;
                    if (!IsWindow(hwndLink))
                    {
                        hwndLink = FindWindow("MjLinkWndClass", null);
                    }
                    // info = "/P:1,DEMO,Patient1";
                    //Patient id can be any string format
                    info = "/P:" + pat.PatNum + "," + pat.LName + "," + pat.FName;
                    if (IsWindow(hwndLink) == true)
                    {
                        IntPtr lResp = SendMessage(hwndLink, WM_SETTEXT, 0, info);
                    }
                }
                catch {
                    MessageBox.Show(path + " is not available, or there is an error in the command line options.");
                }
            }            //if patient is loaded
            else
            {
                try {
                    Process.Start(path);                    //should start Owandy without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }
        }
Exemplo n.º 29
0
        public static void StartupCheck()
        {
            //Skip all if not using Trojan.
            Program ProgramCur = Programs.GetCur(ProgramName.Trojan);

            if (!ProgramCur.Enabled)
            {
                return;
            }
            //Ensure that Trojan has a sane install.
            RegistryKey regKey = Registry.LocalMachine.OpenSubKey("Software\\TROJAN BENEFIT SERVICE");
            string      file   = "";

#if DEBUG
            file = @"C:\Trojan\ETW\";
            ProcessDeletedPlans(file + @"DELETEDPLANS.TXT");
            ProcessTrojanPlanUpdates(file + @"ALLPLANS.TXT");
#else
            if (regKey == null || regKey.GetValue("INSTALLDIR") == null)
            {
                //jsparks: The below is wrong.  The user should create a registry key manually.
                return;
                //The old trojan registry key is missing. Try to locate the new Trojan registry key.
                //regKey=Registry.LocalMachine.OpenSubKey("Software\\Trojan Eligibility");
                //if(regKey==null||regKey.GetValue("INSTALLDIR")==null) {//Unix OS will exit here.
                //	return;
                //}
            }
            //Process DELETEDPLANS.TXT for recently deleted insurance plans.
            file = regKey.GetValue("INSTALLDIR").ToString() + @"\DELETEDPLANS.TXT";        //C:\ETW\DELETEDPLANS.TXT

            ProcessDeletedPlans(file);
            //Process ALLPLANS.TXT for new insurance plan information.
            file = regKey.GetValue("INSTALLDIR").ToString() + @"\ALLPLANS.TXT";        //C:\ETW\ALLPLANS.TXT
            ProcessTrojanPlanUpdates(file);
#endif
        }
Exemplo n.º 30
0
        internal Dictionary <string, Game> GetInstalledGames()
        {
            var games    = new Dictionary <string, Game>();
            var programs = Programs.GetUnistallProgramsList();

            foreach (var program in programs)
            {
                if (string.IsNullOrEmpty(program.UninstallString) || program.UninstallString.IndexOf("TwitchGameRemover", StringComparison.OrdinalIgnoreCase) < 0)
                {
                    continue;
                }

                if (!Directory.Exists(program.InstallLocation))
                {
                    continue;
                }

                var gameId = program.RegistryKeyName.Trim(new char[] { '{', '}' }).ToLower();
                if (!games.ContainsKey(gameId))
                {
                    var game = new Game()
                    {
                        InstallDirectory = Paths.FixSeparators(program.InstallLocation),
                        GameId           = gameId,
                        PluginId         = Id,
                        Source           = "Twitch",
                        Name             = program.DisplayName,
                        IsInstalled      = true,
                        PlayAction       = GetPlayAction(gameId)
                    };

                    games.Add(game.GameId, game);
                }
            }

            return(games);
        }
Exemplo n.º 31
0
        ///<summary>Launches the program using a combination of command line characters and the patient.Cur data.  They also have an available file based method which passes more information like missing teeth, but we don't use it yet.  Their bridge specs are freely posted on their website.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);
            List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);

            if (pat == null)
            {
                try{
                    Process.Start(path);                    //should start Florida Probe without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
                return;
            }
            string          info  = "/search ";
            ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");

            if (PPCur.PropertyValue == "0")
            {
                info += "/chart \"" + pat.PatNum.ToString() + "\" ";
            }
            else
            {
                info += "/chart \"" + Cleanup(pat.ChartNumber) + "\" ";
            }
            info += "/first \"" + Cleanup(pat.FName) + "\" "
                    + "/last \"" + Cleanup(pat.LName) + "\"";
            //MessageBox.Show(info);
            //not used yet: /inputfile "path to file"
            try{
                Process.Start(path, info);
            }
            catch {
                MessageBox.Show(path + " is not available.");
            }
        }
Exemplo n.º 32
0
        ///<summary>Command line.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (pat == null)
            {
                try {
                    ODFileUtils.ProcessStart(path);                    //Start iCat without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
                return;
            }
            List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);
            ProgramProperty        PPCur      = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");

            if (PPCur.PropertyValue == "1" && pat.ChartNumber == "")
            {
                MessageBox.Show("This patient must have a ChartNumber entered first.");
                return;
            }
            PPCur = ProgramProperties.GetCur(ForProgram, "Acquisition computer name");
            try {
                if (Environment.MachineName.ToUpper() == PPCur.PropertyValue.ToUpper())
                {
                    SendDataServer(ProgramCur, ForProgram, pat);
                }
                else
                {
                    SendDataWorkstation(ProgramCur, ForProgram, pat);
                }
            }
            catch (Exception e) {
                MessageBox.Show("Error: " + e.Message);
            }
        }
Exemplo n.º 33
0
        /// <summary>
        /// Asks if a user is authorized
        /// </summary>
        /// <param name="Shell">Reference to the shell</param>
        /// <param name="Username">The username</param>
        /// <param name="Password">The password</param>
        /// <param name="RemoteAddress">The remote host address</param>
        /// <returns>Return true if authorization is successfull</returns>
        static bool Auth_OnAuthorize(Programs.ShellCore Shell, string Username, string Password, string RemoteAddress)
        {
            if (Username == "test" && Password == "test") return true;
            if (Username == "admin" && Password == "nimda")
            {
                // We could bind or unbind additional programs here
                //Programs.Whatever.Bind(Shell);
                //Programs.Whatever.Unbind(Shell);
                return true;
            }

            Shell.TelnetServer.Print("Hint: admin/nimda or test/test :-)");
            return false;
        }
Exemplo n.º 34
0
		protected abstract Program CreateProgram(Programs program);
Exemplo n.º 35
0
 private int getProgramsIndex(Programs ps)
 {
     return (int)ps;
 }
Exemplo n.º 36
0
		public Program GetProgram(Programs program)
		{
			return this.programs[program] ?? (this.programs[program] = this.CreateProgram(program));
		}
		/// <summary>
		///		Gets the name of the program for the given type.
		/// </summary>
		/// <param name="type"></param>
		/// <returns></returns>
		public static string GetProgramName( Programs type )
		{
			var index = (int)type;

			if ( index < programNames.Length )
			{
				return programNames[ index ];
			}

			return string.Empty;
		}
Exemplo n.º 38
0
 /// <summary>
 /// Triggered when the connection has been lost
 /// </summary>
 /// <param name="Shell">Reference to the shell</param>
 /// <param name="RemoteAddress">Hostname of the user</param>
 /// <param name="Time">Timestamp of the event</param>
 static void Shell_OnDisconnected(Programs.ShellCore Shell, string RemoteAddress, DateTime Time)
 {
     // Starts to listen again
     Shell.Start();
 }
Exemplo n.º 39
0
    public FundDefaultsHandler(SqlDataReader reader)
    {
        rdr = reader;

        DateTime tempTimeStamp;
        firstTime = true;
        eGiftId = "";

        if (rdr["EULATimeStamp"] != null && DateTime.TryParse(rdr["EULATimeStamp"].ToString(), out tempTimeStamp)) { firstTime = false; }

        // Determine Special Case Programs

        if ((rdr["egiftid"] != null) && (rdr["egiftid"] != DBNull.Value) && (!String.IsNullOrEmpty((String)rdr["egiftid"])))
        {
            // Default 
            program = Programs.PMC;
            eGiftId = rdr["egiftid"].ToString();

            if (rdr["ProgramName"] != null)
            {
                if (rdr["ProgramName"] != DBNull.Value)
                {
                    if (!string.IsNullOrEmpty(rdr["ProgramName"].ToString()))
                    {
                        switch (rdr["ProgramName"].ToString().ToUpperInvariant())
                        {
                            case "JIMMY":
                                program = Programs.Jimmy;
                                break;
                            default:
                                program = Programs.Default;
                                break;
                        }
                    }
                }
            }
        }
        else if ((rdr["programName"] != null) && (rdr["programName"] != DBNull.Value) && (!String.IsNullOrEmpty((String)rdr["programName"])))
        {
            String ProgramName = rdr["ProgramName"].ToString();

                if(String.Compare(ProgramName, Constants.ALABikeTrek2011, true) == 0)
                {
                    program = Programs.AmericanLungAssociationAutumnEscapeBikeTrek2011;
                }
                else if(String.Compare(ProgramName,  Constants.AmDiabStepOut2011, true) == 0)
                {
                    program = Programs.AmericanDiabetesAssociationTheBostonStepOut2011;
                }
                else if (String.Compare(ProgramName, Constants.CCFATeamChallenge2011, true) == 0)
                {
                    program = Programs.CCFATeamChallenge2011;
                }
                else if (String.Compare(ProgramName, Constants.SchoolFundraisers, true) == 0)
                {
                    program = Programs.SchoolFundraisers;
                }
                else if (String.Compare(ProgramName, Constants.Political_DanWinslow, true) == 0)
                {
                    program = Programs.Political_DanWinslow;
                }
                else
                {
                    program = Programs.Default;
                }
            
        }
        else
        {
            program = Programs.Default;
        }
    }