コード例 #1
0
ファイル: scheduling.aspx.cs プロジェクト: radtek/ClearView
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            int intApplication = 290;

            oUser       = new Users(intProfile, dsn);
            oScheduling = new Scheduling(intProfile, dsn);
            if (Request.QueryString["schd_id"] != null && Request.QueryString["schd_id"] != "")
            {
                schd_id = Int32.Parse(Request.QueryString["schd_id"]);
                ds      = oScheduling.GetSch(DateTime.Parse(Request.QueryString["date"]), DateTime.MinValue, schd_id);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    lblFacilitator.Text = ds.Tables[0].Rows[0]["facilitator"].ToString();
                    lblEventName.Text   = ds.Tables[0].Rows[0]["event"].ToString();
                    lblLocation.Text    = ds.Tables[0].Rows[0]["location"].ToString();
                    lblNetMeeting.Text  = ds.Tables[0].Rows[0]["netmeeting"].ToString() == string.Empty ? "Not Available" : ds.Tables[0].Rows[0]["netmeeting"].ToString();
                    lblConfLine.Text    = ds.Tables[0].Rows[0]["confline"].ToString() == string.Empty ? "Not Available" : ds.Tables[0].Rows[0]["confline"].ToString();
                    lblPassCode.Text    = ds.Tables[0].Rows[0]["passcode"].ToString() == string.Empty ? "Not Available" : ds.Tables[0].Rows[0]["passcode"].ToString();
                    lblStartTime.Text   = ds.Tables[0].Rows[0]["start_time"].ToString();
                    lblEndTime.Text     = ds.Tables[0].Rows[0]["end_time"].ToString();
                    if (Request.QueryString["view"] != null && Request.QueryString["view"] != "")
                    {
                        panView.Visible     = true;
                        rptUsers.DataSource = oScheduling.GetSchUsers(schd_id);
                        rptUsers.DataBind();
                        lblUsersNone.Visible = (rptUsers.Items.Count == 0);
                    }
                    else
                    {
                        if (Request.QueryString["max"] != null)
                        {
                            lblResult.Text = "<img src='/images/bigError.gif' border='0' align='absmiddle' /> Exceeded the maximum number of people";
                        }
                        if (Request.QueryString["register"] != null)
                        {
                            lblResult.Text = "<img src='/images/bigCheck.gif' border='0' align='absmiddle' /> Registration Successful";
                        }
                        if (Request.QueryString["unregister"] != null)
                        {
                            lblResult.Text = "<img src='/images/bigCheck.gif' border='0' align='absmiddle' /> Unregistration Successful";
                        }
                        panEdit.Visible = true;
                        is_regd         = oScheduling.VerifyUser(intProfile, schd_id);
                        if (is_regd == 1)
                        {
                            panUnregister.Visible = true;
                        }
                        else
                        {
                            panRegister.Visible = true;
                        }
                        if (!IsPostBack)
                        {
                            ds = oUser.Get(intProfile);
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                lblName.Text = ds.Tables[0].Rows[0]["lname"].ToString() + ", " + ds.Tables[0].Rows[0]["fname"].ToString();
                                if (ds.Tables[0].Rows[0]["phone"].ToString() != String.Empty)
                                {
                                    txtPhone.Text = ds.Tables[0].Rows[0]["phone"].ToString();
                                }
                            }
                            drpDept.DataSource     = oScheduling.GetDeptName(intProfile);
                            drpDept.DataTextField  = "name";
                            drpDept.DataValueField = "name";
                            drpDept.DataBind();
                        }
                    }
                }
                if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
                {
                    intApplication = Int32.Parse(Request.Cookies["application"].Value);
                }
                lblDate.Text = DateTime.Parse(Request.QueryString["date"]).ToLongDateString();
            }
        }