Ejemplo n.º 1
0
        protected void butEnter_Click(object sender, EventArgs e)
        {
            string answer;
            bool   message = false;

            userCLZ objUser = new userCLZ();

            objUser.user_name = "minuri";
            answer            = myHome.loadSecData(objUser, "Answer");

            if (answer == txtAnswer.Text)
            {
                message = myHome.fillAndSendMail(objUser);
                if (message == true)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "", "alert('Password is sent successfully to your mail');", true);
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "", "alert('Sending mail failure !');", true);
                }
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "alert('You have entered an incorrect answer');", true);
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                userName = Session["username"].ToString();
            }

            userCLZ objUser = new userCLZ();

            objUser.user_name = "minuri";
            string question;

            question         = myHome.loadSecData(objUser, "Question");
            txtQuestion.Text = question;
        }
Ejemplo n.º 3
0
        //handle dataflow between database for sending mails
        public DataTable loadReceiverMailAndPassword(userCLZ objUser)
        {
            string query = "";

            try
            {
                srv       = new smss_web_service_app();
                XMLreader = new readXML();
                query     = XMLreader.readXMLtxt("getReceiverMailAndPassword", "~/DATA/XML/homeXML.xml");

                query = query.Replace("@username", objUser.user_name);

                dt = srv.Search(query);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dt);
        }
Ejemplo n.º 4
0
        protected void butLogin_Click1(object sender, EventArgs e)
        {
            HomeBIZ home = new HomeBIZ();
            string  type;
            userCLZ objUser = new userCLZ(txtUName.Text, txtPWord.Text);
            bool    login   = home.login(objUser);

            if (login == true)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "alert('You have successfully logged in');", true);
                type = home.getUserType(objUser);

                Session["username"] = txtUName.Text;

                if (type == "TCH")
                {
                    Response.Redirect("Home_Teacher.aspx");
                }
                else if (type == "PRN")
                {
                    Response.Redirect("Home_V_Principal.aspx");
                }
                else if (type == "SUB")
                {
                    Response.Redirect("Home_S_T_Operator.aspx");
                }
                else if (type == "STU")
                {
                    Response.Redirect("Home_Student.aspx");
                }
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "alert('Please Try Again !');", true);
            }
        }