コード例 #1
0
        //Index page for the Admin Role
        public ActionResult Index()
        {
            var            objUtilities = new Utilities.Utilities();
            AdminViewModel model        = objUtilities.GetStudentsAndTeachersList();

            return(View(model));
        }
コード例 #2
0
        //Index page for the Student Role
        public ActionResult StudentHome(int studentId)
        {
            var objUtilities       = new Utilities.Utilities();
            StudentViewModel model = objUtilities.GetCourseGrades(studentId);

            model.StudentId = studentId;
            model.Name      = objUtilities.GetStudentName(studentId);
            return(View(model));
        }
コード例 #3
0
        //Index page for the Teacher Role
        public ActionResult TeacherHome(int courseId)
        {
            var objUtilities = new Utilities.Utilities();
            var model        = objUtilities.GetStudentsList();

            model.CourseId = courseId;
            model.Name     = objUtilities.GetTeacherName(courseId);
            return(View(model));
        }
コード例 #4
0
 public bool SaveVideo(string path, SaveMode mode)
 {
     if (mode == SaveMode.SaveToPhotoGallery)
     {
         return(natcamprofessional.CallStatic <bool>("saveVideo", path, (int)mode));
     }
     Util.LogError("SaveVideo API only supports saving to gallery");
     return(false);
 }
コード例 #5
0
ファイル: NatCamiOS.cs プロジェクト: xsvonjhs/VOMO
 public bool SaveVideo(string path, SaveMode mode)
 {
     if (mode == SaveMode.SaveToPhotoGallery)
     {
         return(SaveVideo(path, (int)mode));
     }
     Util.LogError("SaveVideo API only supports saving to gallery");
     return(false);
 }
コード例 #6
0
        public void OnPost()
        {
            Utilities.Utilities registro = new Utilities.Utilities();
            Usuario             usu      = new Usuario();

            usu.Nombre     = Nombre;
            usu.NickName   = Nickname;
            usu.Correo     = Correo;
            usu.Contraseña = Contraseña;
            registro.HacerRegistroUsuario(usu);
        }
コード例 #7
0
        public ActionResult AddStudent(AddStudentModel model, string returnUrl)
        {
            var  objUtilities = new Utilities.Utilities();
            bool validateInsertTeacherRecord = objUtilities.InsertStudentRecord(model);

            if (validateInsertTeacherRecord)
            {
                return(RedirectToAction("Index", "Home"));
            }
            ModelState.AddModelError("", "UserName or StudentId Already exists.");
            return(View());
        }
コード例 #8
0
        public ActionResult Login(LoginViewModel model, string returnUrl)
        {
            var objUtilities       = new Utilities.Utilities();
            var validateAdminLogin = objUtilities.ValidateAdminLogin(model);

            if (validateAdminLogin)
            {
                return(RedirectToAction("Index", "Home"));
            }
            ModelState.AddModelError("", "Invalid login attempt.");
            return(View(model));
        }
コード例 #9
0
        public ActionResult AssignGrades(AssignGradeModel model, int CourseId)
        {
            var objUtilities        = new Utilities.Utilities();
            var validateAssignGrade = objUtilities.AssignGrade(model);

            if (validateAssignGrade)
            {
                return(RedirectToAction("TeacherHome", "Home", new { courseId = CourseId }));
            }
            ModelState.AddModelError("", "Enter Valid StudentId.");
            return(View());
        }
コード例 #10
0
        public ActionResult TeacherLogin(LoginViewModel model, string returnUrl)
        {
            var objUtilities         = new Utilities.Utilities();
            var validateTeacherLogin = objUtilities.ValidateTeacherLogin(model);

            if (validateTeacherLogin)
            {
                var courseIdTaughtByTeacher = objUtilities.FetchCourseIdTaughtByTeacher(model.Username);
                return(RedirectToAction("TeacherHome", "Home", new { courseId = courseIdTaughtByTeacher }));
            }
            ModelState.AddModelError("", "Invalid login attempt.");
            return(View(model));
        }
コード例 #11
0
        public ActionResult StudentLogin(LoginViewModel model, string returnUrl)
        {
            var objUtilities         = new Utilities.Utilities();
            var validateStudentLogin = objUtilities.ValidateStudentLogin(model);

            if (validateStudentLogin)
            {
                var currentStudentId = objUtilities.FetchStudentId(model.Username);
                return(RedirectToAction("StudentHome", "Home", new { studentId = currentStudentId }));
            }
            ModelState.AddModelError("", "Invalid login attempt.");
            return(View(model));
        }
コード例 #12
0
        public ActionResult Register(RegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                var objUtilities = new Utilities.Utilities();
                var result       = objUtilities.RegisterAdmin(model);
                if (result)
                {
                    return(RedirectToAction("RegisterSuccess", "Home"));
                }
            }

            return(View(model));
        }
コード例 #13
0
 public AccountController(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     IEmailSender emailSender,
     ILogger <AccountController> logger,
     AppSettings appSettings,
     IHttpContextAccessor httpContextAccessor)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _emailSender   = emailSender;
     _logger        = logger;
     _appSettings   = appSettings;
     _utilities     = new Utilities.Utilities(appSettings, httpContextAccessor);
 }
コード例 #14
0
ファイル: NatCamiOS.cs プロジェクト: xsvonjhs/VOMO
        protected override void SavePhoto(byte[] png, SaveMode mode, int callback)
        {
            if (png == null)
            {
                return;
            }
            SetAlbumName(AlbumName);
            int    size = Marshal.SizeOf(png[0]) * png.Length;
            IntPtr ptr  = Marshal.AllocHGlobal(size);

            try {
                Marshal.Copy(png, 0, ptr, png.Length);
                SavePhoto(ptr, unchecked ((UIntPtr)(uint)size), (int)mode, callback);
            }
            catch (Exception e) { Util.LogError("Failed to save photo with exception: " + e.Message); }
            finally { Marshal.FreeHGlobal(ptr); }
        }
コード例 #15
0
        public void PreviewBuffer(out IntPtr ptr, out int width, out int height, out int size)
        {
            ptr = IntPtr.Zero; width = height = size = 0;
            AndroidJavaObject jRet = pro.Call <AndroidJavaObject>("previewBuffer");

            if (jRet.GetRawObject().ToInt32() != 0)
            {
                long[] res = AndroidJNIHelper.ConvertFromJNIArray <long[]>(jRet.GetRawObject());
                ptr    = (IntPtr)res[0];
                width  = (int)res[1];
                height = (int)res[2];
                size   = (int)res[3];
            }
            else
            {
                Util.LogError("Failed to get preview buffer");
            }
        }
コード例 #16
0
ファイル: SendRequest.cs プロジェクト: kentaylor/TaxiShare
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            Utilities.Utilities ut = new Utilities.Utilities();

            if (!(tbLoc.Text.Equals("Enter Location")) || !(tbDest.Text.Equals("Enter Destination")) || !(startLoc.getReady() == 0) || !(destLoc.getReady() == 0))
            {
                string confirm = "Are you are heading from " + tbLoc.Text + " to " + tbDest.Text + "?";
                if (Sense.SenseMessageBox.Show(confirm, "Confirm Request", Sense.SenseMessageBox.SenseMessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    //send request through sms
                    if (ut.sendRequest(tbLoc.Text, tbDest.Text))
                    {
                        string str = "Your request has been sent to the TaxiShare system.";
                        if (Sense.SenseMessageBox.Show(str, "Request Confirmed", Sense.SenseMessageBox.SenseMessageBoxButtons.OK) == DialogResult.OK)
                        {

                            this.Dispose();
                            this.Close();
                        }
                    }
                    else
                    {
                        string str = "Your request has failed. Click OK to go back to the main menu.";
                        if (Sense.SenseMessageBox.Show(str, "Request Failed", Sense.SenseMessageBox.SenseMessageBoxButtons.OK) == DialogResult.OK)
                        {
                            this.Dispose();
                            this.Close();
                        }
                    }
                }
            }
            else
            {
                string str = "Please complete the request before confirming.";
                if (Sense.SenseMessageBox.Show(str, "Request Failed", Sense.SenseMessageBox.SenseMessageBoxButtons.OK) == DialogResult.OK)
                {
                }
            }
        }
コード例 #17
0
ファイル: INatCamBase.cs プロジェクト: xsvonjhs/VOMO
        protected static void OnBarcode(float x, float y, float w, float h, long timestamp, IntPtr supplement, IntPtr data, int len, int format)
        {
            if (data == IntPtr.Zero)
            {
                Util.LogError("Detected barcode string does not exist"); return;
            }
            string code = Marshal.PtrToStringUni(data, len);

            if (code == null)
            {
                Util.LogError("Detected barcode string is null"); return;
            }
            object[] _supplement = null;
            if (supplement != IntPtr.Zero)
            {
                ;                            // Unimplemented
            }
            instance.dispatch.Dispatch(() => {
                if (instance.onMetadata != null)
                {
                    instance.onMetadata(new Barcode(x, y, w, h, timestamp, _supplement, code, format));
                }
            });
        }
コード例 #18
0
 public int GetExposureMode(int camera)
 {
     Util.LogError("Exposure mode is not supported on legacy");
     return(0);
 }
コード例 #19
0
 public float MaxZoomRatio(int camera)
 {
     Util.LogError("Zoom is not supported on legacy");
     return(1f);
 }
コード例 #20
0
 public float GetExposure(int camera)
 {
     Util.LogError("Exposure is not supported on legacy");
     return(0f);
 }
コード例 #21
0
 public bool IsTorchSupported(int camera)
 {
     Util.LogError("Torch is not supported on legacy");
     return(false);
 }
コード例 #22
0
 public float VerticalFOV(int camera)
 {
     Util.LogError("Field of view is not supported on legacy");
     return(0f);
 }
コード例 #23
0
 public void SetTorch(int camera, int state)
 {
     Util.LogError("Torch is not supported on legacy");
 }
コード例 #24
0
 public void SetZoom(int camera, float ratio)
 {
     Util.LogError("Zoom is not supported on legacy");
 }
コード例 #25
0
 public void SetFlash(int camera, int state)
 {
     Util.LogError("Flash is not supported on legacy");
 }
コード例 #26
0
 public void SetFocusMode(int camera, int state)
 {
     Util.LogError("Focus mode is not supported on legacy");
 }
コード例 #27
0
ファイル: AWSRequests.cs プロジェクト: 13webstreet/playlift
 public AWSRequests(string fileName)
 {
     UploadFileName = fileName;
     DownloadFileName = fileName;
     util = new Utilities.Utilities();
 }
コード例 #28
0
 public S3FileDelivery(string filePath, string folderName)
 {
     UploadFileName = filePath;
     FolderName = folderName;
     util = new Utilities.Utilities();
 }
コード例 #29
0
 public S3FileDelivery()
 {
     util = new Utilities.Utilities();
 }
コード例 #30
0
 public S3FileDelivery(string filePath)
 {
     UploadFileName = filePath;
     DownloadFileName = filePath;
     util = new Utilities.Utilities();
 }
コード例 #31
0
 public void SetExposure(int camera, float bias)
 {
     Util.LogError("Exposure is not supported on legacy");
 }
コード例 #32
0
 public void SetPhotoResolution(int camera, int width, int height)
 {
     Util.LogError("Photo resolution is not supported on legacy");
 }
コード例 #33
0
 public void SetExposureMode(int camera, int state)
 {
     Util.LogError("Exposure mode is not supported on legacy");
 }
コード例 #34
0
 public GamesController(AppSettings appSettings, IHttpContextAccessor httpContextAccessor)
 {
     _appSettings         = appSettings;
     _httpContextAccessor = httpContextAccessor;
     _utilities           = new Utilities.Utilities(appSettings, httpContextAccessor);
 }
コード例 #35
0
 public void SetFocus(int camera, float x, float y)
 {
     Util.LogError("Focus is not supported on legacy");
 }