예제 #1
0
        public ResponseModel EditclubEvent(ClubModel model)
        {
            ResponseModel   _respnse = new ResponseModel();
            ShomaRMEntities db       = new ShomaRMEntities();

            try
            {
                if (db.tbl_Club.Where(a => a.Id == model.Id).FirstOrDefault().ClubTitle.ToLower() == model.ClubTitle.ToLower())
                {
                    var club = db.tbl_Club.Where(a => a.Id == model.Id).FirstOrDefault();

                    club.Id                 = model.Id;
                    club.ClubTitle          = model.ClubTitle;
                    club.ActivityId         = model.ActivityId;
                    club.StartDate          = model.StartDate;
                    club.Venue              = model.Venue;
                    club.DayId              = model.DayId;
                    club.Time               = model.Time;
                    club.Contact            = model.Contact;
                    club.Email              = model.Email;
                    club.PhoneNumber        = model.PhoneNumber;
                    club.PhoneCheck         = model.PhoneCheck;
                    club.EmailCheck         = model.EmailCheck;
                    club.LevelId            = model.LevelId;
                    club.SpecialInstruction = model.SpecialInstruction;
                    club.Description        = model.Description;
                    club.BriefDescription   = model.BriefDescription;
                    club.TermsAndCondition  = model.TermsAndCondition;
                    club.TenantID           = model.TenantID;
                    club.UserId             = model.UserId;
                    club.CreatedDate        = DateTime.UtcNow;
                    club.LastUpdatedDate    = DateTime.UtcNow;

                    db.Entry(club).State = EntityState.Modified;
                    db.SaveChanges();

                    _respnse.Status = true;
                    _respnse.msg    = "Update Successfully..";
                }
                else
                {
                    _respnse.Status = false;
                    _respnse.msg    = "Club Not Found..";
                }
            }
            catch (Exception ex)
            {
                _respnse.Status = false;
                _respnse.msg    = ex.ToString();
            }
            db.Dispose();
            return(_respnse);
        }
예제 #2
0
        public bool UpdateClubActiveDeactive(long Id, bool Active)
        {
            ShomaRMEntities db   = new ShomaRMEntities();
            var             data = db.tbl_Club.Where(a => a.Id == Id).FirstOrDefault();

            try
            {
                data.Active          = Active;
                db.Entry(data).State = EntityState.Modified;
                db.SaveChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }