public EmployerHistoryModel EditEmployerHistory(long HEIID) { EmployerHistoryModel model = new EmployerHistoryModel(); ShomaRMEntities db = new ShomaRMEntities(); var editEmployerHistorydata = db.tbl_EmployerHistory.Where(co => co.HEIID == HEIID).FirstOrDefault(); if (editEmployerHistorydata != null) { var countryName = db.tbl_Country.Where(co => co.ID == editEmployerHistorydata.Country).FirstOrDefault(); var StateName = db.tbl_State.Where(co => co.ID == editEmployerHistorydata.State).FirstOrDefault(); model.HEIID = editEmployerHistorydata.HEIID; model.EmployerName = !string.IsNullOrWhiteSpace(editEmployerHistorydata.EmployerName) ? editEmployerHistorydata.EmployerName : ""; model.JobTitle = editEmployerHistorydata.JobTitle; model.JobType = editEmployerHistorydata.JobType; model.StartDate = editEmployerHistorydata.StartDate; model.TerminationDate = editEmployerHistorydata.TerminationDate; model.AnnualIncome = editEmployerHistorydata.AnnualIncome; model.AddAnnualIncome = editEmployerHistorydata.AddAnnualIncome; model.SupervisorName = !string.IsNullOrWhiteSpace(editEmployerHistorydata.SupervisorName) ? editEmployerHistorydata.SupervisorName : ""; model.SupervisorPhone = editEmployerHistorydata.SupervisorPhone; model.SupervisorEmail = !string.IsNullOrWhiteSpace(editEmployerHistorydata.SupervisorEmail) ? editEmployerHistorydata.SupervisorEmail : ""; model.Country = editEmployerHistorydata.Country; model.Address1 = !string.IsNullOrWhiteSpace(editEmployerHistorydata.Address1) ? editEmployerHistorydata.Address1 : ""; model.Address2 = !string.IsNullOrWhiteSpace(editEmployerHistorydata.Address2) ? editEmployerHistorydata.Address2 : ""; model.State = editEmployerHistorydata.State; model.City = !string.IsNullOrWhiteSpace(editEmployerHistorydata.City) ? editEmployerHistorydata.City : ""; model.Zip = !string.IsNullOrWhiteSpace(editEmployerHistorydata.Zip) ? editEmployerHistorydata.Zip : ""; model.StartDateString = editEmployerHistorydata.StartDate != null?editEmployerHistorydata.StartDate.Value.ToString("MM/dd/yyyy") : ""; model.TerminationDateString = editEmployerHistorydata.TerminationDate != null?editEmployerHistorydata.TerminationDate.Value.ToString("MM/dd/yyyy") : ""; model.TerminationReason = !string.IsNullOrWhiteSpace(editEmployerHistorydata.TerminationReason) ? editEmployerHistorydata.TerminationReason : ""; model.CountryName = countryName != null ? countryName.CountryName : ""; model.StateName = StateName != null ? StateName.StateName : ""; model.JobTypeName = editEmployerHistorydata.JobType == 1 ? "Permanent" : editEmployerHistorydata.JobType == 2 ? "Contract Basis" : ""; } return(model); }
public UtilityBillingModel GetUBData(int id) { ShomaRMEntities db = new ShomaRMEntities(); UtilityBillingModel model = new UtilityBillingModel(); var getUBDta = db.tbl_UtilityBilling.Where(p => p.UBID == id).FirstOrDefault(); if (getUBDta != null) { model.UtilityID = getUBDta.UtilityID; model.LeaseID = getUBDta.LeaseID; model.Revision_Num = getUBDta.Revision_Num; model.Unit = getUBDta.Unit; model.ChargeType = getUBDta.ChargeType; model.EffectiveDate = getUBDta.EffectiveDate; model.MeterReading = getUBDta.MeterReading; model.PricePerUnit = getUBDta.PricePerUnit; model.Posted = getUBDta.Posted; model.TenantID = getUBDta.TenantID; } model.UBID = id; return(model); }
public long SaveUpdateState(StateModel model) { ShomaRMEntities db = new ShomaRMEntities(); var userNameExists = db.tbl_State.Where(p => p.ID != model.ID && p.StateName == model.StateName).FirstOrDefault(); if (userNameExists == null) { if (model.ID == 0) { var userData = new tbl_State() { StateName = model.StateName, Abbreviation = model.Abbreviation, }; db.tbl_State.Add(userData); db.SaveChanges(); model.ID = userData.ID; } else { var stateInfo = db.tbl_State.Where(p => p.ID == model.ID).FirstOrDefault(); if (stateInfo != null) { stateInfo.StateName = model.StateName; stateInfo.Abbreviation = model.Abbreviation; db.SaveChanges(); } else { throw new Exception(model.StateName + " not exists in the system."); } } return(model.ID); } else { throw new Exception(model.StateName + " already exists in the system."); } }
public List <FobManagement> GetLeaseTermData(long TenantID) { List <FobManagement> model = new List <FobManagement>(); ShomaRMEntities db = new ShomaRMEntities(); var getAppData = db.tbl_Applicant.Where(co => co.TenantID == TenantID).ToList(); if (getAppData != null) { foreach (var item in getAppData) { var getLeaseTerm = db.tbl_ESignatureKeys.Where(co => co.TenantID == item.TenantID && co.ApplicantID == item.ApplicantID).FirstOrDefault(); if (getLeaseTerm != null) { model.Add(new FobManagement() { FullName = item.FirstName + " " + item.LastName, Type = item.Type, ApplicantFob = item.ApplicantID, ESignatureDate = !string.IsNullOrWhiteSpace(getLeaseTerm.DateSigned) ? getLeaseTerm.DateSigned : "", ESignatureStatus = !string.IsNullOrWhiteSpace(getLeaseTerm.DateSigned) ? "Signed" : "Not Signed", }); } else { model.Add(new FobManagement() { FullName = item.FirstName + " " + item.LastName, Type = item.Type, ApplicantFob = item.ApplicantID, ESignatureDate = "", ESignatureStatus = "Not Signed", }); } } } db.Dispose(); return(model); }
public bool RemoveMappingByClubIdandUserId(long ClubId, long UserId) { ShomaRMEntities db = new ShomaRMEntities(); try { var Data = db.tbl_ClubMapping.Where(a => a.ClubId == ClubId && a.UserId == UserId).FirstOrDefault(); if (Data != null) { if (db.tbl_Club.Where(a => a.UserId == UserId && a.Id == ClubId).Count() > 0) { int Value = db.Database.ExecuteSqlCommand("delete from tbl_ClubMapping where ClubId = " + ClubId + " and UserId=" + UserId + ""); int CLubValue = db.Database.ExecuteSqlCommand("delete from tbl_Club where Id = " + ClubId + " and UserId=" + UserId + ""); } else { db.tbl_ClubMapping.Remove(Data); db.SaveChanges(); } } else { var CreateClubMap = new tbl_ClubMapping() { Id = 0, ClubId = ClubId, UserId = UserId }; db.tbl_ClubMapping.Add(CreateClubMap); db.SaveChanges(); } return(true); } catch (Exception ex) { return(false); } }
public long SaveUpdatePetPlace(PetManagementModel model) { ShomaRMEntities db = new ShomaRMEntities(); if (model.PetPlaceID == 0) { //var PetPlaceData = new tbl_PetPlace() //{ // PropertyID = model.PropertyID, // PetPlace = model.PetPlace, // Charges = model.Charges, // Description = model.Description //}; //db.tbl_PetPlace.Add(PetPlaceData); //db.SaveChanges(); //model.PetPlaceID = PetPlaceData.PetPlaceID; throw new Exception("Can not add new pets. Only edit allowed"); } else { var PetPlaceInfo = db.tbl_PetPlace.Where(p => p.PetPlaceID == model.PetPlaceID).FirstOrDefault(); if (PetPlaceInfo != null) { PetPlaceInfo.PropertyID = model.PropertyID; PetPlaceInfo.PetPlace = model.PetPlace; PetPlaceInfo.Charges = model.Charges; PetPlaceInfo.Description = model.Description; db.SaveChanges(); } else { throw new Exception(model.PetPlace + " not exists in the system."); } } return(model.PetPlaceID); }
public List <FobManagement> GetAllApplicantMovingCharges(long TenantID) { ShomaRMEntities db = new ShomaRMEntities(); List <FobManagement> model = new List <FobManagement>(); var getApplicantList = db.tbl_Applicant.Where(co => co.TenantID == TenantID).ToList(); if (getApplicantList != null) { foreach (var item in getApplicantList) { if (item.Type != "Guarantor" && item.Type != "Minor") { var getMoveInchecklist = db.tbl_MoveInChecklist.Where(co => co.ProspectID == item.TenantID).FirstOrDefault(); model.Add(new FobManagementModel() { ApplicantID = item.ApplicantID, FullName = item.FirstName + " " + item.LastName, Type = item.Type, MoveInDateString = getMoveInchecklist == null ? "" : getMoveInchecklist.MoveInDate.HasValue ? getMoveInchecklist.MoveInDate.Value.ToString("MM/dd/yyyy") : "", MoveInTime = getMoveInchecklist == null ? "" : !string.IsNullOrWhiteSpace(getMoveInchecklist.MoveInTime) ? getMoveInchecklist.MoveInTime : "", PreMoveInDateString = getMoveInchecklist == null ? "" : getMoveInchecklist.PreMoveInDate.HasValue ? getMoveInchecklist.PreMoveInDate.Value.ToString("MM/dd/yyyy") : "", PreMoveInTime = getMoveInchecklist == null ? "" : !string.IsNullOrWhiteSpace(getMoveInchecklist.PreMoveInTime) ? getMoveInchecklist.PreMoveInTime : "", MoveInCharges = getMoveInchecklist == null ? "" : getMoveInchecklist.MoveInCharges.HasValue ? getMoveInchecklist.MoveInCharges.Value.ToString("0.00") : "", InsuranceDoc = getMoveInchecklist == null ? "" : !string.IsNullOrWhiteSpace(getMoveInchecklist.InsuranceDoc) ? getMoveInchecklist.InsuranceDoc : "", ElectricityDoc = getMoveInchecklist == null ? "" : !string.IsNullOrWhiteSpace(getMoveInchecklist.ElectricityDoc) ? getMoveInchecklist.ElectricityDoc : "", IsCheckPO = getMoveInchecklist == null ? 0 : getMoveInchecklist.IsCheckPO.HasValue ? getMoveInchecklist.IsCheckPO : 0, IsCheckATT = getMoveInchecklist == null ? 0 : getMoveInchecklist.IsCheckATT.HasValue ? getMoveInchecklist.IsCheckATT : 0, IsCheckWater = getMoveInchecklist == null ? 0 : getMoveInchecklist.IsCheckWater.HasValue ? getMoveInchecklist.IsCheckWater : 0, CreatedDateString = getMoveInchecklist == null ? "" : getMoveInchecklist.CreatedDate.HasValue ? getMoveInchecklist.CreatedDate.Value.ToString("MM/dd/yyyy") : "", IsCheckSD = getMoveInchecklist == null ? 0 : getMoveInchecklist.IsCheckSD.HasValue ? getMoveInchecklist.IsCheckSD : 0, Movers = getMoveInchecklist == null ? 0 : getMoveInchecklist.Movers.HasValue ? getMoveInchecklist.Movers : 0, }); } } } return(model); }
public MyAccountModel GetTenantInfo(long TenantID, long UserId) { ShomaRMEntities db = new ShomaRMEntities(); MyAccountModel model = new MyAccountModel(); var tenantData = db.tbl_TenantInfo.Where(p => p.TenantID == TenantID).FirstOrDefault(); // ClearAllFields(model); if (tenantData != null) { DateTime?dob = null; try { dob = Convert.ToDateTime(tenantData.DateOfBirth.ToString()); } catch { } model.ID = tenantData.TenantID; model.LastName = tenantData.LastName; model.FirstName = tenantData.FirstName; model.PropertyID = tenantData.PropertyID; model.UnitID = tenantData.UnitID; model.MiddleInitial = tenantData.MiddleInitial; var unitname = db.tbl_PropertyUnits.Where(u => u.UID == model.UnitID).FirstOrDefault(); if (unitname != null) { model.UnitName = unitname.UnitNo; } //var getTenantDet = db.tbl_ApplyNow.Where(p => p.UserId == UserId).FirstOrDefault(); //model.LeaseTerm = getTenantDet.LeaseTerm; var monthlyRent = db.tbl_TenantMonthlyPayments.Where(p => p.TenantID == TenantID).FirstOrDefault(); model.MonthlyCharges = Convert.ToDecimal(monthlyRent.Charge_Amount); } db.Dispose(); return(model); }
public long SaveUpdateServiceLocation(ServiceLocationModel model) { ShomaRMEntities db = new ShomaRMEntities(); var userNameExists = db.tbl_ServiceLocation.Where(p => p.LocationID != model.LocationID && p.Location == model.Location).FirstOrDefault(); if (userNameExists == null) { if (model.LocationID == 0) { var LocationData = new tbl_ServiceLocation() { Location = model.Location }; db.tbl_ServiceLocation.Add(LocationData); db.SaveChanges(); model.LocationID = LocationData.LocationID; } else { var LocationData = db.tbl_ServiceLocation.Where(p => p.LocationID == model.LocationID).FirstOrDefault(); if (LocationData != null) { LocationData.Location = model.Location; db.SaveChanges(); } else { throw new Exception(model.Location + " not exists in the system."); } } return(model.LocationID); } else { throw new Exception(model.Location + " already exists in the system."); } }
public long SaveUpdateMarketSource(MarketSourceModel model) { ShomaRMEntities db = new ShomaRMEntities(); var userNameExists = db.tbl_Advertiser.Where(p => p.AdID != model.AdID && p.Advertiser == model.Advertiser).FirstOrDefault(); if (userNameExists == null) { if (model.AdID == 0) { var MarketSourceData = new tbl_Advertiser() { Advertiser = model.Advertiser }; db.tbl_Advertiser.Add(MarketSourceData); db.SaveChanges(); model.AdID = MarketSourceData.AdID; } else { var MarketSourceInfo = db.tbl_Advertiser.Where(p => p.AdID == model.AdID).FirstOrDefault(); if (MarketSourceInfo != null) { MarketSourceInfo.Advertiser = model.Advertiser; db.SaveChanges(); } else { throw new Exception(model.Advertiser + " not exists in the system."); } } return(model.AdID); } else { throw new Exception(model.Advertiser + " already exists in the system."); } }
public string SaveUpdateCommunityPost(CommunityActivityModel model) { string msg = ""; ShomaRMEntities db = new ShomaRMEntities(); if (model.CID == 0) { var saveCommunityActivity = new tbl_CommunityActivity(); { saveCommunityActivity.TenantId = model.TenantId; saveCommunityActivity.Details = model.Details == null ? "" : model.Details.Trim(); saveCommunityActivity.AttatchFile = model.AttatchFile; saveCommunityActivity.Date = DateTime.Now; saveCommunityActivity.AttachFileOriginalName = model.AttachFileOriginalName; }; db.tbl_CommunityActivity.Add(saveCommunityActivity); db.SaveChanges(); msg = "Posted Successfully"; } else { var updateCommunityActivity = db.tbl_CommunityActivity.Where(co => co.CID == model.CID).FirstOrDefault(); if (updateCommunityActivity != null) { updateCommunityActivity.TenantId = model.TenantId; updateCommunityActivity.Details = model.Details.Trim() == string.Empty ? " " : model.Details.Trim(); updateCommunityActivity.AttatchFile = model.AttatchFile; updateCommunityActivity.Date = model.Date; updateCommunityActivity.AttachFileOriginalName = model.AttachFileOriginalName; db.SaveChanges(); } } db.Dispose(); return(msg); }
public long SaveUpdateServiceCategory(ServiceCategoryModel model) { ShomaRMEntities db = new ShomaRMEntities(); var userNameExists = db.tbl_ServiceIssue.Where(p => p.ServiceIssueID != model.ServiceIssueID && p.ServiceIssue == model.ServiceIssue).FirstOrDefault(); if (userNameExists == null) { if (model.ServiceIssueID == 0) { var ServiceData = new tbl_ServiceIssue() { ServiceIssue = model.ServiceIssue }; db.tbl_ServiceIssue.Add(ServiceData); db.SaveChanges(); model.ServiceIssueID = ServiceData.ServiceIssueID; } else { var ServiceIssueData = db.tbl_ServiceIssue.Where(p => p.ServiceIssueID == model.ServiceIssueID).FirstOrDefault(); if (ServiceIssueData != null) { ServiceIssueData.ServiceIssue = model.ServiceIssue; db.SaveChanges(); } else { throw new Exception(model.ServiceIssue + " not exists in the system."); } } return(model.ServiceIssueID); } else { throw new Exception(model.ServiceIssue + " already exists in the system."); } }
public long SaveUpdateStorage(StorageModel model) { ShomaRMEntities db = new ShomaRMEntities(); if (model.StorageID != 0) { var StorageInfo = db.tbl_Storage.Where(p => p.StorageID == model.StorageID).FirstOrDefault(); if (StorageInfo != null) { StorageInfo.PropertyID = model.PropertyID; StorageInfo.StorageName = model.StorageName; StorageInfo.Charges = model.Charges; StorageInfo.Description = model.Description; db.SaveChanges(); } else { throw new Exception(model.StorageName + " not exists in the system."); } } return(model.StorageID); }
public MonthlyPaymentModel GetMonthlyPayment(long UserId) { ShomaRMEntities db = new ShomaRMEntities(); MonthlyPaymentModel model = new MonthlyPaymentModel(); var getMonthlyPayment = db.tbl_MonthlyPayment.Where(co => co.UserID == UserId).FirstOrDefault(); if (getMonthlyPayment != null) { model.MPayID = getMonthlyPayment.MPayID; model.ApplyNowID = getMonthlyPayment.TenantID; model.UserID = getMonthlyPayment.UserID; model.MonthlyCharges = getMonthlyPayment.MonthlyCharges; model.AdditionalParking = getMonthlyPayment.AdditionalParking; model.StorageCharges = getMonthlyPayment.StorageCharges; model.PetRent = getMonthlyPayment.PetRent; model.TrashRecycle = getMonthlyPayment.TrashRecycle; model.PestControl = getMonthlyPayment.PestControl; model.ConvergentBilling = getMonthlyPayment.ConvergentBilling; model.TotalMonthlyCharges = getMonthlyPayment.TotalMonthlyCharges; } return(model); }
public List <EventModel> GetCalEventList(DateTime dt) { List <EventModel> listEvent = new List <EventModel>(); ShomaRMEntities db = new ShomaRMEntities(); var eventList = db.tbl_Event.Where(co => co.EventDate == dt).ToList(); if (eventList != null) { foreach (var item in eventList) { listEvent.Add(new EventModel() { EventID = item.EventID, EventDate = item.EventDate, EventName = item.EventName, EventDateString = item.EventDate.Value.ToString("dd"), Type = item.Type }); } } db.Dispose(); return(listEvent); }
public EventModel GetEventDetail(long EventID) { EventModel _eventModel = new EventModel(); ShomaRMEntities db = new ShomaRMEntities(); var getEventDetail = db.tbl_Event.Where(co => co.EventID == EventID).FirstOrDefault(); if (getEventDetail != null) { _eventModel.EventID = getEventDetail.EventID; _eventModel.EventName = getEventDetail.EventName; _eventModel.Description = getEventDetail.Description; _eventModel.EventDate = getEventDetail.EventDate; _eventModel.EventTime = getEventDetail.EventTime; _eventModel.EventDateString = getEventDetail.EventDate.Value.ToString("MM/dd/yyyy"); TimeSpan tt = new TimeSpan(); tt = getEventDetail.EventTime.Value; DateTime dt = DateTime.Today.Add(tt); string displayTime = dt.ToString("hh:mm tt"); _eventModel.EventTimeString = displayTime; } return(_eventModel); }
public string DelTenantFob(long TenantID, long ApplicantId, int OtherId) { string msg = string.Empty; ShomaRMEntities db = new ShomaRMEntities(); var updateTenantFob = db.tbl_TenantFob.Where(co => co.ApplicantID == ApplicantId && co.TenantID == TenantID).FirstOrDefault(); var updateTenantFobOther = db.tbl_TenantFob.Where(co => co.ApplicantID == 0 && co.TenantID == TenantID && co.OtherId == OtherId).FirstOrDefault(); if (updateTenantFob != null) { db.tbl_TenantFob.Remove(updateTenantFob); db.SaveChanges(); db.Dispose(); msg = "FOB Removed successfully"; } else if (updateTenantFobOther != null) { db.tbl_TenantFob.Remove(updateTenantFobOther); db.SaveChanges(); db.Dispose(); msg = "FOB Removed successfully"; } return(msg); }
public PetModel GetPetDetails(int id) { ShomaRMEntities db = new ShomaRMEntities(); PetModel model = new PetModel(); var getPetdata = db.tbl_TenantPet.Where(p => p.PetID == id).FirstOrDefault(); if (getPetdata != null) { model.PetID = getPetdata.PetID; model.PetName = getPetdata.PetName; model.Breed = getPetdata.Breed; model.Weight = getPetdata.Weight == null ? "" : getPetdata.Weight; model.VetsName = getPetdata.VetsName; model.Photo = getPetdata.Photo; model.PetVaccinationCertificate = getPetdata.PetVaccinationCert; model.OriginalPetNameFile = getPetdata.OriginalPhoto; model.OriginalPetVaccinationCertificateFile = getPetdata.OriginalVaccinationCert; } model.PetID = id; return(model); }
public string SaveTenantEventJoinApprove(long TEID, int TenantEventListStatus) { string msg = ""; ShomaRMEntities db = new ShomaRMEntities(); var getTenantEventJoinData = db.tbl_TenantEventJoin.Where(co => co.TEID == TEID).FirstOrDefault(); if (getTenantEventJoinData != null) { var saveTenantEventJoinApprove = new tbl_TenantEventJoinApprove() { EventID = getTenantEventJoinData.EventID, EventJoinID = getTenantEventJoinData.TEID, TenantID = getTenantEventJoinData.TenantID, Status = TenantEventListStatus, Date = DateTime.Now }; db.tbl_TenantEventJoinApprove.Add(saveTenantEventJoinApprove); db.SaveChanges(); msg = "Progress Saved"; } db.Dispose(); return(msg); }
public ChargeTypeModel GetChargeTypeInfo(int CTID = 0) { ShomaRMEntities db = new ShomaRMEntities(); ChargeTypeModel model = new ChargeTypeModel(); model.CTID = 0; model.Charge_Type = ""; model.Charge_Description = ""; var ChargeTypeInfo = db.tbl_ChargeType.Where(p => p.CTID == CTID).FirstOrDefault(); if (ChargeTypeInfo != null) { model.CTID = ChargeTypeInfo.CTID; model.Charge_Type = ChargeTypeInfo.Charge_Type; model.Charge_Description = ChargeTypeInfo.Charge_Description; model.Summary_Charge_Type = ChargeTypeInfo.Summary_Charge_Type; model.Revenue_Account = ChargeTypeInfo.Revenue_Account; model.Payment_Description = ChargeTypeInfo.Payment_Description; } return(model); }
public string SaveUpdateParkingLocation(ParkingModel model) { string msg = ""; ShomaRMEntities db = new ShomaRMEntities(); if (model.ParkingID != 0) { var ParkingInfo = db.tbl_Parking.Where(p => p.ParkingID == model.ParkingID).FirstOrDefault(); if (ParkingInfo != null) { ParkingInfo.Description = model.Description; db.SaveChanges(); msg = "Parking information updated successfully.</br>"; } else { msg = "Parking not updated successfully."; } } db.Dispose(); return(msg); }
public List <FobManagementModel> GetApplicantNamesForFob(long TenantID) { List <FobManagementModel> list = new List <FobManagementModel>(); ShomaRMEntities db = new ShomaRMEntities(); var getApplicantNames = db.tbl_Applicant.Where(co => co.TenantID == TenantID).ToList(); if (getApplicantNames != null) { foreach (var item in getApplicantNames) { if (item.Type != "Guarantor") { list.Add(new FobManagementModel() { ApplicantID = item.ApplicantID, FullName = item.FirstName + " " + item.LastName, TenantID = item.TenantID, }); } } } return(list); }
public GuestRegistrationModel gotiGuestList(long TagId) { GuestRegistrationModel model = new GuestRegistrationModel(); ShomaRMEntities db = new ShomaRMEntities(); var getTenantGuest = db.tbl_GuestRegistration.Where(co => co.GuestID == TagId).FirstOrDefault(); if (getTenantGuest != null) { var tenantInfo = db.tbl_TenantInfo.Where(co => co.TenantID == getTenantGuest.TenantID).FirstOrDefault(); if (tenantInfo != null) { var getUnit = db.tbl_PropertyUnits.Where(co => co.UID == tenantInfo.UnitID).FirstOrDefault(); if (getUnit != null) { model.UnitNo = getUnit.UnitNo; } model.TenantName = tenantInfo.FirstName + " " + tenantInfo.LastName; model.GuestName = getTenantGuest.FirstName + " " + getTenantGuest.LastName; model.VehicleMake = getTenantGuest.VehicleMake; model.VehicleModel = getTenantGuest.VehicleModel; model.Tag = getTenantGuest.Tag; model.Email = getTenantGuest.Email; model.FirstName = getTenantGuest.FirstName; model.LastName = getTenantGuest.LastName; model.Address = getTenantGuest.Address; model.Phone = getTenantGuest.Phone; model.VisitStartDateString = getTenantGuest.VisitStartDate.Value.ToString("MM/dd/yyyy"); model.VisitEndDateString = getTenantGuest.VisitEndDate.Value.ToString("MM/dd/yyyy"); model.OriginalDriverLicence = getTenantGuest.OriginalDriverLicence; model.OriginalVehicleRegistration = getTenantGuest.OriginalVehicleRegistration; model.HaveVehicleString = getTenantGuest.HaveVehicle == true ? "Yes" : getTenantGuest.HaveVehicle == false ? "No" : ""; } } db.Dispose(); return(model); }
public async System.Threading.Tasks.Task <ActionResult> RefreshStatuses(long ProspectId) { try { string esignatureid = ""; ShomaRMEntities db = new ShomaRMEntities(); var applyNow = db.tbl_ApplyNow.Where(p => p.ID == ProspectId).FirstOrDefault(); if (applyNow != null) { esignatureid = !string.IsNullOrWhiteSpace(applyNow.EsignatureID) ? applyNow.EsignatureID : ""; if (esignatureid != "") { var bmservice = new BluemoonService(); LeaseResponseModel authenticateData = await bmservice.CreateSession(); LeaseResponseModel leaseKeys = await bmservice.GetEsignnatureDetails(SessionId : authenticateData.SessionId, EsignatureId : esignatureid); foreach (var lks in leaseKeys.EsigneResidents) { var esignData = db.tbl_ESignatureKeys.Where(p => p.Key == lks.Key).FirstOrDefault(); if (esignData != null) { esignData.DateSigned = lks.DateSigned; db.SaveChanges(); } } } } db.Dispose(); return(Json(new { result = "1" }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { result = "0" }, JsonRequestBehavior.AllowGet)); } }
public List <EventModel> GetNewDateEventList() { ShomaRMEntities db = new ShomaRMEntities(); List <EventModel> lstDateEvent = new List <EventModel>(); try { DataTable dtTable = new DataTable(); using (var cmd = db.Database.Connection.CreateCommand()) { db.Database.Connection.Open(); cmd.CommandText = "usp_GetCalendarEvent"; cmd.CommandType = CommandType.StoredProcedure; DbDataAdapter da = DbProviderFactories.GetFactory("System.Data.SqlClient").CreateDataAdapter(); da.SelectCommand = cmd; da.Fill(dtTable); db.Database.Connection.Close(); } foreach (DataRow dr in dtTable.Rows) { EventModel DateEventmodel = new EventModel(); DateEventmodel.EventName = dr["EventName"].ToString(); DateEventmodel.EventDateText = dr["EventDate"].ToString(); DateEventmodel.TypeText = dr["Type"].ToString(); lstDateEvent.Add(DateEventmodel); } db.Dispose(); return(lstDateEvent.ToList()); } catch (Exception ex) { db.Database.Connection.Close(); throw ex; } }
public string CheckPetWeight(long TenantId, int PetWeight) { string msg = string.Empty; int petWt = 0; ShomaRMEntities db = new ShomaRMEntities(); var petWeight = db.tbl_TenantPet.Where(co => co.TenantID == TenantId).ToList(); if (petWeight != null) { foreach (var item in petWeight) { petWt += Convert.ToInt32(item.Weight); } petWt = petWt + PetWeight; } if (petWeight.Count == 0) { if (PetWeight > 25) { msg = "Pet Weight must be upto 25 lbs"; } } else if (petWeight.Count == 1) { if (petWt > 40) { int totalWeight = petWt - PetWeight; msg = "Two Pet's Weight must be upto 40 lbs"; } } else { msg = ""; } return(msg); }
public PurchaseOrderModel GetPurchaseOrderData(int Id) { ShomaRMEntities db = new ShomaRMEntities(); PurchaseOrderModel model = new PurchaseOrderModel(); var GetPurchaseOrderData = db.tbl_PurchaseOrder.Where(co => co.POID == Id).FirstOrDefault(); if (GetPurchaseOrderData != null) { model.PropertyID = GetPurchaseOrderData.PropertyID; model.OrderNumber = GetPurchaseOrderData.OrderNumber; model.Vendor = GetPurchaseOrderData.Vendor; model.PODesc = GetPurchaseOrderData.PODesc; model.PODate = GetPurchaseOrderData.PODate; model.TotalAmount = GetPurchaseOrderData.TotalAmount; model.Route = GetPurchaseOrderData.Route; model.ApprovedDate = GetPurchaseOrderData.ApprovedDate; model.ApprovedBy = GetPurchaseOrderData.ApprovedBy; model.CanceledDate = GetPurchaseOrderData.CanceledDate; model.CanceledBy = GetPurchaseOrderData.CanceledBy; } model.POID = Id; return(model); }
public string SaveUpdateSlot(AmenitiesSlotModel model) { string msg = ""; ShomaRMEntities db = new ShomaRMEntities(); if (model.ID == 0) { var saveSlot = new tbl_AmenityPriceRange() { AmenityID = model.AmenityID, Duration = model.Duration, Deposit = model.Deposit, Fees = model.Fees, DurationID = model.DurationID }; db.tbl_AmenityPriceRange.Add(saveSlot); db.SaveChanges(); msg = "Amenity Slot Save Successfully"; } else { var GetSlotData = db.tbl_AmenityPriceRange.Where(p => p.ID == model.ID).FirstOrDefault(); if (GetSlotData != null) { GetSlotData.AmenityID = model.AmenityID; GetSlotData.Duration = model.Duration; GetSlotData.Deposit = model.Deposit; GetSlotData.Fees = model.Fees; GetSlotData.DurationID = model.DurationID; db.SaveChanges(); msg = "Amenity Slot Updated Successfully"; } } db.Dispose(); return(msg); }
public List <ClubModel> GetClubList() { ShomaRMEntities db = new ShomaRMEntities(); var Clublist = db.tbl_Club.OrderByDescending(co => co.StartDate).ToList(); if (UserId != 0) { Clublist = Clublist.ToList(); } return(Clublist.Select(a => new ClubModel() { Id = a.Id, ClubTitle = a.ClubTitle, ActivityId = a.ActivityId, StartDate = a.StartDate.ToLocalTime(), Venue = a.Venue, DayId = a.DayId, Time = a.Time, Contact = a.Contact, Email = a.Email, PhoneNumber = a.PhoneNumber, PhoneCheck = a.PhoneCheck, EmailCheck = a.EmailCheck, LevelId = a.LevelId, SpecialInstruction = a.SpecialInstruction, Description = a.Description, BriefDescription = a.BriefDescription, TermsAndCondition = a.TermsAndCondition, TenantID = a.TenantID, UserId = a.UserId, IsDeleted = a.IsDeleted, Active = a.Active, CreatedDate = a.CreatedDate, LastUpdatedDate = a.LastUpdatedDate }).ToList()); }
public List <MyAccountModel> GetTenantVehicleLeaseDocuments(MyAccountModel model) { ShomaRMEntities db = new ShomaRMEntities(); List <MyAccountModel> listVehicleCertificate = new List <MyAccountModel>(); var appNow = db.tbl_ApplyNow.Where(co => co.ID == model.UserId).FirstOrDefault(); if (appNow != null) { var getVehicleCertificates = db.tbl_Vehicle.Where(co => co.TenantID == appNow.ID).ToList(); if (getVehicleCertificates != null) { foreach (var item in getVehicleCertificates) { listVehicleCertificate.Add(new MyAccountModel() { VehicleRegistrationDoc = item.VehicleRegistration, OriginalVehicleRegistrationDoc = item.OriginalVehicleReg }); } } } return(listVehicleCertificate); }