Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     // Authentication
     string redirect = VerifyAA.Verify(Session
                                       , Request
                                       , Response
                                       , "NoRight.aspx");
 }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Authentication
            string redirect = VerifyAA.Verify(Session
                                              , Request
                                              , Response
                                              , "NoRight.aspx");

            actPage = Request["actPage"];

            if ((actPage == null) || (actPage.Trim().Length == 0) || (actPage.Equals("list")))
            {
                DoListUser(Request["qsearch"]);
            }
            else if (actPage.Equals("add_submit"))
            {
                DoAddSubmitUser();
                Response.Redirect("Administrator.aspx");
            }
            else if (actPage.Equals("add"))
            {
                DoAddUser();
            }
            else if (actPage.Equals("edit"))
            {
                targetID = Request["targetID"];
                DoEditUser(targetID);
            }
            else if (actPage.Equals("edit_submit"))
            {
                targetID = Request["targetID"];
                DoEditSubmitUser(targetID);
                Response.Redirect("Administrator.aspx");
            }
            else if (actPage.Equals("delete"))
            {
                targetID = Request["targetID"];
                DoDeleteUser(targetID);
                Response.Redirect("Administrator.aspx");
            }
        }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Authentication
        string redirect = VerifyAA.Verify(Session
                                          , Request
                                          , Response
                                          , "NoRight.aspx");

        AppUser user = (AppUser)Session[SessionVar.USER];

        /*      if (user == null)
         *    {
         *        Response.Write("Not login");
         *        return;
         *    }
         */
        /*
         * DBManager db = new MySQLDBManager("localhost", "BTS", "root", "btsman");
         * ArrayList result = db.QueryAll("SELECT * FROM User");
         * for (int i = 0; i < result.Count; i++)
         * {
         *  ArrayList aRow = (ArrayList)result[i];
         *  for (int j = 0; j < aRow.Count; j++)
         *  {
         *      string val = db.AsString(aRow[j]);
         *      Response.Write(val + "&nbsp");
         *  }
         *  Response.Write("<br>");
         * }
         * OdbcDataReader reader = db.Query("SELECT * FROM User");
         * while (reader.Read())
         * {
         *  AppUser user = AppUser.CreateForm(reader);
         *  Response.Write(user + "<br>");
         * }
         * db.Close();
         * */
        Response.Write("<br>" + user);
    }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Authentication
            string redirect = VerifyAA.Verify(Session
                                              , Request
                                              , Response
                                              , "NoRight.aspx");

            // Collect paramters
            actPage = Request.Form.Get("actPage");
            if (actPage == null)
            {
                actPage = Request["actPage"];
            }
            targetID = Request.Form.Get("targetID");
            if (targetID == null)
            {
                targetID = Request["targetID"];
            }

            // log
            log.StampLine(Logger.DETAILED, "Request [" + Request["ASP.NET_SessionId"] + "][" + Request.RawUrl + "][actPage=" + actPage + "&targetID=" + targetID + "]");
            log.StampLine(Logger.DEBUG, "Param [" + Request["ASP.NET_SessionId"] + "][" + Request.Params.ToString() + "]");

            if ((actPage == null) || (actPage.Trim().Length == 0) || (actPage.Equals("list")))
            {
                string qSearch     = Request.Form.Get("qsearch");
                bool   isNewSearch = false;
                if (qSearch != null)
                {
                    isNewSearch = true;
                }
                else
                {
                    qSearch = Request["qsearch"];
                }
                DoListStudent(qSearch, isNewSearch);
            }
            else if (actPage.Equals("view"))
            {
                targetID = Request["targetID"];
                DoViewStudent(targetID);
            }
            else if (actPage.Equals("add_submit"))
            {
                bool result = DoAddSubmitStudent();
                if (result)
                {
                    Response.Redirect("StudentManage.aspx");
                }
                else
                {
                    Response.Redirect("StudentManage.aspx?actPage=add&errorText=" + errorText);
                }
            }
            else if (actPage.Equals("edit"))
            {
                targetID = Request["targetID"];
                DoEditStudent(targetID);
            }
            else if (actPage.Equals("edit_submit"))
            {
                targetID = Request["targetID"];
                DoEditSubmitStudent(targetID);
                Response.Redirect("StudentManage.aspx");
            }
            else if (actPage.Equals("save_as_excel"))
            {
                String urlPath = DoSaveStudentListAsExcel();
                //DoListStudent("", true);
                Response.Redirect(urlPath);
            }
            else if (actPage.Equals("delete"))
            {
                targetID = Request["targetID"];
                DoDeleteStudent(targetID);
                Response.Redirect("StudentManage.aspx");
            }
        }
Esempio n. 5
0
        //    protected System.Web.UI.HtmlControls.HtmlInputFile portrait;

        protected void Page_Load(object sender, EventArgs e)
        {
            // Authentication
            string redirect = VerifyAA.Verify(Session
                                              , Request
                                              , Response
                                              , "NoRight.aspx");

            // Collect paramters
            actPage = Request.Form.Get("actPage");
            if (actPage == null)
            {
                actPage = Request["actPage"];
            }
            targetID = Request.Form.Get("targetID");
            if (targetID == null)
            {
                targetID = Request["targetID"];
            }

            // log
            log.StampLine(Logger.DETAILED, "Request [" + Request["ASP.NET_SessionId"] + "][" + Request.RawUrl + "][actPage=" + actPage + "&targetID=" + targetID + "]");
            log.StampLine(Logger.DEBUG, "Param [" + Request["ASP.NET_SessionId"] + "][" + Request.Params.ToString() + "]");

            if ((actPage == null) || (actPage.Trim().Length == 0) || (actPage.Equals("list")))
            {
                string qSearch     = Request.Form.Get("qsearch");
                bool   isNewSearch = false;
                if (qSearch != null)
                {
                    isNewSearch = true;
                }
                else
                {
                    qSearch = Request["qsearch"];
                }
                DoListBranch(qSearch, isNewSearch);
            }
            else if (actPage.Equals("add_submit"))
            {
                DoAddSubmitBranch();
                Response.Redirect("BranchManage.aspx");
            }
            else if (actPage.Equals("edit"))
            {
                targetID = Request["targetID"];
                DoEditBranch(targetID);
            }
            else if (actPage.Equals("edit_submit"))
            {
                targetID = Request["targetID"];
                DoEditSubmitBranch(targetID);
                Response.Redirect("BranchManage.aspx");
            }
            else if (actPage.Equals("delete"))
            {
                targetID = Request["targetID"];
                DoDeleteBranch(targetID);
                Response.Redirect("BranchManage.aspx");
            }
        }
Esempio n. 6
0
        //    protected System.Web.UI.HtmlControls.HtmlInputFile portrait;


        protected void Page_Load(object sender, EventArgs e)
        {
            // Authentication
            string redirect = VerifyAA.Verify(Session
                                              , Request
                                              , Response
                                              , "NoRight.aspx");

            // Collect paramters
            actPage = Request.Form.Get("actPage");
            if (actPage == null)
            {
                actPage = Request["actPage"];
            }
            targetID = Request.Form.Get("targetID");
            if (targetID == null)
            {
                targetID = Request["targetID"];
            }

            // log
            log.StampLine(Logger.DETAILED, "Request [" + Request["ASP.NET_SessionId"] + "][" + Request.RawUrl + "][actPage=" + actPage + "&targetID=" + targetID + "]");
            log.StampLine(Logger.DEBUG, "Param [" + Request["ASP.NET_SessionId"] + "][" + Request.Params.ToString() + "]");


            if ((actPage == null) || (actPage.Trim().Length == 0) || (actPage.Equals("list")))
            {
                string qSearch = Request.Form.Get("qsearch");
                string filter  = Request.Form.Get("filter");

                bool isNewSearch = false;
                if (qSearch != null)
                {
                    isNewSearch = true;
                }
                else
                {
                    qSearch = Request["qsearch"];
                    filter  = Request["filter"];
                }

                quickSearch  = qSearch;
                filterSearch = filter;
                DoListCourse(qSearch, isNewSearch, filter);
            }
            else if (actPage.Equals("view"))
            {
                targetID = Request["targetID"];
                DoViewCourse(targetID);
            }
            else if (actPage.Equals("init_print"))
            {
                targetID = Request["targetID"];
                outBuf   = new StringBuilder();
                outBuf.Append(DoInitPrintStudentList(targetID));
                Session[SessionVar.PRINT_INFO] = new StringBuilder(outBuf.ToString());
            }
            else if (actPage.Equals("save_as_excel"))
            {
                targetID = Request["targetID"];
                // outBuf = DoSaveStudentListAsExcel(targetID);
                //Session[SessionVar.EXCEL_INFO] = new StringBuilder(outBuf.ToString());

                //DoViewCourse(targetID);
                //actPage = "view";
                //Response.Redirect("CourseManage.aspx?actPage=view&targetID="+targetID);

                String urlPath = DoSaveStudentListAsExcel(targetID);
                //DoListStudent("", true);
                Response.Redirect(urlPath);

                Response.Redirect("SaveAsExcel.aspx");
            }
            else if (actPage.Equals("add"))
            {
                DoAddCourse();
            }
            else if (actPage.Equals("add_submit"))
            {
                DoAddSubmitCourse();
                Response.Redirect("CourseManage.aspx");
            }
            else if (actPage.Equals("edit"))
            {
                targetID = Request["targetID"];
                DoEditCourse(targetID);
            }
            else if (actPage.Equals("edit_submit"))
            {
                targetID = Request["targetID"];
                DoEditSubmitCourse(targetID);
                Response.Redirect("CourseManage.aspx");
            }
            else if (actPage.Equals("delete"))
            {
                targetID = Request["targetID"];
                DoDeleteCourse(targetID);
                Response.Redirect("CourseManage.aspx?errorText=" + errorText);
            }
        }
Esempio n. 7
0
        //    protected System.Web.UI.HtmlControls.HtmlInputFile portrait;


        protected void Page_Load(object sender, EventArgs e)
        {
            // Authentication
            string redirect = VerifyAA.Verify(Session
                                              , Request
                                              , Response
                                              , "NoRight.aspx");

            // Collect paramters
            actPage = Request.Form.Get("actPage");
            if (actPage == null)
            {
                actPage = Request["actPage"];
            }
            targetID = Request.Form.Get("targetID");
            if (targetID == null)
            {
                targetID = Request["targetID"];
            }

            // log
            log.StampLine(Logger.DETAILED, "Request [" + Request["ASP.NET_SessionId"] + "][" + Request.RawUrl + "][actPage=" + actPage + "&targetID=" + targetID + "]");
            log.StampLine(Logger.DEBUG, "Param [" + Request["ASP.NET_SessionId"] + "][" + Request.Params.ToString() + "]");


            if ((actPage == null) || (actPage.Trim().Length == 0) || (actPage.Equals("new")) || (actPage.Equals("select_course")))
            {
                if ((actPage == null) || (actPage.Trim().Length == 0) || (actPage.Equals("new")))
                {
                    // clear session data
                    Session[SessionVar.CURRENT_REGIS] = null;
                }

                // DoListPromotion(Request["qsearch"]);
            }
            else if (actPage.Equals("select_student"))
            {
                RegisTransaction reg = (RegisTransaction)Session[SessionVar.CURRENT_REGIS];
                if ((reg == null) || (reg._courses == null) || (reg._courses.Count == 0))
                {
                    actPage = "select_course";
                    return;
                }
            }
            else if (actPage.Equals("confirm_registration"))
            {
                RegisTransaction reg = (RegisTransaction)Session[SessionVar.CURRENT_REGIS];
                if ((reg == null) || (reg._student == null))
                {
                    actPage = "select_student";
                    return;
                }

                ProcessPrintAdditionalInfoForm(reg);
            }
            else if (actPage.Equals("add_new_student_submit"))
            {
                Student t = ProcessWizAddNewStudent();

                if (t == null)
                {
                    Response.Redirect("RegisterCourse.aspx?actPage=select_student&errorText=" + errorText);
                    return;
                }

                // save to session
                RegisTransaction reg = (RegisTransaction)Session[SessionVar.CURRENT_REGIS];
                reg._student   = t;
                reg._studentID = t._studentID;
                Session[SessionVar.CURRENT_REGIS] = reg;
                // list
                Response.Redirect("RegisterCourse.aspx?actPage=select_student");
            }
            else if (actPage.Equals("submit_registration"))
            {
                RegisTransaction reg = (RegisTransaction)Session[SessionVar.CURRENT_REGIS];
                if ((reg == null) || (reg._courses == null) || (reg._courses.Count == 0))
                {
                    errorText = "ข้อมูลการลงทะเบียนไม่สมบูรณ์ โปรดลองใหม่อีกครั้ง";
                    return;
                }

                ProcessRegistration(reg);
                // clear session data
                Session[SessionVar.CURRENT_REGIS] = null;
                Response.Redirect("RegisterCourse.aspx?actPage=registration_complete&targetId=" + reg._transactionID);
            }
            else if (actPage.Equals("registration_complete"))
            {
                DoInitPrintAll(targetID);
            }
            else if (actPage.Equals("cancel_registration"))
            {
                // clear session data
                Session[SessionVar.CURRENT_REGIS] = null;
                Response.Redirect("Home.aspx");
            }
        }
        //    protected System.Web.UI.HtmlControls.HtmlInputFile portrait;

        protected void Page_Load(object sender, EventArgs e)
        {
            // Authentication
            string redirect = VerifyAA.Verify(Session
                                              , Request
                                              , Response
                                              , "NoRight.aspx");

            // Collect paramters
            actPage = Request.Form.Get("actPage");
            if (actPage == null)
            {
                actPage = Request["actPage"];
            }
            targetID = Request.Form.Get("targetID");
            if (targetID == null)
            {
                targetID = Request["targetID"];
            }

            // log
            log.StampLine(Logger.DETAILED, "Request [" + Request["ASP.NET_SessionId"] + "][" + Request.RawUrl + "][actPage=" + actPage + "&targetID=" + targetID + "]");
            log.StampLine(Logger.DEBUG, "Param [" + Request["ASP.NET_SessionId"] + "][" + Request.Params.ToString() + "]");

            if ((actPage == null) || (actPage.Trim().Length == 0) || (actPage.Equals("list")))
            {
                string qSearch     = Request.Form.Get("qsearch");
                bool   isNewSearch = false;
                if (qSearch != null)
                {
                    isNewSearch = true;
                }
                else
                {
                    qSearch = Request["qsearch"];
                }
                DoListRegistration(qSearch, isNewSearch);
            }
            else if (actPage.Equals("edit"))
            {
                DoEditRegistration(targetID);
            }
            else if (actPage.Equals("edit_submit"))
            {
                targetID = Request["targetID"];
                DoEditSubmitRegistration(targetID);
                Response.Redirect("RegistrationManage.aspx?actPage=edit&targetID=" + targetID + "&msgText=" + msgText);
                //Response.Redirect("RegistrationManage.aspx?actPage=init_print&targetId=" + registrationID);
            }
            else if (actPage.Equals("refund"))
            {
                targetID = Request["targetID"];
                DoRefund(targetID);
                Response.Redirect("RegistrationManage.aspx?actPage=edit&targetID=" + targetID + "&msgText=" + msgText);
                //Response.Redirect("RegistrationManage.aspx?actPage=init_print&targetId=" + registrationID);
            }
            else if (actPage.Equals("init_print_card"))
            {
                targetID = Request["targetID"];
                outBuf   = new StringBuilder();
                outBuf.Append(DoInitPrinRegistrationCard(targetID));
                Session[SessionVar.PRINT_INFO] = new StringBuilder(outBuf.ToString());
            }
            else if (actPage.Equals("init_print_receipt"))
            {
                targetID = Request["targetID"];
                outBuf   = new StringBuilder();
                outBuf.Append(DoInitPrinRegistrationReceipt(targetID, "สำหรับนักเรียน"));
                outBuf.Append(DoInitPrinRegistrationReceipt(targetID, "สำหรับโรงเรียน"));
                Session[SessionVar.PRINT_INFO] = new StringBuilder(outBuf.ToString());
            }
            else if (actPage.Equals("init_print_all"))
            {
                targetID = Request["targetID"];
                outBuf   = new StringBuilder();

                PageBreaker pb = new PageBreaker(Config.PAGE_BREAK_MAX);

                StringBuilder tmpBuf = DoInitPrinRegistrationCard(targetID);
                pb.Print(outBuf, tmpBuf, Config.PAGE_BREAK_CARD);
                outBuf.AppendLine("<br>");

                tmpBuf = DoInitPrinRegistrationReceipt(targetID, "ต้นฉบับ");
                pb.Print(outBuf, tmpBuf, Config.PAGE_BREAK_RECEIPT);
                outBuf.AppendLine("<br>");
                tmpBuf = DoInitPrinRegistrationReceipt(targetID, "สำเนา");
                pb.Print(outBuf, tmpBuf, Config.PAGE_BREAK_RECEIPT);

                Session[SessionVar.PRINT_INFO] = new StringBuilder(outBuf.ToString());
            }
        }
Esempio n. 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Authentication
            string redirect = VerifyAA.Verify(Session
                                              , Request
                                              , Response
                                              , "NoRight.aspx");

            actPage = Request["actPage"];

            // log
            log.StampLine(Logger.DETAILED, "Request [" + Request["ASP.NET_SessionId"] + "][" + Request.RawUrl + "][actPage=" + actPage + "&targetID=" + targetID + "]");
            log.StampLine(Logger.DEBUG, "Param [" + Request["ASP.NET_SessionId"] + "][" + Request.Params.ToString() + "]");


            if ((actPage == null) || (actPage.Trim().Length == 0) || (actPage.Equals("list")))
            {
                DoListPaidGroup(Request["qsearch"]);
            }
            else if (actPage.Equals("add_submit"))
            {
                DoAddSubmitPaidGroup();
                Response.Redirect("PaidGroupManage.aspx");
            }
            else if (actPage.Equals("add"))
            {
                DoAddPaidGroup();
            }
            else if (actPage.Equals("edit"))
            {
                targetID = Request["targetID"];
                DoEditPaidGroup(targetID);
            }
            else if (actPage.Equals("edit_submit"))
            {
                targetID = Request["targetID"];
                DoEditSubmitPaidGroup(targetID);
                Response.Redirect("PaidGroupManage.aspx");
            }
            else if (actPage.Equals("add_teacher_submit"))
            {
                targetID = Request["targetID"];
                DoAddTeacherSubmit(targetID, Request["teacher_id"]);
                DoEditPaidGroup(targetID);
                actPage = "edit";
            }
            else if (actPage.Equals("remove_teacher_submit"))
            {
                targetID  = Request["targetID"];
                target2ID = Request["target2ID"];
                DoRemoveTeacherSubmit(targetID, target2ID);
                DoEditPaidGroup(targetID);
                actPage = "edit";
            }
            else if (actPage.Equals("delete"))
            {
                targetID = Request["targetID"];
                DoDeletePaidGroup(targetID);
                Response.Redirect("PaidGroupManage.aspx");
            }
        }
Esempio n. 10
0
        //    protected System.Web.UI.HtmlControls.HtmlInputFile portrait;


        protected void Page_Load(object sender, EventArgs e)
        {
            // Authentication
            string redirect = VerifyAA.Verify(Session
                                              , Request
                                              , Response
                                              , "NoRight.aspx");

            // Collect paramters
            actPage = Request.Form.Get("actPage");
            if (actPage == null)
            {
                actPage = Request["actPage"];
            }
            targetID = Request.Form.Get("targetID");
            if (targetID == null)
            {
                targetID = Request["targetID"];
            }

            // log
            log.StampLine(Logger.DETAILED, "Request [" + Request["ASP.NET_SessionId"] + "][" + Request.RawUrl + "][actPage=" + actPage + "&targetID=" + targetID + "]");
            log.StampLine(Logger.DEBUG, "Param [" + Request["ASP.NET_SessionId"] + "][" + Request.Params.ToString() + "]");


            string sdate = Request.Form.Get("start_date");
            string edate = Request.Form.Get("end_date");

            branchRegisedID = Request.Form.Get("branch_regis_id");
            branchID        = Request.Form.Get("branch_id");
            userName        = Request.Form.Get("username");
            paidMethod      = Request.Form.Get("paid_method");
            String statusVal = Request.Form.Get("status");

            status = (statusVal == null) ? 0 : Int32.Parse(statusVal);

            // Verify branch
            if (branchRegisedID == null)
            {
                AppUser user = (AppUser)Session[SessionVar.USER];
                if (!user.IsAdmin())
                {
                    branchRegisedID = user._branchID.ToString();
                }
                else
                {
                    branchRegisedID = "0";
                }
            }
            if (branchID == null)
            {
                branchID = "0";
            }

            // Verify user
            if (userName == null)
            {
                userName = "******";
            }

            if (paidMethod == null)
            {
                paidMethod = "-1";
            }



            if ((actPage == null) || (actPage.Trim().Length == 0) || (actPage.Equals("report")))
            {
                LoadData(sdate, edate, paidMethod, branchRegisedID, branchID, userName, status);
                // Presentation
                DoInitPrintDailyRegistration();
                Session[SessionVar.PRINT_INFO] = new StringBuilder(outBuf.ToString());
                DoReportDailyRegistration();
            }
            else if (actPage.Equals("save_as_excel"))
            {
                LoadData(sdate, edate, paidMethod, branchRegisedID, branchID, userName, status);

                String urlPath = DoSaveDailyAsExcel();

                Response.Redirect(urlPath);
            }
        }
Esempio n. 11
0
        //    protected System.Web.UI.HtmlControls.HtmlInputFile portrait;

        protected void Page_Load(object sender, EventArgs e)
        {
            // Authentication
            string redirect = VerifyAA.Verify(Session
                                              , Request
                                              , Response
                                              , "NoRight.aspx");

            // Collect paramters
            actPage = Request.Form.Get("actPage");
            if (actPage == null)
            {
                actPage = Request["actPage"];
            }
            targetID = Request.Form.Get("targetID");
            if (targetID == null)
            {
                targetID = Request["targetID"];
            }

            // log
            log.StampLine(Logger.DETAILED, "Request [" + Request["ASP.NET_SessionId"] + "][" + Request.RawUrl + "][actPage=" + actPage + "&targetID=" + targetID + "]");
            log.StampLine(Logger.DEBUG, "Param [" + Request["ASP.NET_SessionId"] + "][" + Request.Params.ToString() + "]");

            if ((actPage == null) || (actPage.Trim().Length == 0) || (actPage.Equals("list")))
            {
                string qSearch     = Request.Form.Get("qsearch");
                bool   isNewSearch = false;
                if (qSearch != null)
                {
                    isNewSearch = true;
                }
                else
                {
                    qSearch = Request["qsearch"];
                }
                DoListPayment(qSearch, isNewSearch);
            }
            else if (actPage.Equals("view"))
            {
                DoViewPayment(targetID);
            }
            else if (actPage.Equals("list_by_teacher"))
            {
                //   DoListByTeacher();
            }
            else if (actPage.Equals("preview_multi"))
            {
                targetID = Request["teacher_id"];
                //DoPreviewMultiPayment(targetID);
            }
            else if (actPage.Equals("paid_submit"))
            {
                targetID = Request["targetID"];
                int paymentID = DoPaidSubmitPayment(targetID);
                Response.Redirect("PaymentManage.aspx?actPage=init_print&targetId=" + paymentID);
            }
            else if (actPage.Equals("init_print"))
            {
                targetID = Request["targetID"];
                DoInitPrintReceiptPaymentData(targetID);
                Session[SessionVar.PRINT_INFO] = new StringBuilder(outBuf.ToString());
            }    /*
                  * else if (actPage.Equals("delete"))
                  * {
                  * targetID = Request["targetID"];
                  * DoDeletePayment(targetID);
                  * Response.Redirect("PaymentManage.aspx");
                  * }*/
        }