示例#1
0
        private void PrepareEditView()
        {
            CMNEventEntity cMNEventEntity = CurrentCMNEventEntity;


            if (!cMNEventEntity.IsNew)
            {
                if (ddlEventCategoryID.Items.Count > 0 && cMNEventEntity.EventCategoryID != null)
                {
                    ddlEventCategoryID.SelectedValue = cMNEventEntity.EventCategoryID.ToString();
                }

                txtEventReferenceNo.Text = cMNEventEntity.EventReferenceNo.ToString();
                txtTitle.Text            = cMNEventEntity.Title.ToString();
                txtDetails.Text          = cMNEventEntity.Details.ToString();
                txtLocation.Text         = cMNEventEntity.Location.ToString();
                if (ddlEventLocationCategoryID.Items.Count > 0 && cMNEventEntity.EventLocationCategoryID != null)
                {
                    ddlEventLocationCategoryID.SelectedValue = cMNEventEntity.EventLocationCategoryID.ToString();
                }

                //Location will come here

                txtWebsiteURL.Text      = cMNEventEntity.WebsiteURL.ToString();
                txtTicketSellerURL.Text = cMNEventEntity.TicketSellerURL.ToString();
                txtYoutubeURL.Text      = cMNEventEntity.YoutubeURL.ToString();
                txtTransitAndParkingInformation.Text = cMNEventEntity.TransitAndParkingInformation.ToString();
                if (ddlEventOptionID.Items.Count > 0 && cMNEventEntity.EventOptionID != null)
                {
                    ddlEventOptionID.SelectedValue = cMNEventEntity.EventOptionID.ToString();
                }

                if (ddlRepeatCategoryID.Items.Count > 0 && cMNEventEntity.RepeatCategoryID != null)
                {
                    ddlRepeatCategoryID.SelectedValue = cMNEventEntity.RepeatCategoryID.ToString();
                }

                txtDuration.Text = cMNEventEntity.Duration.ToString();

                txtExpectedStartDate.Text = MiscUtil.ConvertDateTSQLStringJQueryUI(DateTime.Parse(cMNEventEntity.ExpectedStartDate.ToString()));

                if (cMNEventEntity.ExpectedEndDate != null)
                {
                    txtExpectedEndDate.Text = MiscUtil.ConvertDateTSQLStringJQueryUI(DateTime.Parse(cMNEventEntity.ExpectedEndDate.ToString()));
                }

                else
                {
                    txtExpectedEndDate.Text = String.Empty;
                }

                if (cMNEventEntity.ActualStartDate != null)
                {
                    txtActualStartDate.Text = MiscUtil.ConvertDateTSQLStringJQueryUI(DateTime.Parse(cMNEventEntity.ActualStartDate.ToString()));
                }

                else
                {
                    txtActualStartDate.Text = String.Empty;
                }

                if (cMNEventEntity.ActualEndDate != null)
                {
                    txtActualEndDate.Text = MiscUtil.ConvertDateTSQLStringJQueryUI(DateTime.Parse(cMNEventEntity.ActualEndDate.ToString()));
                }

                else
                {
                    txtActualEndDate.Text = String.Empty;
                }

                chkIsAllDay.Checked     = cMNEventEntity.IsAllDay;
                txtNotifyBeforeMin.Text = cMNEventEntity.NotifyBeforeMin.ToString();
                txtRemarks.Text         = cMNEventEntity.Remarks.ToString();
                if (ddlSharedSettingID.Items.Count > 0 && cMNEventEntity.SharedSettingID != null)
                {
                    ddlSharedSettingID.SelectedValue = cMNEventEntity.SharedSettingID.ToString();
                }

                btnSubmit.Text    = "Update";
                btnAddNew.Visible = true;
            }
        }
示例#2
0
        private void PrepareEditView()
        {
            OTIssueEntity oTIssueEntity = CurrentOTIssueEntity;

            if (!oTIssueEntity.IsNew)
            {
                if (ddlIssueCategoryID.Items.Count > 0 && oTIssueEntity.IssueCategoryID != null)
                {
                    ddlIssueCategoryID.SelectedValue = oTIssueEntity.IssueCategoryID.ToString();
                }
                txtTitle.Text       = oTIssueEntity.Title.ToString();
                txtDescription.Text = oTIssueEntity.Description.ToString();
                if (ddlIssuePriorityID.Items.Count > 0 && oTIssueEntity.IssuePriorityID != null)
                {
                    ddlIssuePriorityID.SelectedValue = oTIssueEntity.IssuePriorityID.ToString();
                }
                txtCompletionPercentage.Text = oTIssueEntity.CompletionPercentage.ToString();
                if (ddlIssueStatusID.Items.Count > 0 && oTIssueEntity.IssueStatusID != null)
                {
                    ddlIssueStatusID.SelectedValue = oTIssueEntity.IssueStatusID.ToString();
                }
                txtDuration.Text          = oTIssueEntity.Duration.ToString();
                txtExpectedStartDate.Text = MiscUtil.ConvertDateTSQLStringJQueryUI(DateTime.Parse(oTIssueEntity.ExpectedStartDate.ToString()));
                txtExpectedEndDate.Text   = MiscUtil.ConvertDateTSQLStringJQueryUI(DateTime.Parse(oTIssueEntity.ExpectedEndDate.ToString()));

                if (oTIssueEntity.ActualStartDate.HasValue)
                {
                    txtActualStartDate.Text = MiscUtil.ConvertDateTSQLStringJQueryUI(DateTime.Parse(oTIssueEntity.ActualStartDate.ToString()));
                }
                else
                {
                    txtActualStartDate.Text = oTIssueEntity.ActualStartDate.ToStringDefault();
                }

                if (oTIssueEntity.ActualEndDate.HasValue)
                {
                    txtActualEndDate.Text = MiscUtil.ConvertDateTSQLStringJQueryUI(DateTime.Parse(oTIssueEntity.ActualEndDate.ToString()));
                }
                else
                {
                    txtActualEndDate.Text = oTIssueEntity.ActualEndDate.ToStringDefault();
                }

                if (ddlSupervisorEmployeeID.Items.Count > 0 && oTIssueEntity.SupervisorEmployeeID != null)
                {
                    ddlSupervisorEmployeeID.SelectedValue = oTIssueEntity.SupervisorEmployeeID.ToString();
                }

                if (ddlAssignedToEmployeeID.Items.Count > 0 && oTIssueEntity.AssignedToEmployeeID != null)
                {
                    ddlAssignedToEmployeeID.SelectedValue = oTIssueEntity.AssignedToEmployeeID.ToString();
                }

                txtNotifyBeforeMin.Text = oTIssueEntity.NotifyBeforeMin.ToString();
                txtRemarks.Text         = oTIssueEntity.Remarks.ToString();

                switch (Action)
                {
                case "Edit":
                    pnlCreateIssue.Visible = false;
                    pnlEditMode.Visible    = true;

                    #region Supervior Panel Visible / Invisible

                    Int64 employeeID = MiscUtil.GetCurrentEmployeeByMemberID(CurrentMember);

                    if (employeeID > 0)
                    {
                        if (employeeID == CurrentOTIssueEntity.SupervisorEmployeeID)
                        {
                            pnlSupervisor.Visible = true;
                        }
                    }

                    else
                    {
                        pnlSupervisor.Visible = false;
                    }

                    #endregion

                    break;

                case "EditDetails":
                    pnlCreateIssue.Visible = true;
                    pnlEditMode.Visible    = false;
                    break;

                case "ViewIssue":
                    pnlCreateIssue.Visible = true;
                    pnlEditMode.Visible    = true;
                    pnlCreateIssue.Enabled = false;
                    pnlEditMode.Enabled    = false;
                    pnlCommon.Enabled      = false;
                    btnSubmit.Enabled      = false;
                    btnClear.Enabled       = false;
                    btnAddNew.Enabled      = false;
                    txtRemarks.Enabled     = false;
                    break;
                }

                pnlCommon.Visible = true;
                btnSubmit.Text    = "Update";
                btnAddNew.Visible = true;
            }
        }