コード例 #1
0
ファイル: adminHeader.ascx.cs プロジェクト: chilesju/CityCode
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                this._user = (Utilites.User)Session["User"];

                ArrayList tabItems = new ArrayList();
                tabItems.Add(new LinkTabs("Main Screen", "MainScreen.aspx?index=" + tabItems.Count));
                if (this._user.IsUserCounciRole() || this._user.IsUserITAdminRole())
                {
                    tabItems.Add(new LinkTabs("Add New Call", "Addnewcall.aspx?index=" + tabItems.Count));
                    //tabItems.Add(new LinkTabs("Reports", "Reports.aspx?index=" + tabItems.Count));
                    tabItems.Add(new LinkTabs("Search", "Search.aspx?index=" + tabItems.Count));
                    tabItems.Add(new LinkTabs("Administration", "Administration.aspx?index=" + tabItems.Count));
                }
                else
                {
                    tabItems.Add(new LinkTabs("Search", "Search.aspx?index=" + tabItems.Count));
                }

                linksTabs.DataSource    = tabItems;
                linksTabs.SelectedIndex = (Request["index"] == null) ? 0 : Convert.ToInt32(Request["index"]);
                linksTabs.DataBind();
            }
        }
コード例 #2
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         IIdentity       WinId = HttpContext.Current.User.Identity;
         WindowsIdentity wi    = (WindowsIdentity)WinId;
         user            = new User(wi.Name);
         Session["User"] = user;
         lblWelcome.Text = "Welcome " + User.Identity.Name + ". You are currently logged in as " + role + " Date:" + System.DateTime.Now.ToLongDateString();
     }
 }
コード例 #3
0
ファイル: AdminModify.aspx.cs プロジェクト: chilesju/CityCode
        private void Page_Load(object sender, System.EventArgs e)
        {
            _incident = (Utilites.Incident)Session["Incident"];
            _user     = (Utilites.User)Session["User"];

            this.btnPrint.Attributes.Add("onclick", "javascript: window.open('PrintScreen.aspx?rpt=IncidentReport&prtNum=" + this._incident.IncidentId + "');");
            problemTypeList.Attributes.Add("OnChange", "alert('NOTE:  If you are changing the problem type and this problem is not associated with your division please change to the correct Department and or Division below and click on the Reassign Call button. Thank you.')");


            if (!Page.IsPostBack)
            {
                BindData();
                lblIncidentNumber.Text     += _incident.IncidentId.ToString();
                lblDateSubmitted.Text      += _incident.OpenDate.ToString();
                txtAddress.Text             = _incident.Address;
                txtIncidentDescription.Text = _incident.IncidentDisc;
                lblLastUpdated.Text        += _incident.ModifyDate.ToString();
                councilDistList.Items.FindByValue(_incident.CouncilDist).Selected = true;
                this.lblInsertedBy.Text += _incident.InsertedBy;
                if (_incident.Openclose == "O")
                {
                    rbtnOpen.Checked       = true;
                    this.btnUpdate.Enabled = true;
                    Session["Status"]      = "O";
                }
                else if (_incident.Openclose == "C")
                {
                    rbtnClosed.Checked     = true;
                    this.btnUpdate.Enabled = false;
                    Session["Status"]      = "C";
                }
                if (_incident.HasCitizenBeenContacted == true)
                {
                    this.rbtnCityContactedYes.Checked = true;
                }
                else
                {
                    this.rbtnCityContactedNo.Checked = true;
                }

                if (_incident.RequstingClosure == true)
                {
                    this.rbtnYesClose.Checked = true;
                }
                else
                {
                    this.rbtnNoClose.Checked = true;
                }

                if (_incident.Contact == 1)
                {
                    rbtnYes.Checked = true;
                }
                else if (_incident.Contact == 0)
                {
                    rbtnNo.Checked = true;
                }
                if (_incident.CourtDate == System.DateTime.MinValue)
                {
                    txtCourtDate.Text = "";
                }
                else
                {
                    txtCourtDate.Text = _incident.CourtDate.ToShortDateString();
                }
                if (_incident.PendingDate == System.DateTime.MinValue)
                {
                    txtPendingDate.Text = "";
                }
                else
                {
                    txtPendingDate.Text = _incident.PendingDate.ToShortDateString();
                }



                problemTypeList.Items.FindByValue(Convert.ToString(_incident.ProblemTypeId)).Selected = true;

                foreach (Utilites.Citizen citizen in _incident.CitizenCollection)
                {
                    Session["citizen"]  = citizen;
                    citizenId           = citizen.CitizenId;
                    txtFirstName.Text   = citizen.FirstName;
                    txtLastName.Text    = citizen.LastName;
                    txtPhoneNumber.Text = citizen.PhoneNumber;
                    txtEmail.Text       = citizen.Email;
                }
            }
            Utilites.Assignment assignemnt = new Utilites.Assignment();
            assignemntCol = assignemnt.GetAllIncidentAssignments(this._incident.IncidentId);
            adminTabsPlaceHolder1.IncidentId           = this._incident.IncidentId;
            adminTabsPlaceHolder1.AssignmentCollection = assignemntCol;
            this.rbtnClosed.Enabled = false;
            this.rbtnOpen.Enabled   = false;
            if (this._user.IsUserCounciRole() || this._user.IsUserITAdminRole())
            {
                this.rbtnClosed.Enabled = true;
                this.rbtnOpen.Enabled   = true;
            }
        }