protected void _LoadProfile()
        {
            var odataconn = WsConfig.ReturnNavObj();
            var profiles  = odataconn.StudentPortal.Where(a => a.Adm_No == Convert.ToInt32(Session["uniqadmNo"].ToString())).ToArray();

            for (int i = 0; i < profiles.Count(); i++)
            {
                var profile = profiles[i];
                inputName.Value      = profile.Name;
                inputPhone.Value     = profile.Phone_No;
                inputResidence.Value = profile.Address;
                inputEmail.Value     = profile.E_Mail;

                var gend = profile.Gender;
                switch (gend)
                {
                case "Male":
                    ddlGender.SelectedIndex = 1;
                    break;

                case "Female":
                    ddlGender.SelectedIndex = 2;
                    break;

                default:
                    ddlGender.SelectedIndex = 0;
                    break;
                }
            }
        }
        protected void LoadComplaintsHere()
        {
            var wsconnect      = WsConfig.ObjNav;
            var wsodataconnect = WsConfig.ReturnNavObj();
            int count          = 0;
            var complaints     = wsodataconnect.StudentsComplaints.Where(u => u.UniqNo == Convert.ToInt32(Session["uniqadmNo"])).ToArray();

            for (int i = 0; i < complaints.Count(); i++)
            {
                count++;
                //var onecomplaint = complaints[i];
                //int entryno = onecomplaint.No;
                //counter.InnerHtml = count.ToString();
                //reportDate.InnerHtml = Convert.ToDateTime(onecomplaint.Complaint_Date).ToString("dd-MM-yyyy");
                //complainReply.InnerHtml = onecomplaint.Complaint_Reply;
                //status.InnerHtml = onecomplaint.Status;
                //filedComplaintDetails.InnerHtml = wsconnect.FnLoadStudentComplaint(entryno);
                //var entryNos = complaints.Select(n => n.No).ToArray();
                //for (int j = 0; j < entryNos.Count(); j++)
                //{
                //    filedComplaintDetails.InnerHtml = wsconnect.FnLoadStudentComplaint(entryno);
                //}
                //filedComplaintDetails.InnerHtml = wsconnect.FnLoadAllComplaints(Convert.ToInt32(Session["uniqadmNo"]));
            }
        }
        protected void _LoadProfile()
        {
            var odataconn = WsConfig.ReturnNavObj();
            var profiles  = odataconn.StudentPortal.Where(a => a.Adm_No == Convert.ToInt32(Session["uniqadmNo"].ToString())).ToArray();

            for (int i = 0; i < profiles.Count(); i++)
            {
            }
        }
        protected void SendNewPassword(string myEmail, string myName, string myPassword)
        {
            //begin send email to VC now, down here
            const string mSubject  = @"Request password Reset";
            string       emailbody = "Dear " + myName + "<br/>";

            emailbody += "<br />You have reset you password successfully. Your new Password is " + myPassword + ". Kindly go to Login";
            emailbody += "<br /><br />Thank you";
            //send email to user
            bool emsendtoVc = WsConfig.MailFunction(emailbody, myEmail, mSubject);
        }
        protected void _GetUnits()
        {
            var wsodataconnect = WsConfig.ReturnNavObj();

            //var unitcode = wsodataconnect.call_for_Proposal.ToList().Where(pty => pty.Proposal_Type == "Grant");
            //ddlAccountType.DataSource = projs;
            //ddlAccountType.DataTextField = "Project";
            //ddlAccountType.DataValueField = "Call_Ref_Number";
            //ddlAccountType.DataBind();
            //ddlAccountType.Items.Insert(0, "--Select Project--");
        }
Example #6
0
        protected void _LoadAComplaint()
        {
            var wsodataconnect = WsConfig.ReturnNavObj();
            var stdCompln      =
                wsodataconnect.StudentsComplaints.Where(n => n.No == Convert.ToInt32(Session["complaintCode"]))
                .ToArray();

            for (int i = 0; i < stdCompln.Count(); i++)
            {
                var onecomplaint = stdCompln[i];
                txtAreaStdComplain.Text = onecomplaint.Complaint_Text;
                // txtareaComplaintReply.Text = onecomplaint.Complaint_Reply;
            }
        }
        protected void GetStudentInfo()
        {
            var wsconnection = WsConfig.ObjNav;
            var odataconn    = WsConfig.ReturnNavObj();

            var studentinfo = odataconn.StudentPortal.Where(n => n.No == Session["studentCode"].ToString()).ToList();

            foreach (var oneinfo in studentinfo)
            {
                feebalance.InnerHtml = "<h4>KES." + oneinfo.Balance_LCY + "</h4>";
            }
            int studentdetails = wsconnection.FnCountUnits(Session["studentCode"].ToString());

            unitsregistered.InnerHtml = "<h4>" + studentdetails + "</h4>";
        }
        public void ChangeStudentPassword()
        {
            if (string.IsNullOrWhiteSpace(StudentCode.Text.Trim()))
            {
                passwordfeedback.InnerHtml = "<div id='alert alert-danger'>Please enter your Admission number!</div>";
                return;
            }

            try
            {
                var studentcode = StudentCode.Text.Trim();
                var newpassword = NewPassword();
                var odataconn   = WsConfig.ReturnNavObj();
                var email       = "";
                var name        = "";
                var studentinfo =
                    odataconn.StudentPortal.Where(c => c.No == studentcode).ToArray();
                for (int i = 0; i < studentinfo.Count(); i++)
                {
                    var oneinfo = studentinfo[i];
                    email = oneinfo.E_Mail;
                    name  = oneinfo.Name;
                }


                String   status = WsConfig.ObjNav.FnResetPassword(studentcode, EncryptP(newpassword));
                String[] info   = status.Split('*');
                passwordfeedback.InnerHtml = "<div class='alert alert-" + info[0] + "'>" + info[1] + "</div>";

                if (string.IsNullOrWhiteSpace(email))
                {
                    passwordfeedback.InnerHtml = "<div id='alert alert-danger'>Your Email Account is not on our database!</div>";
                }
                else
                {
                    SendNewPassword(email, name, newpassword);
                }
            }
            catch (Exception exception)
            {
                passwordfeedback.InnerHtml = "<div id='alert alert-danger'>" + exception.Message + "</div>";
            }
        }
Example #9
0
        protected void _GetUnitInformation()
        {
            var wsodataconnect = WsConfig.ReturnNavObj();

            var acadSess = wsodataconnect.AcademicSessionList.ToList();

            ddlAcademicSess.DataSource     = acadSess;
            ddlAcademicSess.DataTextField  = "Session_Name";
            ddlAcademicSess.DataValueField = "Session_Code";
            ddlAcademicSess.DataBind();
            ddlAcademicSess.Items.Insert(0, "--Select Session--");

            var acadMod = wsodataconnect.Module.ToList();

            ddlModule.DataSource     = acadMod;
            ddlModule.DataTextField  = "Module_Description";
            ddlModule.DataValueField = "Module_Code";
            ddlModule.DataBind();
            ddlModule.Items.Insert(0, "--Select Module--");
        }
        public void ChangeTutorPassword()
        {
            if (string.IsNullOrWhiteSpace(tutorCode.Text.Trim()))
            {
                passwordfeedback.InnerHtml = "<div id='alert alert-danger'>Please enter your tutor email address!</div>";
                return;
            }

            try
            {
                var tutornumber = tutorCode.Text.Trim();
                var newpassword = NewPassword();
                var odataconn   = WsConfig.ReturnNavObj();
                var name        = "";
                var email       = "";
                var tutorinfo   =
                    odataconn.Employees.Where(c => c.No == tutornumber).ToArray();
                for (int i = 0; i < tutorinfo.Count(); i++)
                {
                    var onetutorinfo = tutorinfo[i];
                    email = onetutorinfo.E_Mail;
                    name  = onetutorinfo.First_Name + " " + onetutorinfo.Middle_Name + " " + onetutorinfo.Last_Name;
                }
                if (string.IsNullOrWhiteSpace(email))
                {
                    passwordfeedback.InnerHtml = "<div id='alert alert-danger'>Your Email Account is not on our database!</div>";
                }
                else
                {
                    //String status = WsConfig.ObjNav.FnResetTutorPassword(email, EncryptP(newpassword));
                    String   status = WsConfig.ObjNav.FnResetTutorPassword(tutornumber, newpassword);
                    String[] info   = status.Split('*');
                    SendNewPassword(email, name, newpassword);
                    passwordfeedback.InnerHtml = "<div class='alert alert-" + info[0] + "'>" + info[1] + "</div>";
                }
            }
            catch (Exception exception)
            {
                passwordfeedback.InnerHtml = "<div id='alert alert-danger'>" + exception.Message + "</div>";
            }
        }
        protected void btnLogin_OnClick(object sender, EventArgs e)
        {
            var    wsconnection = WsConfig.ObjNav;
            var    odataconn    = WsConfig.ReturnNavObj();
            string studentCode  = StudentCode.Text.Trim();
            string password     = Password.Text.Trim();

            try
            {
                bool loginstatus = wsconnection.FnLogin(studentCode, EncryptP(password));
                switch (loginstatus)
                {
                case true:
                    Session["usertype"] = 0;
                    var studentinfo =
                        odataconn.StudentPortal.Where(c => c.No == studentCode).ToList();
                    foreach (var info in studentinfo)
                    {
                        Session["uniqadmNo"]   = info.Adm_No;
                        Session["studentCode"] = studentCode;
                        Session["StudentName"] = info.Name;

                        WsConfig.ObjNav.GetItemImage(Session["studentCode"].ToString());
                        Response.Redirect("Dashboard.aspx");
                    }
                    break;

                case false:
                    loginfeedback.InnerHtml = "<div class='alert alert-danger'>Login failed!</div>";
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                // ignored
            }
        }
        protected void LoadUnitsatStart()
        {
            var wsconnector = WsConfig.ReturnNavObj();

            //var programs = wsconnector.Programs.ToList();
            //ddlProgram.DataSource = programs;
            //ddlProgram.DataTextField = "Program_Name";
            //ddlProgram.DataValueField = "Program_Code";
            //ddlProgram.DataBind();

            var programName = Request.QueryString["programName"];
            var unitCode    = Request.QueryString["unitCode"];
            var studentCode = Request.QueryString["studentCode"];
            var unitName    = Request.QueryString["unitName"];
            var tutorName   = Request.QueryString["tutorName"];
            var totalHours  = Request.QueryString["totalHours"];

            txtUnitCode.Text   = unitCode;
            txtUnitName.Text   = unitName;
            txtTutorname.Text  = tutorName;
            txtTotalhours.Text = totalHours;
            txtProgram.Text    = programName;
        }
        protected void btnLogin_OnClick(object sender, EventArgs e)
        {
            var    wsconnection = WsConfig.ObjNav;
            var    odataconn    = WsConfig.ReturnNavObj();
            string tutorscode   = TutorCode.Text.Trim();
            string password     = Password.Text.Trim();

            //try
            //{
            //    //string loginstatus = wsconnection.FnLoginTutor(tutorEmail, EncryptP(password));
            string loginstatus = wsconnection.FnLoginTutor(tutorscode, password);

            String[] logininfo = loginstatus.Split('*');
            if (logininfo[1] == "logingranted")
            {
                Session["usertype"] = 1;
                var tutorinfo =
                    odataconn.Employees.Where(c => c.No == tutorscode).ToList();
                foreach (var oneinfo in tutorinfo)
                {
                    Session["TutorCode"] = tutorscode;
                    Session["TutorName"] = oneinfo.First_Name + " " + oneinfo.Middle_Name + " " + oneinfo.Last_Name;
                    //  WsConfig.ObjNav.GetItemImage(Session["TutorCode"].ToString());
                    Response.Redirect("Dashboard_Tutors.aspx");
                }
            }
            else
            {
                loginfeedback.InnerHtml = "<div class='alert alert-" + logininfo[0] + "'>" + logininfo[1] + "</div>";
            }
            //}
            // catch (Exception ex)
            //{
            //   // ignored
            // loginfeedback.InnerHtml = "<div class='alert alert-" +ex.Message + "</div>";
            // }
        }