Пример #1
0
        private bool checkValid()
        {
            bool   isError         = false;
            bool   ActivityisError = false;
            String ActivityErrors  = "";
            String ErrorMessage    = "";

            ActivityRegistrationDetailUC1.CheckValid(out ActivityisError, out ActivityErrors);
            ErrorMessage += ActivityErrors;
            if (ActivityisError)
            {
                isError = ActivityisError;
            }
            ActivityRegistrationDescriptionUC1.CheckValid(out ActivityisError, out ActivityErrors);
            ErrorMessage += ActivityErrors;
            if (ActivityisError)
            {
                isError = ActivityisError;
            }
            ActivityRegistrationTimetableUC1.CheckValid(out ActivityisError, out ActivityErrors);
            ErrorMessage += ActivityErrors;
            if (ActivityisError)
            {
                isError = ActivityisError;
            }
            activityregistrationgroup1.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)
        {
            bool isNotValid = !checkValid();

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

                ActivityRegistrationDescriptionUC1.getActivityDetails(out shortDescription, out fullDescription);
                drDetail = ActivityRegistrationDescriptionUC1.getDetails(drDetail);
                drDetail.ShortDescription = "";
                drDetail.FullDescription  = fullDescription;
                DateTime activityExpiryDate = DateTime.Today;
                bool     usingTimetable;
                ActivityRegistrationTimetableUC1.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 = ActivityRegistrationDetailUC1.getContactDetail();

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

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


                /*//drActivity
                 * var drDetail = ActivityRegistrationDetailUC1.getDetails();
                 * drDetail.Status = (int)SystemConstants.ActivityStatus.Active;
                 * string shortDescription = "";
                 * string fullDescription = "";
                 * ActivityRegistrationDescriptionUC1.getActivityDetails(out shortDescription, out fullDescription);
                 * drDetail.ShortDescription = shortDescription;
                 * drDetail.FullDescription = fullDescription;
                 * DateTime activityExpiryDate = DateTime.Today;
                 * bool usingtimetable;
                 * ActivityRegistrationTimetableUC1.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 = ActivityRegistrationDetailUC1.getContactDetail();
                 *
                 * //drGrouping
                 * var drActGrouping = ActivityRegistrationGroup1.getActSuitability();
                 * string keywords = ActivityRegistrationGroup1.getKeywords();
                 * drDetail.Keywords = keywords;
                 *
                 * drDetail.ID = contactDetails.ActivityID = drActGrouping.ActivityID = ActivityID;
                 *
                 * //dtSchedule
                 */

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

                Response.Redirect("~/Activities");
            }
            else
            {
                lblError.Visible = divError.Visible = true;
            }
        }
Пример #3
0
 private void SetActivityTimetable()
 {
     ActivityRegistrationTimetableUC1.ActivityID = ActivityID;
     ActivityRegistrationTimetableUC1.EditMode   = true;
     ActivityRegistrationTimetableUC1.initTimetable();
 }