Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         UsFuns uf  = new UsFuns();
         User   tmp = uf.UsrInfo(Session["login"].ToString());
         if (Session["login"] == null)
         {
             Response.Write("<script language='javascript'>alert('Response Timeout, Please Try Again.'); location.href='login.aspx'</script>");
         }
         else if (tmp.Admin == '2')
         {
             this.U_service1.Visible       = false;
             this.U_showmsg1.Visible       = false;
             this.U_showpet1.Visible       = false;
             this.Button_submit.Visible    = false;
             this.DropDownList_pet.Visible = false;
             SqlFuns sf = new SqlFuns();
             bindusr(sf.SearchUserByPermission('1'));
         }
         else
         {
             Response.Write("<script language='javascript'>alert('Response Timeout, Please Try Again.'); location.href='login.aspx'</script>");
         }
     }
 }
Example #2
0
    protected void Button_submit_Click(object sender, EventArgs e)
    {
        SqlFuns         sf  = new SqlFuns();
        IList <Payment> res = sf.SearchPayment(DateTime.Parse(TextBox1.Text), DateTime.Parse(TextBox2.Text));

        bind(res);
        ShowTotal(res);
    }
Example #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         SqlFuns sf = new SqlFuns();
         bind(sf.SearchStudent(true));
     }
 }
Example #4
0
    protected void show_usr(object sender, CommandEventArgs e)
    {
        SqlFuns sf = new SqlFuns();

        bindpet(sf.SearchPetByUsrid(e.CommandName.ToString()));
        this.DropDownList_pet.Visible = true;
        DropDownList_pet_SelectedIndexChanged(sender, e);
    }
Example #5
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        SqlFuns         sf  = new SqlFuns();
        IList <Payment> res = sf.SearchPayment(ushort.Parse(DropDownList_pf.SelectedValue));

        bind(res);
        ShowTotal(res);
    }
Example #6
0
    protected void Button_all_Click(object sender, EventArgs e)
    {
        SqlFuns         sf  = new SqlFuns();
        IList <Payment> res = sf.SearchPayment(uint.Parse(DropDownList_stu.SelectedValue), ushort.Parse(DropDownList_pf.SelectedValue), DateTime.Parse(TextBox1.Text), DateTime.Parse(TextBox2.Text));

        bind(res);
        ShowTotal(res);
    }
Example #7
0
    protected void show_pet(object sender, CommandEventArgs e)
    {
        this.U_pet1.Visible = true;
        SqlFuns sf = new SqlFuns();

        this.U_pet1.pet                = sf.SearchPetById(int.Parse(e.CommandName.ToString()));
        this.U_pet1.Visible            = true;
        this.Button_update.Visible     = true;
        this.Button_submit_pet.Visible = true;
    }
Example #8
0
    protected void Button_submit_pet_Click(object sender, EventArgs e)
    {
        SqlFuns sf     = new SqlFuns();
        int     result = sf.EditPet(this.U_pet1.pet);

        if (result > 0)
        {
            Response.Write("<script language='javascript'>alert('Create Successfully.'); location.href='manager.aspx</script>");
        }
        else
        {
            Response.Write("<script language='javascript'>alert('Failed, Please Connect System Manager.');</script>");
        }
    }
Example #9
0
    protected void Button_update_Click(object sender, EventArgs e)
    {
        SqlFuns sf     = new SqlFuns();
        int     result = sf.EditUser(this.U_usr1.user);

        if (result > 0)
        {
            Response.Write("<script language='javascript'>alert('Update Successfully.'); location.href='manager.aspx'</script>");
        }
        else
        {
            Response.Write("<script language='javascript'>alert('Failed, Please Connect System Manager.');</script>");
        }
    }
Example #10
0
        static void Main(string[] args)
        {
            SqlFuns         sf = new SqlFuns();
            IList <Student> st = sf.SearchStudent(true);

            for (int i = 2; i < st.Count; i++)
            {
                StudentRank t = new StudentRank();
                t.Stnum = st[i].Stnum;
                t.Rank  = 1;
                t.Date  = st[i].Joindate;
                sf.AddStudentRank(t);
            }
        }
Example #11
0
    protected void Button_login_Click(object sender, EventArgs e)
    {
        SqlFuns sf    = new SqlFuns();
        UsFuns  uf    = new UsFuns();
        Member  login = uf.UserLogin(TextBox_usr.Text, TextBox_pwd.Text);

        if (login != null)
        {
            Response.Write("<script language='javascript'>alert('Login Succed.'); location.href='Manage.aspx'</script>");
        }
        else
        {
            Response.Write("<script language='javascript'>alert('Failed!!! Please login again.')</script>");
        }
    }
Example #12
0
    protected void show_usr(object sender, CommandEventArgs e)
    {
        SqlFuns sf = new SqlFuns();

        bindpet(sf.SearchPetByUsrid(e.CommandName.ToString()));
        this.U_usr1.user               = sf.SearchUserById(e.CommandName.ToString());
        this.U_usr1.Visible            = true;
        this.U_usr2.Visible            = false;
        this.U_pet1.Visible            = false;
        this.U_pet1.Visible            = false;
        this.Repeater_petlist.Visible  = true;
        this.Button_newpet.Visible     = true;
        this.Button_update.Visible     = true;
        this.Button_submit_pet.Visible = false;
        this.Button_insert.Visible     = false;
    }
Example #13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["login"] == null)
         {
             Response.Write("<script language='javascript'>alert('Response Timeout, Please Try Again.'); location.href='login.aspx'</script>");
         }
         else
         {
             SqlFuns     sf   = new SqlFuns();
             IList <Pet> pets = sf.SearchPetByUsrid(Session["login"].ToString());
             bindpet(pets);
             DropDownList_pet_SelectedIndexChanged(sender, e);
         }
     }
 }
Example #14
0
    protected void DropDownList_stu_SelectedIndexChanged(object sender, EventArgs e)
    {
        SqlFuns sf   = new SqlFuns();
        uint    snum = uint.Parse(DropDownList_stu.SelectedValue);
        Student stu  = sf.SearchStudent(snum);

        Label_name.Text   = stu.Name;
        Label_birth.Text  = stu.Birth.ToLongDateString();
        Label_jodate.Text = stu.Joindate.ToLongDateString();
        Label_mobile.Text = stu.Mobile;
        Label_email.Text  = stu.Email;
        Label_addr.Text   = stu.Address;
        bind(sf.SearchPayment(snum));
        bind(sf.SearchStudentRank(snum));
        bind(sf.SearchAttendanceSNUM(snum));
        Label1.Text = Label2.Text = "";
        IList <StuParent> spr = sf.SearchStuParent(snum);

        for (int i = 0; i < spr.Count; i++)
        {
            if (spr[i].Stpar == true)
            {
                Student pst = sf.SearchStudent(spr[i].Spnum);
                if (spr[i].Mord == true)
                {
                    Label1.Text = "Student Number: " + pst.Stnum + ", <br />Name: " + pst.Name + ", <br />Birthday: " + pst.Birth.ToShortDateString() + ", <br />Join Date: " + pst.Joindate.ToShortDateString() + ", <br />Address: " + pst.Address + ", <br />Phone Number: " + pst.Mobile + ", <br />Email: " + pst.Email;
                }
                else
                {
                    Label2.Text = "Student Number: " + pst.Stnum + ", <br />Name: " + pst.Name + ", <br />Birthday: " + pst.Birth.ToShortDateString() + ", <br />Join Date: " + pst.Joindate.ToShortDateString() + ", <br />Address: " + pst.Address + ", <br />Phone Number: " + pst.Mobile + ", <br />Email: " + pst.Email;
                }
            }
            else
            {
                Parent par = sf.SearchParent(spr[i].Spnum);
                if (spr[i].Mord == true)
                {
                    Label1.Text = "Name: " + par.Name + ", <br />Phone Number: " + par.Mobile + ", <br />Email: " + par.Email;
                }
                else
                {
                    Label2.Text = "Name: " + par.Name + ", <br />Phone Number: " + par.Mobile + ", <br />Email: " + par.Email;
                }
            }
        }
    }
Example #15
0
        static void Main(string[] args)
        {
            SqlFuns sf = new SqlFuns();

            for (int i = 4; i <= 30; i++)
            {
                StuParent sp0 = new StuParent();
                StuParent sp1 = new StuParent();
                sp0.Stnum = uint.Parse(i + "");
                sp1.Stnum = uint.Parse(i + "");
                sp0.Mord  = true;
                sp1.Mord  = false;
                Random r    = new Random();
                double seed = r.NextDouble();
                if (seed > 0.5)
                {
                    sp0.Stpar = true;
                    double stmp = r.NextDouble() * 30;
                    sp0.Spnum = (uint)(stmp % 30);
                }
                else
                {
                    sp0.Stpar = false;
                    double stmp = r.NextDouble() * 10;
                    sp0.Spnum = (uint)(stmp % 10);
                }
                sf.AddStuParent(sp0);

                double sed = r.NextDouble();
                if (sed > 0.5)
                {
                    sp0.Stpar = true;
                    double stmp = r.NextDouble() * 30;
                    sp0.Spnum = (uint)(stmp % 30);
                }
                else
                {
                    sp0.Stpar = false;
                    double stmp = r.NextDouble() * 10;
                    sp0.Spnum = (uint)(stmp % 10);
                }
                sf.AddStuParent(sp1);
            }
        }
Example #16
0
    protected void Button_submit_Click(object sender, EventArgs e)
    {
        SqlFuns  sf  = new SqlFuns();
        Services tmp = this.U_service1.services;

        tmp.Date = DateTime.Now;
        tmp.Peid = int.Parse(this.DropDownList_pet.SelectedValue);
        int result = sf.AddServices(tmp);

        if (result > 0)
        {
            Response.Write("<script language='javascript'>alert('Submit Successfully.');</script>");
            //Response.Redirect("manager.aspx");
        }
        else
        {
            Response.Write("<script language='javascript'>alert('Failed, Please Connect System Manager.');</script>");
        }
    }
Example #17
0
    protected void DropDownList_pet_SelectedIndexChanged(object sender, EventArgs e)
    {
        SqlFuns     sf   = new SqlFuns();
        IList <Pet> pets = sf.SearchPetByUsrid(Session["login"].ToString());

        this.U_showpet1.petinfo = pets[DropDownList_pet.SelectedIndex];
        IList <Services> pslist = sf.SearchServicesByPeid(pets[DropDownList_pet.SelectedIndex].ID);

        if (pslist != null)
        {
            this.U_showmsg1.msgdata = pslist;
            DateTime ndt = pslist[0].Date.AddHours(sf.SearchOperationById(pslist[0].Operation).NextTime);
            this.Label_lasttime.Text = ndt.ToString();
        }
        else
        {
            this.Label_lasttime.Text = "";
        }
    }
Example #18
0
    protected void Button_submit_Click(object sender, EventArgs e)
    {
        SqlFuns    sf  = new SqlFuns();
        Attendance tmp = new Attendance();

        tmp.Course  = uint.Parse(DropDownList_cos.SelectedValue);
        tmp.Student = uint.Parse(DropDownList_stu.SelectedValue);
        tmp.Date    = DateTime.Parse(TextBox_dt.Text);
        int result = sf.AddAttendance(tmp);

        if (result > 0)
        {
            Response.Write("<script language='javascript'>alert('Success!!!');</script>");
        }
        else
        {
            Response.Write("<script language='javascript'>alert('Failed!!!');</script>");
        }
    }
Example #19
0
    protected void Button_submit_Click(object sender, EventArgs e)
    {
        SqlFuns sf  = new SqlFuns();
        Payment tmp = new Payment();

        tmp.Stnum  = uint.Parse(DropDownList_stu.SelectedValue);
        tmp.Payfor = ushort.Parse(DropDownList_pf.SelectedValue);
        tmp.Fee    = double.Parse(TextBox_fee.Text);
        tmp.Paydt  = DateTime.Now;
        int result = sf.AddPayment(tmp);

        if (result > 0)
        {
            Response.Write("<script language='javascript'>alert('Success!!!');</script>");
        }
        else
        {
            Response.Write("<script language='javascript'>alert('Failed!!!');</script>");
        }
    }
Example #20
0
    protected void DropDownList_pet_SelectedIndexChanged(object sender, EventArgs e)
    {
        SqlFuns sf   = new SqlFuns();
        Pet     ptmp = sf.SearchPetById(int.Parse(DropDownList_pet.SelectedValue));

        this.U_showpet1.petinfo    = ptmp;
        this.U_showpet1.Visible    = true;
        this.U_service1.Visible    = true;
        this.Button_submit.Visible = true;
        IList <Services> pslist = sf.SearchServicesByPeid(ptmp.ID);

        if (pslist != null)
        {
            this.U_showmsg1.Visible = true;
            this.U_showmsg1.msgdata = pslist;
            DateTime ndt = pslist[0].Date.AddHours(sf.SearchOperationById(pslist[0].Operation).NextTime);
        }
        else
        {
        }
    }
Example #21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         UsFuns uf  = new UsFuns();
         User   tmp = uf.UsrInfo(Session["login"].ToString());
         if (Session["login"] == null)
         {
             Response.Write("<script language='javascript'>alert('Response Timeout, Please Try Again.'); location.href='login.aspx'</script>");
         }
         else if (tmp.Admin == '0')
         {
             SqlFuns sf = new SqlFuns();
             bindusr(sf.SearchUserAll());
         }
         else
         {
             Response.Write("<script language='javascript'>alert('Response Timeout, Please Try Again.'); location.href='login.aspx'</script>");
         }
     }
 }
Example #22
0
    protected void Button_newpet_Click(object sender, EventArgs e)
    {
        Pet newpet = new Pet();

        newpet.Usid    = this.U_usr1.user.Username;
        newpet.Name    = "Default";
        newpet.Birth   = DateTime.Now;
        newpet.Species = 0;
        newpet.Gender  = '2';
        newpet.Image0  = "Default.png";
        SqlFuns sf     = new SqlFuns();
        int     result = sf.AddPet(newpet);

        if (result > 0)
        {
            Response.Write("<script language='javascript'>alert('Create Successfully.'); location.href='manager.aspx</script>");
        }
        else
        {
            Response.Write("<script language='javascript'>alert('Failed, Please Connect System Manager.');</script>");
        }
    }
    protected void DropDownList_dow_SelectedIndexChanged(object sender, EventArgs e)
    {
        SqlFuns sf = new SqlFuns();

        bind(sf.SearchTimetable(short.Parse(DropDownList_dow.SelectedValue)));
    }
Example #24
0
    protected void DropDownList_req_SelectedIndexChanged(object sender, EventArgs e)
    {
        SqlFuns sf = new SqlFuns();

        bind(sf.SearchRequirement(uint.Parse(DropDownList_req.SelectedValue)));
    }
Example #25
0
    protected void DropDownList_level_SelectedIndexChanged(object sender, EventArgs e)
    {
        SqlFuns sf = new SqlFuns();

        bind(sf.SearchCourseLEVEL(ushort.Parse(DropDownList_level.SelectedValue)));
    }
Example #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlFuns sf = new SqlFuns();

        bind_operation(sf.SearchOperationAll());
    }