private int CreateUserDetails(ParticipantRegistration model, string createdBy)
        {
            int userDetailsID = 0;

            using (meetingContext = new OCASIAMeetingContext())
            {
                UserDetail request = new UserDetail()
                {
                    FirstLastName = model.FirstLastName,
                    TitleID       = model.TitleID,
                    FamilyName    = model.FamilyName,
                    GivenName     = model.GivenName,
                    Email         = model.Email,
                    IsActive      = true,
                    IsPublish     = true,
                    CreatedBy     = createdBy,
                    CreatedOn     = DateTime.Now,
                    MeetingID     = model.MeetingID
                };

                meetingContext.UserDetails.Add(request);
                meetingContext.SaveChanges();
                userDetailsID = request.UserDetailID;
                return(userDetailsID);
            }
        }
示例#2
0
        public bool AddMettingDeatils(MeetingViewModel model)
        {
            if (model != null)
            {
                using (meetingContext = new OCASIAMeetingContext())
                {
                    Meeting mdl = new Meeting();
                    mdl.Abbreviation         = model.Abbreviation;
                    mdl.MeetingName          = model.MeetingName;
                    mdl.MeetingDescription   = model.MeetingDescription;
                    mdl.EventStartDate       = model.EventStartDate;
                    mdl.EventEndDate         = model.EventEndDate;
                    mdl.ApplicationStartDate = model.ApplicationStartDate;
                    mdl.ApplicationEndDate   = model.ApplicationEndDate;
                    mdl.PageBannerPath       = model.PageBannerPath;
                    mdl.FaqDescription       = model.FaqDescription;
                    mdl.FaqPath      = model.FaqPath;
                    mdl.SchedulePath = model.SchedulePath;
                    mdl.OfficalEmail = model.OfficalEmail;
                    mdl.Address      = model.Address;
                    mdl.PhoneNumber  = model.PhoneNumber;
                    mdl.FaxNumber    = model.FaxNumber;
                    if (model.RegistrationTabs != null)
                    {
                        mdl.RegistrationTabs  = model.RegistrationTabs;
                        mdl.AllowRegistration = false;
                    }
                    else
                    {
                        mdl.AllowRegistration = false;
                    }
                    mdl.CreatedBy = model.CreatedBy;
                    mdl.CreatedOn = DateTime.Now;
                    mdl.IsActive  = true;
                    mdl.IsPublish = false;

                    meetingContext.Meetings.Add(mdl);
                    meetingContext.SaveChanges();

                    if (!string.IsNullOrEmpty(model.BasicDescription))
                    {
                        RegistrationTabDetail obj = new RegistrationTabDetail();
                        obj.MeetingID               = mdl.MeetingID;
                        obj.BasicDescription        = model.BasicDescription;
                        obj.Description1            = model.Description1;
                        obj.Description1PicturePath = model.Description1PicturePath;
                        obj.FileName1               = model.FileName1;
                        obj.Description1            = model.Description1;
                        obj.Description1PicturePath = model.Description1PicturePath;
                        obj.FileName1               = model.FileName1;
                        obj.Description2            = model.Description2;
                        obj.Description2PicturePath = model.Description2PicturePath;
                        obj.FileName2               = model.FileName2;
                        obj.Description3            = model.Description3;
                        obj.Description3PicturePath = model.Description3PicturePath;
                        obj.FileName3               = model.FileName3;
                        obj.Description4            = model.Description4;
                        obj.Description4PicturePath = model.Description4PicturePath;
                        obj.FileName4               = model.FileName4;
                        obj.RegistrationTabID       = model.RegistrationTabID;
                        obj.CreatedBy               = model.CreatedBy;
                        obj.CreatedOn               = DateTime.Now;
                        obj.IsActive = true;
                        meetingContext.RegistrationTabDetails.Add(obj);
                        meetingContext.SaveChanges();
                    }
                    return(true);
                }
            }
            return(false);
        }