Exemple #1
0
        /// <summary>
        /// Login for user admin or scm
        /// </summary>
        /// <param name="idUser"></param>
        /// <param name="isAdmin"></param>
        /// <returns></returns>
        protected ActionResult LogInAdminSCM(int idUser, bool isAdmin)
        {
            //admin
            if (isAdmin)
            {
                AdminModel adminModel = DBConnection.GetAdmin(idUser);
                if (adminModel.PhotoBytes.Count() == 0)
                {
                    adminModel.Photo = adminModel.DefaultPhoto();
                }
                else
                {
                    adminModel.RenderImage();
                }

                TempData["admin"] = adminModel;
                return(RedirectToAction("Home", "AdminHome"));
            }
            //scm
            else
            {
                SCM scm = DBConnection.GetSCM(idUser);
                if (scm.PhotoBytes.Count() == 0)
                {
                    scm.Photo = scm.DefaultPhoto();
                }
                else
                {
                    scm.RenderImage();
                }
                TempData["scm"] = scm;
                return(RedirectToAction("Home", "SCMHome"));
            }
        }
Exemple #2
0
        public IActionResult SelectCourse(int?id)
        {
            var courses = _context.Courses.Find(id);

            var info =
                (from st in _context.Students.Include("Marks")
                 from co in _context.Courses.Include("Marks")
                 select new
            {
                sid = st.Id,
                sname = st.FirstName + " " + st.LastName,
                cid = co.Id,
                cname = co.Name,
                grad = st.Marks.Where(o => o.StudentId == st.Id && o.CourseId == co.Id
                                      ).FirstOrDefault().Grade
            }

                ).ToList();
            var studList  = _context.Students.ToList();
            var coursList = _context.Courses.ToList();



            HomeViewModel hvm = new HomeViewModel
            {
                AllSCM = new List <SCM>(),

                Students = studList,

                Courses = coursList
            };


            for (int i = 0; i < studList.Count; i++)
            {
                SCM sc = new SCM();
                sc.Sid   = studList[i].Id;
                sc.Sname = studList[i].FirstName + " " + studList[i].LastName;

                var tmpL = new List <Mark>();
                foreach (var inf in info)
                {
                    if (inf.sid == studList[i].Id)
                    {
                        tmpL.Add(new Mark {
                            Grade = inf.grad, CourseId = inf.cid
                        });
                        //tmpL.Add(inf.grad,inf.cid);
                    }
                }
                sc.Grades = tmpL;
                hvm.AllSCM.Add(sc);
            }
            hvm.Cid         = id;
            hvm.Description = courses.Description;
            hvm.Name        = courses.Name;


            return(View("Index", hvm));
        }
Exemple #3
0
        public string GetHospitalStockDetail(string callType, string xmlMessage)
        {
            string result = "<" + callType + ">" +
                            "<Result>False</Result>" +
                            "<Description></Description></" + callType + ">";
            string logID = Guid.NewGuid().ToString();

            try
            {
                FileLogger.WriteLog(logID + "|Start:" + xmlMessage, 1, "", callType);

                if (Helper.CheckAuthCode(callType, xmlMessage))//数据校验通过
                {
                    SCM s = new SCM();
                    result = s.GetHospitalStockDetail(xmlMessage);
                }
            }
            catch (Exception err)
            {
                result = "<" + callType + ">" +
                         "<Result>False</Result>" +
                         "<Description>" + err.Message + "</Description></" + callType + ">";
            }
            FileLogger.WriteLog(logID + "|End:" + result, 1, "", callType);
            return(result);
        }
Exemple #4
0
        public void TestGetService()
        {
            var service = SCM.GetService("localhost", "Netlogon");

            Assert.IsNotNull(service);
            Assert.AreEqual("Netlogon", service.DisplayName);
        }
Exemple #5
0
        public void TestGetServices()
        {
            var services = SCM.GetServices("localhost");

            Assert.IsTrue(services.Count > 5);
            Assert.IsNotNull(services.FirstOrDefault(S => S.DisplayName == "Netlogon"));
        }
    public void interact()
    {
        AM.Play("UIButtonPress");
        OM.Orbiter.GetComponent <SatelliteInteract>().CancelInvoke("DelayedExit");
        if (MainMenuCanvas.activeSelf == true)
        {
            Pedestal.GetComponent <MainMenuUIManager>().ClosePanel();
        }
        MainSatelliteCanvas.SetActive(true);
        SatelliteCanvasManager SCM;

        SCM              = MainSatelliteCanvas.GetComponent <SatelliteCanvasManager>();
        SCM.enabled      = true;
        SCM.IsEnabled    = true;
        SCM.OrbitManager = OrbitManager;

        SCM.LineToggle.isOn       = OM.Line;
        SCM.LineWidthSlider.value = OM.newlinewidth;
        SCM.LineShapeSlider.value = OM.newtolerance;

        SCM.LineSliderValueText.text = OM.newlinewidth.ToString();
        SCM.LineSliderValueText.text = OM.newtolerance.ToString();

        SCM.RealTimeToggle.isOn           = TM.UseRealTime;
        SCM.JulianDateSlider.interactable = !TM.UseRealTime;
        SCM.SetSliderValues();
    }
        // GET: SCMHome
        public ActionResult Home()
        {
            SCM scm = (SCM)TempData["scm"];

            DBConnection.GetMaterial(scm);
            return(View("~/Views/StorageCenterManager/SCMHome/SCMHome.cshtml", scm));
        }
Exemple #8
0
    private void Start()
    {
        scm      = GameObject.FindWithTag("GameController").GetComponent <SCM>();
        LS       = GameObject.FindWithTag("GameController").GetComponent <lifeSystem>();
        lManager = GameObject.FindWithTag("levelManager").GetComponent <levelManager>();

        if (lManager.level2)
        {
            cPanel  = GameObject.FindWithTag("jerigenMinyak").GetComponent <controlPanel>();
            cPanel2 = GameObject.FindWithTag("pipa").GetComponent <controlPanel>();
        }
    }
    IEnumerator MM()
    {
        scm = GameObject.FindGameObjectWithTag("GameController").GetComponent <SCM>();
        if (scm != null)
        {
            scm.PM.SetActive(false);
        }
        Time.timeScale = 1;
        transitionAnim.SetTrigger("end");
        yield return(new WaitForSeconds(1.5f));

        SceneManager.LoadScene("Main Menu");
    }
Exemple #10
0
        /// <summary>
        /// Open script directory
        /// </summary>
        /// <param name="directory">Script directory</param>
        /// <param name="game">Game</param>
        /// <param name="filesMode">Script files mode</param>
        /// <returns>Script files if successful, otherwise "null"</returns>
        public static GTA3ScriptFiles OpenScriptDirectory(string directory, EGame game, EGTA3ScriptFilesMode filesMode)
        {
            GTA3ScriptFiles ret = null;

            if (Directory.Exists(directory))
            {
                string main_scm_path   = Path.Combine(directory, "main.scm");
                string script_img_path = Path.Combine(directory, "script.img");
                if (File.Exists(main_scm_path) && File.Exists(script_img_path))
                {
                    List <Stream> streams = new List <Stream>();
                    try
                    {
                        streams.Add(File.Open(main_scm_path, FileMode.Open, FileAccess.Read));
                        using (IMGArchive img_archive = IMGFile.OpenRead(script_img_path))
                        {
                            IMGArchiveEntry[] entries = img_archive.Entries;
                            foreach (IMGArchiveEntry entry in entries)
                            {
                                if (entry != null)
                                {
                                    Stream stream = entry.Open();
                                    if (stream != null)
                                    {
                                        streams.Add(stream);
                                    }
                                }
                            }
                        }
                        AGTA3Script[] scripts = new AGTA3Script[streams.Count];
                        for (int i = 0; i < scripts.Length; i++)
                        {
                            scripts[i] = new SCM(game, streams[i]);
                        }
                        ret = new GTA3ScriptFiles(game, scripts);
                    }
                    catch (Exception e)
                    {
                        Console.Error.WriteLine(e);
                        foreach (Stream stream in streams)
                        {
                            stream.Dispose();
                        }
                    }
                    streams.Clear();
                }
            }
            return(ret);
        }
Exemple #11
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="workingDir">dir where to save all source and package</param>
        /// <param name="projFileRelativePath">project file</param>
        /// <param name="remoteUri">scm URL </param>
        public AssemblySCM(string workingDir, string projFileRelativePath, string remoteUri)
        {
            SourceUriOrigin = remoteUri;

            Uri u = new Uri(remoteUri);

            Name = System.IO.Path.GetFileNameWithoutExtension(u.AbsolutePath);

            this.ProjectFilePath = System.IO.Path.Combine(workingDir, Name, projFileRelativePath);
            this.WorkingDir      = System.IO.Path.Combine(workingDir, Name);
            if (!System.IO.Directory.Exists(this.WorkingDir))
            {
                System.IO.Directory.CreateDirectory(this.WorkingDir);
            }

            Type T = typeof(Git.git_scm);

            scm = (SCM)Activator.CreateInstance(T, new object[] { this.WorkingDir, remoteUri });
        }
        public ActionResult Register() //(SCMModel emple)
        {
            SCM scm = (SCM)TempData["scm"];

            IDictionary <string, string> dict = new Dictionary <string, string>();

            foreach (string material in scm.Materials)
            {
                dict.Add(material, Request[material].ToString());
            }
            string carnet = Request["InputCarnet"].ToString();

            if (DBConnection.ExistUser(carnet).Equals(1))
            {
                string email         = DBConnection.GetEmailUser(carnet);
                string messageToSend = String.Format("El estudiante {0} ha ingresado ", carnet);

                foreach (KeyValuePair <string, string> item in dict)
                {
                    if (!string.IsNullOrWhiteSpace(item.Value))
                    {
                        //if (DBConnection.VerifyPromotion()){} --> APLICAR PROMOCION

                        DBConnection.InsertRegister(carnet, scm.Id, item.Key, item.Value);
                        messageToSend += String.Format("{0} kg del material {1}. ", item.Value, item.Key);
                    }
                }

                TwitterConnection.SetCredentials();
                TwitterConnection.Publish(messageToSend);

                SendEmail(email, messageToSend);

                ViewBag.Message = String.Format("Se registro el material con exito, para el estudiante {0}", carnet);
                return(PartialView("~/Views/StorageCenterManager/SCMHome/SCMHome.cshtml", scm));
            }
            else
            {
                ViewBag.Message = String.Format("Numero {0} no existe como Usuario Estudiante", carnet);
                return(PartialView("~/Views/StorageCenterManager/SCMHome/SCMHome.cshtml", scm));
            }
        }
Exemple #13
0
        public void TestCreateGetStartStopDeleteService()
        {
            bool result = SCM.CreateService("localhost", "SharpSploit Service", "SharpSploitSvc", @"C:\Temp\SharpSploitService.exe");

            Assert.IsTrue(result);

            var service = SCM.GetService("localhost", "SharpSploitSvc");

            Assert.AreEqual("SharpSploitSvc", service.DisplayName);
            Assert.AreEqual("SharpSploit Service", service.ServiceName);
            Assert.AreEqual(ServiceControllerStatus.Stopped, service.Status);
            Assert.AreEqual(false, service.CanStop);

            result = SCM.StartService("localhost", "SharpSploitSvc");
            Assert.IsTrue(result);

            service = SCM.GetService("localhost", "SharpSploitSvc");
            Assert.AreEqual("SharpSploitSvc", service.DisplayName);
            Assert.AreEqual("SharpSploit Service", service.ServiceName);
            Assert.AreEqual(ServiceControllerStatus.Running, service.Status);
            Assert.AreEqual(true, service.CanStop);

            result = SCM.StopService("localhost", "SharpSploitSvc");
            Assert.IsTrue(result);

            service = SCM.GetService("localhost", "SharpSploitSvc");
            Assert.AreEqual("SharpSploitSvc", service.DisplayName);
            Assert.AreEqual("SharpSploit Service", service.ServiceName);
            Assert.AreEqual(ServiceControllerStatus.Stopped, service.Status);
            Assert.AreEqual(false, service.CanStop);

            result = SCM.DeleteService("localhost", "SharpSploit Service");
            Assert.IsTrue(result);

            service = SCM.GetService("localhost", "SharpSploitSvc");
            Assert.IsNull(service);
        }
Exemple #14
0
 private void Start()
 {
     scm = GameObject.FindWithTag("GameController").GetComponent <SCM>();
     LS  = GameObject.FindWithTag("GameController").GetComponent <lifeSystem>();
 }
Exemple #15
0
        public void TestGetServiceBadServiceName()
        {
            var service = SCM.GetService("localhost", "blah");

            Assert.IsNull(service);
        }
Exemple #16
0
        public void TestGetServicesBadComputerName()
        {
            var results = SCM.GetServices("blah");

            Assert.IsNull(results);
        }
 public void closePause()
 {
     SceneContromM = GameObject.FindWithTag("GameController").GetComponent <SCM>();
     SceneContromM.PM.SetActive(false);
     Time.timeScale = 1;
 }