Ejemplo n.º 1
0
        protected void lbtnEdit_Click(object sender, EventArgs e)
        {
            try
            {
                BLL.ExamScheduleBiz biz = new ExamScheduleBiz();
                GridViewRow         gr  = (GridViewRow)((LinkButton)sender).Parent.Parent;
                txtCodeRoom.Text   = ((Label)gr.FindControl("lblCodeRoom")).Text;
                txtNameRoom.Text   = ((Label)gr.FindControl("lblNameRoom")).Text;
                txtSeatAmount.Text = ((Label)gr.FindControl("lblSeatAmount")).Text;
                lblOldSeat.Text    = txtSeatAmount.Text;

                lblSeatAmountPlace.Text = biz.SumSeatFromPlace(ddlExamPlace.SelectedValue.ToString(), txtCodeRoom.Text).DataResponse.ToString();



                txtCodeRoom.Enabled = false;
                btnUpdate.Visible   = true;
                btnSave.Visible     = false;
                uplPopUp.Update();
                mpeExamRoom.Show();
            }
            catch
            {
            }
        }
Ejemplo n.º 2
0
 protected void btnPopUp_Click(object sender, EventArgs e)
 {
     try
     {
         BLL.ExamScheduleBiz biz = new ExamScheduleBiz();
         lblSeatAmountPlace.Text = biz.SumSeatFromPlace(ddlExamPlace.SelectedValue.ToString(), "").DataResponse.ToString();
         // ClearControl();
         if (ddlExamPlaceGroup.SelectedIndex > 0 && ddlExamPlace.SelectedIndex > 0)
         {
             // ddlExamPlace.Enabled = true;
             // ddlExamPlaceGroup.Enabled = true;
             txtCodeRoom.Enabled = true;
             btnUpdate.Visible   = false;
             btnSave.Visible     = true;
             ClearControl();
             mpeExamRoom.Show();
             uplPopUp.Update();
         }
         else
         {
             UCError.ShowMessageError = SysMessage.ChooseData;
             UCError.ShowModalError();
         }
     }
     catch
     { }
 }
Ejemplo n.º 3
0
        private Boolean CheckBeforeSave()
        {
            Boolean BeforeSave = true;

            try
            {
                if (txtSeatAmount.Text.ToInt() == 0)
                {
                    UCError.ShowMessageError = "จำนวนที่นั่งต้องมีค่ามากกว่า 0";
                    UCError.ShowModalError();
                    BeforeSave = false;
                }
                else
                {
                    if (txtSeatAmount.Text.ToInt() > 30000)
                    {
                        UCError.ShowMessageError = "ห้องสอบแต่ละห้องสามารถรองรับผู้สมัครสอบได้สูงสุด 30,000 คน เท่านั้น";
                        UCError.ShowModalError();
                        BeforeSave = false;
                    }
                    else
                    {
                        BLL.ExamScheduleBiz biz = new ExamScheduleBiz();
                        string Room             = "";
                        if (txtCodeRoom.Enabled == false)
                        {
                            Room = txtCodeRoom.Text;
                        }
                        lblSeatAmountPlace.Text = (lblSeatAmountPlace.Text == "") ? biz.SumSeatFromPlace(ddlExamPlace.SelectedValue.ToString(), Room).DataResponse.ToString() : lblSeatAmountPlace.Text;
                        lbltotalSeat.Text       = biz.SumSeat(ddlExamPlace.SelectedValue.ToString()).DataResponse.ToString();
                        lbltotalSeat.Text       = lbltotalSeat.Text == "" ? "0" : lbltotalSeat.Text;
                        BeforeSave = true;
                    }
                }
            }
            catch
            {
            }
            return(BeforeSave);
        }