예제 #1
0
        private bool checkValid()
        {
            bool   isError         = false;
            bool   ActivityisError = false;
            String ActivityErrors  = "";
            String ErrorMessage    = "";

            ActivityRegistrationDetailUC.CheckValid(out ActivityisError, out ActivityErrors);
            ErrorMessage += ActivityErrors;
            if (ActivityisError)
            {
                isError = ActivityisError;
            }
            ActivityRegistrationDescriptionUC.CheckValid(out ActivityisError, out ActivityErrors);
            ErrorMessage += ActivityErrors;
            if (ActivityisError)
            {
                isError = ActivityisError;
            }
            ActivityRegistrationTimetableUC.CheckValid(out ActivityisError, out ActivityErrors);
            ErrorMessage += ActivityErrors;
            if (ActivityisError)
            {
                isError = ActivityisError;
            }
            ActivityRegistrationGroup.CheckValid(out ActivityisError, out ActivityErrors);
            ErrorMessage += ActivityErrors;
            if (ActivityisError)
            {
                isError = ActivityisError;
            }

            lblError.Text = ErrorMessage;
            return(isError);
        }
예제 #2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            lblError.Visible = divError.Visible = false;
            bool isnotValid = checkValid();

            if (!isnotValid)
            {
                //drActivity
                var drDetail = ActivityRegistrationDetailUC.getDetails();
                drDetail.Status = (int)SystemConstants.ActivityStatus.Active;
                string shortDescription = "";
                string fullDescription  = "";

                ActivityRegistrationDescriptionUC.getActivityDetails(out shortDescription, out fullDescription);
                drDetail = ActivityRegistrationDescriptionUC.getDetails(drDetail);
                drDetail.ShortDescription = "";
                drDetail.FullDescription  = fullDescription;
                DateTime activityExpiryDate = DateTime.Today;
                bool     usingTimetable;
                ActivityRegistrationTimetableUC.getExpiry(out activityExpiryDate, out usingTimetable);
                drDetail.ExpiryDate = activityExpiryDate;
                drDetail.ProviderID = ProviderID;
                if (usingTimetable)
                {
                    drDetail.TimetableType = (int)SystemConstants.ScheduleViewFormat.Datagrid;
                }
                else
                {
                    drDetail.TimetableType = (int)SystemConstants.ScheduleViewFormat.noTimetable;
                }

                //drActivityContact
                var contactDetails = ActivityRegistrationDetailUC.getContactDetail();

                //dtSchedule
                var dtActSchedule = ActivityRegistrationTimetableUC.getTimetable(false);

                //drGrouping
                var drActGrouping = ActivityRegistrationGroup.getActSuitability();
                drDetail.Keywords = ActivityRegistrationGroup.getKeywords();
                int actID;

                //drImage
                var drImageDetail = ActivityRegistrationImageUC.GetImageDetail();
                var dtImages      = ActivityRegistrationImageUC.GetImages();

                ProviderBFC.SaveActivity(drDetail, contactDetails, drActGrouping, dtActSchedule, drImageDetail, dtImages, out actID);


                Response.Redirect("~/Activities/");
            }
            else
            {
                lblError.Visible = divError.Visible = true;
            }
        }
예제 #3
0
        private void Save()
        {
            bool isNotValid = !checkValid();

            if (isNotValid)
            {
                //drActivity
                var drDetail = ActivityRegistrationDetailUC.getDetails();
                drDetail.Status = (int)SystemConstants.ActivityStatus.Active;
                string shortDescription = "";
                string fullDescription  = "";

                ActivityRegistrationDescriptionUC.getActivityDetails(out shortDescription, out fullDescription);
                drDetail                  = ActivityRegistrationDescriptionUC.getDetails(drDetail);
                drDetail.isApproved       = RadYes.Checked;
                drDetail.ShortDescription = "";
                drDetail.FullDescription  = fullDescription;
                DateTime activityExpiryDate = DateTime.Today;
                bool     usingTimetable;
                ActivityRegistrationTimetableUC.getExpiry(out activityExpiryDate, out usingTimetable);
                drDetail.ExpiryDate = activityExpiryDate;
                drDetail.ProviderID = ProviderID;
                if (usingTimetable)
                {
                    drDetail.TimetableType = (int)SystemConstants.ScheduleViewFormat.Datagrid;
                }
                else
                {
                    drDetail.TimetableType = (int)SystemConstants.ScheduleViewFormat.noTimetable;
                }

                //drActivityContact
                var contactDetails = ActivityRegistrationDetailUC.getContactDetail();

                //dtSchedule
                var dtActSchedule = ActivityRegistrationTimetableUC.getTimetable(false);

                //drGrouping
                var drActGrouping = ActivityRegistrationGroup.getActSuitability();
                drDetail.Keywords = ActivityRegistrationGroup.getKeywords();
                int actID;

                foreach (var drActSchedule in dtActSchedule)
                {
                    drActSchedule.ActivityID = ActivityID;
                }
                AdministrationBFC.UpdateActivity(ActivityID, drDetail, contactDetails, drActGrouping, dtActSchedule);

                Response.Redirect("~/Activities");
            }
            else
            {
                lblError.Visible = divError.Visible = true;
            }
        }
예제 #4
0
 private void SetActivityGrouping()
 {
     ActivityRegistrationGroup.ActivityID = ActivityID;
     ActivityRegistrationGroup.EditMode   = true;
     ActivityRegistrationGroup.SetActivityGroup();
 }