public int SaveMasjidLandRequest(MasjidLandRequest model)
        {
            tbl_MasjidLandRequest _tbl_masjidLandRequest = new tbl_MasjidLandRequest(model);

#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
            if (model.Id != null && model.Id != 0)
#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
            {
                _tbl_masjidLandRequest.Status = true;
                _tbl_MasjidLandRequest.Update(_tbl_masjidLandRequest);
            }
            else
            {
                _tbl_masjidLandRequest.CreatedBy   = 1;
                _tbl_masjidLandRequest.CreatedDate = System.DateTime.Now;
                _tbl_masjidLandRequest.Status      = true;
                _tbl_masjidLandRequest             = _tbl_MasjidLandRequest.Insert(_tbl_masjidLandRequest);
            }

            return(_tbl_masjidLandRequest.Id);
        }
        public List <MasjidLandRequest> LandRequestList()
        {
            List <MasjidLandRequest> _MasjidLandRequest = new List <MasjidLandRequest>();

            var AddMasjidLandData = _tbl_MasjidLandRequest.GetAll().ToList();

            _MasjidLandRequest = (from item in AddMasjidLandData
                                  select new MasjidLandRequest
            {
                Id = item.Id,
                MasjidId = item.MasjidId,
                MasjidName = (item.tbl_AddMasjid != null)? item.tbl_AddMasjid.MasjidName : string.Empty,
                UserId = item.UserId,
                UserName = (item.tbl_User != null) ? item.tbl_User.Name : string.Empty,
                Location = item.Location,
                LandArea = item.LandArea,
                LandPrice = item.LandPrice,
                TotalLandValue = item.TotalLandValue,
                PurchasingFrom = item.PurchasingFrom,
                AmountPaid = item.AmountPaid,
                AmountNeeded = item.AmountNeeded,
                TimePeriod = item.TimePeriod,
                CommitteId = item.CommitteId,
                CommitteeName = (item.tbl_AddMasjidCommittee != null) ? item.tbl_AddMasjidCommittee.CommitteeName : string.Empty,
                CommitteHead = item.CommitteHead,
                CommitteHeadName = (item.tbl_User != null) ? item.tbl_User.Name : string.Empty,
                Picture1 = item.Picture1,
                Picture2 = item.Picture2,
                Picture3 = item.Picture3,
                Picture4 = item.Picture4,
                ReligiouPlaces = item.ReligiouPlaces,
                ReligiousPlaceDetails = item.ReligiousPlaceDetails,
                ReligiousPlaceHowFar = item.ReligiousPlaceHowFar,
                CreatedDate = item.CreatedDate,
                CreatedBy = item.CreatedBy,
                Status = item.Status
            }).OrderByDescending(x => x.Id).ToList();
            return(_MasjidLandRequest);
        }
        public MasjidLandRequest GetById(int id)
        {
            MasjidLandRequest _masjidLandRequest = new MasjidLandRequest();
            var item = _tbl_MasjidLandRequest.GetById(id);

            item = item ?? new tbl_MasjidLandRequest();
            _masjidLandRequest = new MasjidLandRequest
            {
                Id                    = item.Id,
                MasjidId              = item.MasjidId,
                MasjidName            = (item.tbl_AddMasjid != null) ? item.tbl_AddMasjid.MasjidName : string.Empty,
                UserId                = item.UserId,
                UserName              = (item.tbl_User != null) ? item.tbl_User.Name : string.Empty,
                Location              = item.Location,
                LandArea              = item.LandArea,
                LandPrice             = item.LandPrice,
                TotalLandValue        = item.TotalLandValue,
                PurchasingFrom        = item.PurchasingFrom,
                AmountPaid            = item.AmountPaid,
                AmountNeeded          = item.AmountNeeded,
                TimePeriod            = item.TimePeriod,
                CommitteId            = item.CommitteId,
                CommitteeName         = (item.tbl_AddMasjidCommittee != null) ? item.tbl_AddMasjidCommittee.CommitteeName : string.Empty,
                CommitteHead          = item.CommitteHead,
                CommitteHeadName      = (item.tbl_User != null) ? item.tbl_User.Name : string.Empty,
                Picture1              = item.Picture1,
                Picture2              = item.Picture2,
                Picture3              = item.Picture3,
                Picture4              = item.Picture4,
                ReligiouPlaces        = item.ReligiouPlaces,
                ReligiousPlaceDetails = item.ReligiousPlaceDetails,
                ReligiousPlaceHowFar  = item.ReligiousPlaceHowFar,
                CreatedDate           = item.CreatedDate,
                CreatedBy             = item.CreatedBy,
                Status                = item.Status
            };
            return(_masjidLandRequest);
        }
 public MasjidLandRequestBusiness()
 {
     _tbl_MasjidLandRequest = new GenericPattern <tbl_MasjidLandRequest>();
     _MasjidLandRequest     = new MasjidLandRequest();
 }
Beispiel #5
0
 public MasjidLandRequestController()
 {
     _MasjidLandRequest         = new MasjidLandRequest();
     _MasjidLandRequestBusiness = new MasjidLandRequestBusiness();
 }