Example #1
0
        public string SaveUpdateVehicleTenanat(VehicleModel model, long UserId)
        {
            ShomaRMEntities db       = new ShomaRMEntities();
            string          msg      = "";
            var             applyNow = db.tbl_ApplyNow.Where(co => co.UserId == UserId).FirstOrDefault();

            if (applyNow != null)
            {
                if (model.Vehicle_ID == 0)
                {
                    var saveVehicle = new tbl_Vehicle()
                    {
                        VehicleRegistration = model.VehicleRegistration,
                        OriginalVehicleReg  = model.OriginalVehicleRegistation,
                        Vehicle_ID          = model.Vehicle_ID,
                        TenantID            = applyNow.ID,
                        Make        = model.Make,
                        Model       = model.VModel,
                        Year        = model.Year,
                        Color       = model.Color,
                        License     = model.License,
                        State       = model.State,
                        OwnerName   = model.OwnerName,
                        Notes       = model.Notes,
                        VehicleType = model.VehicleType
                    };
                    db.tbl_Vehicle.Add(saveVehicle);
                    db.SaveChanges();


                    msg = "Vehicle Saved Successfully";
                }
                else
                {
                    var getVehdata = db.tbl_Vehicle.Where(p => p.Vehicle_ID == model.Vehicle_ID).FirstOrDefault();
                    if (getVehdata != null)
                    {
                        getVehdata.VehicleRegistration = model.VehicleRegistration;
                        getVehdata.OriginalVehicleReg  = model.OriginalVehicleRegistation;
                        getVehdata.Vehicle_ID          = model.Vehicle_ID;
                        getVehdata.TenantID            = applyNow.ID;
                        getVehdata.Make        = model.Make;
                        getVehdata.Model       = model.VModel;
                        getVehdata.Year        = model.Year;
                        getVehdata.Color       = model.Color;
                        getVehdata.License     = model.License;
                        getVehdata.State       = model.State;
                        getVehdata.OwnerName   = model.OwnerName;
                        getVehdata.Notes       = model.Notes;
                        getVehdata.VehicleType = model.VehicleType;
                    }
                    db.SaveChanges();
                    msg = "Vehicle Updated Successfully";
                }
            }


            db.Dispose();
            return(msg);
        }
Example #2
0
        public LeaseTermsModel SaveUpdateLeaseTerms(LeaseTermsModel model)
        {
            ShomaRMEntities db = new ShomaRMEntities();

            if (model.LTID == 0)
            {
                var SaveLeaseTerms = new tbl_LeaseTerms()
                {
                    LeaseTerms = model.LeaseTerms,
                    FormAgent  = model.FormAgent,
                    OfferTerms = model.OfferTerms == null ? 0 : model.OfferTerms
                };

                db.tbl_LeaseTerms.Add(SaveLeaseTerms);
                db.SaveChanges();
            }
            else
            {
                var UpdateLeaseTerms = db.tbl_LeaseTerms.Where(co => co.LTID == model.LTID).FirstOrDefault();
                if (UpdateLeaseTerms != null)
                {
                    UpdateLeaseTerms.LeaseTerms = model.LeaseTerms;
                    UpdateLeaseTerms.FormAgent  = model.FormAgent;
                    UpdateLeaseTerms.OfferTerms = model.OfferTerms == null ? 00 : model.OfferTerms;

                    db.SaveChanges();
                }
            }
            db.Dispose();

            return(model);
        }
Example #3
0
        public string MakeDefaultPaymentSystem(long TenantId, long PAID)
        {
            string          msg      = "";
            ShomaRMEntities db       = new ShomaRMEntities();
            var             paymnets = db.tbl_PaymentAccounts.Where(co => co.TenantId == TenantId).ToList();

            if (paymnets != null)
            {
                foreach (var item in paymnets)
                {
                    item.Default = 0;
                    db.SaveChanges();
                }

                var makeDefaultPaymentSystems = db.tbl_PaymentAccounts.Where(co => co.PAID == PAID).FirstOrDefault();
                if (makeDefaultPaymentSystems != null)
                {
                    makeDefaultPaymentSystems.Default = 1;

                    db.SaveChanges();
                    msg = makeDefaultPaymentSystems.NickName + " Selected as a Default Payment System";
                }
            }
            db.Dispose();
            return(msg);
        }
Example #4
0
        public string SaveUpdateCountry(CountryModel model)
        {
            string          msg = string.Empty;
            ShomaRMEntities db  = new ShomaRMEntities();

            if (model.ID == 0)
            {
                var saveCountry = new tbl_Country()
                {
                    CountryName = model.CountryName,
                };
                db.tbl_Country.Add(saveCountry);
                db.SaveChanges();
                msg = "Progress Saved Successfully";
            }
            else
            {
                var updateCountry = db.tbl_Country.Where(co => co.ID == model.ID).FirstOrDefault();
                if (updateCountry != null)
                {
                    updateCountry.CountryName = model.CountryName;

                    db.SaveChanges();
                    msg = "Progress Updated Successfully";
                }
            }
            db.Dispose();
            return(msg);
        }
Example #5
0
        public string SaveUpdateBankDetails(BankAccountModel model)
        {
            ShomaRMEntities db  = new ShomaRMEntities();
            string          msg = "";

            if (model.BAID == 0)
            {
                var saveBankDetails = new tbl_BankAccount()
                {
                    Bank_Name      = model.Bank_Name,
                    Account_Number = model.Account_Number,
                    Account_Type   = model.Account_Type,
                };
                db.tbl_BankAccount.Add(saveBankDetails);
                db.SaveChanges();
                msg = "Bank Details Saved Successfully";
            }
            else
            {
                var getBDdata = db.tbl_BankAccount.Where(p => p.BAID == model.BAID).FirstOrDefault();
                if (getBDdata != null)
                {
                    getBDdata.Bank_Name      = model.Bank_Name;
                    getBDdata.Account_Number = model.Account_Number;
                    getBDdata.Account_Type   = model.Account_Type;
                }
                db.SaveChanges();
                msg = "Bank Details Updated Successfully";
            }
            db.Dispose();
            return(msg);
        }
Example #6
0
        public string DeleteTenantVehicle(long VID)
        {
            ShomaRMEntities db     = new ShomaRMEntities();
            string          msg    = "";
            int             userid = ShomaRM.Models.ShomaGroupWebSession.CurrentUser != null ? ShomaRM.Models.ShomaGroupWebSession.CurrentUser.UserID : 0;

            if (VID != 0)
            {
                var vehData = db.tbl_Vehicle.Where(p => p.Vehicle_ID == VID).FirstOrDefault();
                if (vehData != null)
                {
                    var updateParking = db.tbl_Parking.Where(co => co.ParkingID == vehData.ParkingID && co.AddedBy == userid).FirstOrDefault();
                    if (updateParking != null)
                    {
                        updateParking.Status  = 0;
                        updateParking.AddedBy = 0;
                        db.SaveChanges();
                    }

                    db.tbl_Vehicle.Remove(vehData);
                    db.SaveChanges();

                    var ParkingInfo = db.tbl_Parking.Where(p => p.ParkingID == vehData.ParkingID).FirstOrDefault();
                    ParkingInfo.Status = 0;
                    db.SaveChanges();
                    msg = "Vehicle Removed Successfully";
                }
            }

            db.Dispose();
            return(msg);
        }
Example #7
0
        public string UpdateWorkInfo(MyAccountModel model, long UserID)
        {
            string          msg       = "";
            ShomaRMEntities db        = new ShomaRMEntities();
            var             tblTenant = db.tbl_TenantInfo.Where(p => p.TenantID == model.ID).FirstOrDefault();

            if (tblTenant != null)
            {
                tbl_TenantInfo objTable = new tbl_TenantInfo();
                tblTenant.TenantID     = model.ID;
                tblTenant.JobTitle     = model.JobTitle;
                tblTenant.JobType      = Convert.ToInt32(model.JobType);
                tblTenant.EmployerName = model.EmployerName;
                db.SaveChanges();
            }
            var getTenatId = db.tbl_ApplyNow.Where(co => co.UserId == UserID).FirstOrDefault();

            var tblTInfo = db.tbl_TenantInfo.Where(p => p.ProspectID == getTenatId.ID).FirstOrDefault();

            var tblTenantOnline = db.tbl_TenantOnline.Where(p => p.ProspectID == tblTInfo.ProspectID).FirstOrDefault();

            if (tblTenantOnline != null)
            {
                tbl_TenantOnline objTable = new tbl_TenantOnline();

                tblTenantOnline.JobTitle     = model.JobTitle;
                tblTenantOnline.JobType      = Convert.ToInt32(model.JobType);
                tblTenantOnline.EmployerName = model.EmployerName;
                db.SaveChanges();
            }


            db.Dispose();
            return(msg);
        }
Example #8
0
        public string SaveUpdateInvoice(InvoiceModel model)
        {
            string          msg    = "";
            ShomaRMEntities db     = new ShomaRMEntities();
            int             userid = ShomaRM.Models.ShomaGroupWebSession.CurrentUser != null ? ShomaRM.Models.ShomaGroupWebSession.CurrentUser.UserID : 0;

            if (model.InvoiceID == 0)
            {
                var saveInvoice = new tbl_Invoice()
                {
                    InvoiceNumber = model.InvoiceNumber,
                    Vendor        = model.Vendor,
                    InvoiceDesc   = model.InvoiceDesc,
                    InvoiceDate   = model.InvoiceDate,
                    ReceivedDate  = model.ReceivedDate,
                    PaymentDate   = model.PaymentDate,
                    TotalAmount   = model.TotalAmount,
                    Route         = model.Route,
                    ExportNow     = model.ExportNow,
                    ExportedDate  = model.ExportedDate,
                    ExportedBy    = model.ExportedBy,
                    Approved      = model.Approved,
                    ApprovedBy    = model.ApprovedBy,
                    BatchID       = model.BatchID,
                    CreatedBy     = userid,
                    CreatedDate   = DateTime.Now.Date
                };
                db.tbl_Invoice.Add(saveInvoice);
                db.SaveChanges();
                msg = "Invoice Save Successfully";
            }
            else
            {
                var GetInvoiceData = db.tbl_Invoice.Where(p => p.InvoiceID == model.InvoiceID).FirstOrDefault();

                if (GetInvoiceData != null)
                {
                    GetInvoiceData.InvoiceNumber = model.InvoiceNumber;
                    GetInvoiceData.Vendor        = model.Vendor;
                    GetInvoiceData.InvoiceDesc   = model.InvoiceDesc;
                    GetInvoiceData.InvoiceDate   = model.InvoiceDate;
                    GetInvoiceData.ReceivedDate  = model.ReceivedDate;
                    GetInvoiceData.PaymentDate   = model.PaymentDate;
                    GetInvoiceData.TotalAmount   = model.TotalAmount;
                    GetInvoiceData.Route         = model.Route;
                    GetInvoiceData.ExportNow     = model.ExportNow;
                    GetInvoiceData.ExportedDate  = model.ExportedDate;
                    GetInvoiceData.ExportedBy    = model.ExportedBy;
                    GetInvoiceData.Approved      = model.Approved;
                    GetInvoiceData.ApprovedBy    = model.ApprovedBy;
                    GetInvoiceData.BatchID       = model.BatchID;
                    GetInvoiceData.CreatedBy     = userid;
                    GetInvoiceData.CreatedDate   = DateTime.Now.Date;
                    db.SaveChanges();
                    msg = "Invoice Updated Successfully";
                }
            }
            db.Dispose();
            return(msg);
        }
Example #9
0
        public PremiumTypeModel SaveUpdatePremiumType(PremiumTypeModel model)
        {
            ShomaRMEntities db = new ShomaRMEntities();

            if (model.PTID == 0)
            {
                var SavePremiumType = new tbl_PremiumType()
                {
                    PremiumType = model.PremiumType,
                    Details     = model.Details
                };
                db.tbl_PremiumType.Add(SavePremiumType);
                db.SaveChanges();
            }
            else
            {
                var UpdatePremiumType = db.tbl_PremiumType.Where(co => co.PTID == model.PTID).FirstOrDefault();
                if (UpdatePremiumType != null)
                {
                    UpdatePremiumType.PremiumType = model.PremiumType;
                    UpdatePremiumType.Details     = model.Details;

                    db.SaveChanges();
                }
            }
            db.Dispose();

            return(model);
        }
Example #10
0
        public string SaveUpdateTenantStorage(TenantFOBModel model)
        {
            ShomaRMEntities db = new ShomaRMEntities();
            decimal         totalStorageAmt   = 0;
            var             TenantStorageData = db.tbl_TenantStorage.Where(p => p.TenantID == model.TenantID).ToList();

            db.tbl_TenantStorage.RemoveRange(TenantStorageData);
            db.SaveChanges();
            if (model.lstTStorage != null)
            {
                foreach (var cd in model.lstTStorage)
                {
                    var parkingdata = db.tbl_FOB.Where(p => p.StorageID == cd.StorageID).FirstOrDefault();
                    var cdData      = new tbl_TenantStorage
                    {
                        StorageID   = cd.StorageID,
                        TenantID    = model.TenantID,
                        Charges     = parkingdata.Charges,
                        CreatedDate = Convert.ToDateTime(DateTime.Now.ToString("MM/dd/yyyy"))
                    };
                    db.tbl_TenantStorage.Add(cdData);
                    db.SaveChanges();
                    totalStorageAmt = totalStorageAmt + Convert.ToDecimal(parkingdata.Charges);
                }
            }
            return(totalStorageAmt.ToString());
        }
Example #11
0
        public string DeleteVehicleListOnCheck(long TenantId)
        {
            string          msg           = string.Empty;
            ShomaRMEntities db            = new ShomaRMEntities();
            int             userid        = ShomaRM.Models.ShomaGroupWebSession.CurrentUser != null ? ShomaRM.Models.ShomaGroupWebSession.CurrentUser.UserID : 0;
            var             deleteVehicle = db.tbl_Vehicle.Where(co => co.TenantID == TenantId && co.AddedBy == userid).ToList();

            if (deleteVehicle != null)
            {
                foreach (var mod in deleteVehicle)
                {
                    var updateParking = db.tbl_Parking.Where(co => co.ParkingID == mod.ParkingID).FirstOrDefault();
                    if (updateParking != null)
                    {
                        updateParking.AddedBy = 0;
                        updateParking.Status  = 0;
                        db.SaveChanges();
                    }
                }
                db.tbl_Vehicle.RemoveRange(deleteVehicle);
                db.SaveChanges();

                msg = "Vehicle Removed Successfully";
            }
            db.Dispose();
            return(msg);
        }
Example #12
0
        public int SaveUpdateUser(UsersModel model)
        {
            ShomaRMEntities db             = new ShomaRMEntities();
            var             userNameExists = db.tbl_Login.Where(p => p.UserID != model.UserID && p.Username == model.Username).FirstOrDefault();
            string          encpassword    = new EncryptDecrypt().EncryptText(model.Password);

            if (userNameExists == null)
            {
                if (model.UserID == 0)
                {
                    var userData = new tbl_Login()
                    {
                        FirstName = model.FirstName,
                        LastName  = model.LastName,

                        CellPhone   = model.CellPhone,
                        Email       = model.Email,
                        Username    = model.Username,
                        Password    = encpassword,
                        IsActive    = model.IsActive,
                        IsSuperUser = 0,
                        UserType    = model.UserType
                    };
                    db.tbl_Login.Add(userData);
                    db.SaveChanges();
                    model.UserID = userData.UserID;
                }
                else
                {
                    var userInfo = db.tbl_Login.Where(p => p.UserID == model.UserID).FirstOrDefault();
                    if (userInfo != null)
                    {
                        userInfo.FirstName = model.FirstName;
                        userInfo.LastName  = model.LastName;

                        userInfo.CellPhone = model.CellPhone;
                        userInfo.Email     = model.Email;

                        userInfo.Username = model.Username;
                        userInfo.Password = encpassword;
                        userInfo.IsActive = model.IsActive;
                        userInfo.UserType = model.UserType;
                        db.SaveChanges();
                    }
                    else
                    {
                        throw new Exception(model.Username + " not exists in the system.");
                    }
                }

                return(model.UserID);
            }
            else
            {
                throw new Exception(model.Username + " already exists in the system.");
            }
        }
Example #13
0
        public string SaveUpdateTenanatPet(PetModel model, long UserId)
        {
            string          msg      = "";
            ShomaRMEntities db       = new ShomaRMEntities();
            var             applyNow = db.tbl_ApplyNow.Where(co => co.UserId == UserId).FirstOrDefault();

            if (applyNow != null)
            {
                if (model.PetID == 0)
                {
                    var savePet = new tbl_TenantPet()
                    {
                        PetID                   = model.PetID,
                        TenantID                = applyNow.ID,
                        PetType                 = model.PetType,
                        Breed                   = model.Breed,
                        Weight                  = model.Weight,
                        Age                     = model.Age,
                        Photo                   = model.Photo,
                        PetVaccinationCert      = model.PetVaccinationCertificate,
                        OriginalPhoto           = model.OriginalPetNameFile,
                        OriginalVaccinationCert = model.OriginalPetVaccinationCertificateFile,
                        PetName                 = model.PetName,
                        VetsName                = model.VetsName
                    };
                    db.tbl_TenantPet.Add(savePet);
                    db.SaveChanges();
                    //msg = savePet.TenantID.ToString();

                    msg += "Pet Saved Successfully";
                }
                else
                {
                    var getPetdata = db.tbl_TenantPet.Where(p => p.PetID == model.PetID).FirstOrDefault();
                    if (getPetdata != null)
                    {
                        getPetdata.PetID                   = model.PetID;
                        getPetdata.TenantID                = applyNow.ID;
                        getPetdata.PetType                 = model.PetType;
                        getPetdata.Breed                   = model.Breed;
                        getPetdata.Weight                  = model.Weight;
                        getPetdata.Age                     = model.Age;
                        getPetdata.Photo                   = model.Photo;
                        getPetdata.PetVaccinationCert      = model.PetVaccinationCertificate;
                        getPetdata.OriginalPhoto           = model.OriginalPetNameFile;
                        getPetdata.OriginalVaccinationCert = model.OriginalPetVaccinationCertificateFile;
                        getPetdata.PetName                 = model.PetName;
                        getPetdata.VetsName                = model.VetsName;
                    }
                    db.SaveChanges();
                    msg = "Pet Updated Successfully";
                }
            }

            db.Dispose();
            return(msg);
        }
Example #14
0
        public string SaveUpdateEvent(EventModel model)
        {
            string          msg = "";
            ShomaRMEntities db  = new ShomaRMEntities();
            DateTime        dt  = DateTime.Parse(model.EventTimeString != null ? model.EventTimeString : "00:00");

            TimeSpan time   = dt.TimeOfDay;
            int      userid = ShomaRM.Models.ShomaGroupWebSession.CurrentUser != null ? ShomaRM.Models.ShomaGroupWebSession.CurrentUser.UserID : 0;

            if (model.EventID == 0)
            {
                var saveEvent = new tbl_Event()
                {
                    EventName     = model.EventName,
                    PropertyID    = model.PropertyID,
                    EventDate     = model.EventDate,
                    Photo         = model.Photo,
                    Description   = model.Description,
                    CreatedByID   = userid,
                    CreatedByDate = DateTime.Now.Date,
                    Type          = model.Type,

                    EventTime = time,
                    Fees      = model.Fees
                };
                db.tbl_Event.Add(saveEvent);
                db.SaveChanges();
                msg = "Event Save Successfully";
            }
            else
            {
                string PhotoName    = "";
                var    GetEventData = db.tbl_Event.Where(p => p.EventID == model.EventID).FirstOrDefault();
                PhotoName = GetEventData.Photo;
                if (PhotoName != model.Photo && model.Photo != "")
                {
                    PhotoName = model.Photo;
                }
                if (GetEventData != null)
                {
                    GetEventData.EventName   = model.EventName;
                    GetEventData.PropertyID  = model.PropertyID;
                    GetEventData.EventDate   = model.EventDate;
                    GetEventData.Photo       = PhotoName;
                    GetEventData.Description = model.Description;
                    GetEventData.Type        = model.Type;
                    GetEventData.EventTime   = time;
                    GetEventData.Fees        = model.Fees;
                    //GetEventData.CreatedByID = ShomaRM.Models.ShomaGroupWebSession.CurrentUser.UserID;
                    //GetEventData.CreatedByDate = DateTime.Now.Date;
                    db.SaveChanges();
                    msg = "Event Updated Successfully";
                }
            }
            db.Dispose();
            return(msg);
        }
Example #15
0
        public string SaveUpdateDocument(HttpPostedFileBase fb, DocumentModel model)
        {
            string          filePath    = "";
            string          fileName    = "";
            string          sysFileName = "";
            string          msg         = "";
            ShomaRMEntities db          = new ShomaRMEntities();

            if (fb != null && fb.ContentLength > 0)
            {
                filePath    = HttpContext.Current.Server.MapPath("~/Content/assets/img/Document/");
                fileName    = fb.FileName;
                sysFileName = DateTime.Now.ToFileTime().ToString() + Path.GetExtension(fb.FileName);
                fb.SaveAs(filePath + "//" + sysFileName);
                if (!string.IsNullOrWhiteSpace(fb.FileName))
                {
                    string afileName = HttpContext.Current.Server.MapPath("~/Content/assets/img/Document/") + "/" + sysFileName;
                }
            }

            int userid = ShomaGroupWebSession.CurrentUser != null ? ShomaGroupWebSession.CurrentUser.UserID : 0;

            if (model.DocID == 0)
            {
                var saveDocument = new tbl_Document()
                {
                    TenantID       = model.TenantID,
                    DocumentName   = sysFileName,
                    DocumentType   = model.DocumentType,
                    DocumentNumber = model.DocumentNumber,
                    UploadBy       = userid,
                    UploadDate     = DateTime.Now.Date
                };
                db.tbl_Document.Add(saveDocument);
                db.SaveChanges();
                msg = "Document Save Successfully";
            }
            else
            {
                var GetDocumentData = db.tbl_Document.Where(p => p.DocID == model.DocID).FirstOrDefault();
                if (GetDocumentData != null)
                {
                    GetDocumentData.TenantID       = model.TenantID;
                    GetDocumentData.DocumentName   = sysFileName;
                    GetDocumentData.DocumentType   = model.DocumentType;
                    GetDocumentData.DocumentNumber = model.DocumentNumber;
                    GetDocumentData.UploadBy       = userid;
                    GetDocumentData.UploadDate     = DateTime.Now.Date;
                    db.SaveChanges();
                    msg = "Document Updated Successfully";
                }
            }
            db.Dispose();
            return(msg);
        }
Example #16
0
        public string SaveUpdateReservationRequest(AmenitiesReservationModel model)
        {
            string          msg = "";
            ShomaRMEntities db  = new ShomaRMEntities();
            DateTime        dt  = DateTime.Parse(model.DesiredTime != null ? model.DesiredTime : "00:00");
            DateTime        dtF = DateTime.Parse(model.DesiredTimeFrom != null ? model.DesiredTimeFrom : "00:00");
            DateTime        dtT = DateTime.Parse(model.DesiredTimeTo != null ? model.DesiredTimeTo : "00:00");

            if (model.ARID == 0)
            {
                var saveReservationRequest = new tbl_AmenityReservation()
                {
                    TenantID        = model.TenantID,
                    AmenityID       = model.AmenityID,
                    DesiredDate     = model.DesiredDate,
                    DesiredTime     = dt.ToString("HH:mm"),
                    Duration        = model.Duration,
                    DurationID      = model.DurationID,
                    DepositFee      = model.DepositFee,
                    ReservationFee  = model.ReservationFee,
                    Status          = model.Status,
                    DesiredTimeFrom = dtF.ToString("HH:mm"),
                    DesiredTimeTo   = dtT.ToString("HH:mm"),
                    Guest           = model.Guest
                };
                db.tbl_AmenityReservation.Add(saveReservationRequest);
                db.SaveChanges();
                msg = "Reservation Request Save Successfully";
            }
            else
            {
                var GetReservationRequestData = db.tbl_AmenityReservation.Where(p => p.TenantID == model.TenantID).FirstOrDefault();
                if (GetReservationRequestData != null)
                {
                    GetReservationRequestData.AmenityID       = model.AmenityID;
                    GetReservationRequestData.DesiredDate     = model.DesiredDate;
                    GetReservationRequestData.DesiredTime     = dt.ToString("HH:mm");
                    GetReservationRequestData.Duration        = model.Duration;
                    GetReservationRequestData.DurationID      = model.DurationID;
                    GetReservationRequestData.DepositFee      = model.DepositFee;
                    GetReservationRequestData.ReservationFee  = model.ReservationFee;
                    GetReservationRequestData.Status          = model.Status;
                    GetReservationRequestData.DesiredTimeFrom = model.DesiredTimeFrom;
                    GetReservationRequestData.DesiredTimeTo   = model.DesiredTimeTo;
                    GetReservationRequestData.Guest           = model.Guest;



                    db.SaveChanges();
                    msg = "Reservation Request Updated Successfully";
                }
            }
            db.Dispose();
            return(msg);
        }
Example #17
0
        public string SaveUpdateWorkOrder(WorkOrderModel model)
        {
            ShomaRMEntities db     = new ShomaRMEntities();
            string          msg    = "";
            int             userid = ShomaRM.Models.ShomaGroupWebSession.CurrentUser != null ? ShomaRM.Models.ShomaGroupWebSession.CurrentUser.UserID : 0;

            if (model.WOID == 0)
            {
                var saveWorkorder = new tbl_WorkOrder()
                {
                    WOID         = model.WOID,
                    TenantID     = long.Parse(userid.ToString()),
                    PropertyID   = model.PropertyID,
                    ProblemID    = model.ProblemID,
                    UnitID       = model.UnitID,
                    DateOpened   = model.DateOpened,
                    DateClosed   = model.DateClosed,
                    Description  = model.Description,
                    ReportedBy   = model.ReportedBy,
                    ContactPhone = model.ContactPhone,
                    AssignedTo   = model.AssignedTo,
                    VendorID     = model.VendorID,
                    Resolution   = model.Resolution
                };
                db.tbl_WorkOrder.Add(saveWorkorder);
                db.SaveChanges();


                msg = "Work order Saved Successfully";
            }
            else
            {
                var getWOdata = db.tbl_WorkOrder.Where(p => p.WOID == model.WOID).FirstOrDefault();
                if (getWOdata != null)
                {
                    getWOdata.PropertyID   = model.PropertyID;
                    getWOdata.ProblemID    = model.ProblemID;
                    getWOdata.UnitID       = model.UnitID;
                    getWOdata.DateOpened   = model.DateOpened;
                    getWOdata.DateClosed   = model.DateClosed;
                    getWOdata.Description  = model.Description;
                    getWOdata.ReportedBy   = model.ReportedBy;
                    getWOdata.ContactPhone = model.ContactPhone;
                    getWOdata.AssignedTo   = model.AssignedTo;
                    getWOdata.VendorID     = model.VendorID;
                    getWOdata.Resolution   = model.Resolution;
                }
                db.SaveChanges();
                msg = "Work order Updated Successfully";
            }

            db.Dispose();
            return(msg);
        }
Example #18
0
        public ResponseModel SaveclubEvent(ClubModel model)
        {
            ResponseModel   _respnse = new ResponseModel();
            ShomaRMEntities db       = new ShomaRMEntities();

            if (db.tbl_Club.Where(a => a.ClubTitle.ToLower() == model.ClubTitle.ToLower()).ToList().Count() == 0)
            {
                var ClubCreate = new tbl_Club()
                {
                    Id                 = model.Id,
                    ClubTitle          = model.ClubTitle,
                    ActivityId         = model.ActivityId,
                    StartDate          = model.StartDate,
                    Venue              = model.Venue,
                    DayId              = model.DayId,
                    Time               = model.Time,
                    Contact            = model.Contact,
                    Email              = model.Email,
                    PhoneNumber        = model.PhoneNumber,
                    PhoneCheck         = model.PhoneCheck,
                    EmailCheck         = model.EmailCheck,
                    LevelId            = model.LevelId,
                    SpecialInstruction = model.SpecialInstruction,
                    Description        = model.Description,
                    BriefDescription   = model.BriefDescription,
                    TermsAndCondition  = model.TermsAndCondition,
                    TenantID           = model.TenantID,
                    UserId             = model.UserId,
                    IsDeleted          = false,
                    Active             = true,
                    CreatedDate        = DateTime.UtcNow,
                    LastUpdatedDate    = DateTime.UtcNow
                };
                db.tbl_Club.Add(ClubCreate);
                db.SaveChanges();
                var CreateClubMap = new tbl_ClubMapping()
                {
                    Id     = 0,
                    ClubId = ClubCreate.Id,
                    UserId = model.UserId
                };
                db.tbl_ClubMapping.Add(CreateClubMap);
                db.SaveChanges();
                _respnse.Status = true;
                _respnse.msg    = "Saved Successfully..";
            }
            else
            {
                _respnse.Status = false;
                _respnse.msg    = "You Already Registered For This Event";
            }
            db.Dispose();
            return(_respnse);
        }
Example #19
0
        public string SaveUpdatePurchaseOrder(PurchaseOrderModel model)
        {
            string          msg    = "";
            ShomaRMEntities db     = new ShomaRMEntities();
            int             userid = ShomaRM.Models.ShomaGroupWebSession.CurrentUser != null ? ShomaRM.Models.ShomaGroupWebSession.CurrentUser.UserID : 0;

            if (model.POID == 0)
            {
                var SavePurchaseOrder = new tbl_PurchaseOrder()
                {
                    PropertyID   = model.PropertyID,
                    OrderNumber  = model.OrderNumber,
                    Vendor       = model.Vendor,
                    PODesc       = model.PODesc,
                    PODate       = model.PODate,
                    TotalAmount  = model.TotalAmount,
                    Route        = model.Route,
                    ApprovedDate = model.ApprovedDate,
                    ApprovedBy   = model.ApprovedBy,
                    CanceledDate = model.CanceledDate,
                    CanceledBy   = model.CanceledBy,
                    CreatedBy    = userid,
                    CreatedDate  = Convert.ToDateTime(DateTime.Now.ToString("MM/dd/yyyy"))
                };
                db.tbl_PurchaseOrder.Add(SavePurchaseOrder);
                db.SaveChanges();
                msg = "Purchase Order Save Successfully";
            }
            else
            {
                var UpdatePurchaseOrder = db.tbl_PurchaseOrder.Where(co => co.POID == model.POID).FirstOrDefault();

                if (UpdatePurchaseOrder != null)
                {
                    UpdatePurchaseOrder.PropertyID   = model.PropertyID;
                    UpdatePurchaseOrder.OrderNumber  = model.OrderNumber;
                    UpdatePurchaseOrder.Vendor       = model.Vendor;
                    UpdatePurchaseOrder.PODesc       = model.PODesc;
                    UpdatePurchaseOrder.TotalAmount  = model.TotalAmount;
                    UpdatePurchaseOrder.Route        = model.Route;
                    UpdatePurchaseOrder.ApprovedDate = model.ApprovedDate;
                    UpdatePurchaseOrder.ApprovedBy   = model.ApprovedBy;
                    UpdatePurchaseOrder.CanceledDate = model.CanceledDate;
                    UpdatePurchaseOrder.CanceledBy   = model.CanceledBy;

                    db.SaveChanges();
                    msg = "Purchase Order Updated Successfully";
                }
            }
            db.Dispose();
            return(msg);
        }
Example #20
0
        public string UpdateContactInfo(MyAccountModel model, long UserId)
        {
            string          msg       = "";
            ShomaRMEntities db        = new ShomaRMEntities();
            var             tblTenant = db.tbl_TenantInfo.Where(p => p.TenantID == model.ID).FirstOrDefault();

            if (tblTenant != null)
            {
                tbl_TenantInfo objTable = new tbl_TenantInfo();
                tblTenant.TenantID      = model.ID;
                tblTenant.FirstName     = model.FirstName;
                tblTenant.LastName      = model.LastName;
                tblTenant.MiddleInitial = model.MiddleInitial;
                tblTenant.Mobile        = model.Mobile;
                tblTenant.Email         = model.Email;
                db.SaveChanges();

                var applyNow = db.tbl_ApplyNow.Where(p => p.UserId == UserId).FirstOrDefault();
                if (applyNow != null)
                {
                    applyNow.FirstName = model.FirstName;
                    applyNow.LastName  = model.LastName;
                    applyNow.Phone     = model.Mobile;
                    applyNow.Email     = model.Email;
                }
                db.SaveChanges();

                var loginDet = db.tbl_Login.Where(p => p.UserID == UserId).FirstOrDefault();
                if (loginDet != null)
                {
                    loginDet.FirstName = model.FirstName;
                    loginDet.LastName  = model.LastName;
                    loginDet.Email     = model.Email;
                    loginDet.Username  = model.Email;
                }
                db.SaveChanges();

                var tenantOnline = db.tbl_TenantOnline.Where(p => p.ProspectID == tblTenant.ProspectID).FirstOrDefault();
                if (tenantOnline != null)
                {
                    tenantOnline.FirstName     = model.FirstName;
                    tenantOnline.LastName      = model.LastName;
                    tenantOnline.MiddleInitial = model.MiddleInitial;
                    tenantOnline.Mobile        = model.Mobile;
                    tenantOnline.Email         = model.Email;
                }
                db.SaveChanges();
            }

            db.Dispose();
            return(msg);
        }
Example #21
0
        public string UploadSureDeposit(HttpPostedFileBase fileBaseUploadInsurenceDoc, long ProspectId)
        {
            string          msg         = string.Empty;
            ShomaRMEntities db          = new ShomaRMEntities();
            string          filePath    = "";
            string          fileName    = "";
            string          sysFileName = "";
            string          Extension   = "";

            if (fileBaseUploadInsurenceDoc != null && fileBaseUploadInsurenceDoc.ContentLength > 0)
            {
                filePath = HttpContext.Current.Server.MapPath("~/Content/assets/img/SureDeposit/");
                DirectoryInfo di        = new DirectoryInfo(filePath);
                FileInfo      _FileInfo = new FileInfo(filePath);
                if (!di.Exists)
                {
                    di.Create();
                }
                fileName    = Path.GetFileNameWithoutExtension(fileBaseUploadInsurenceDoc.FileName);
                Extension   = Path.GetExtension(fileBaseUploadInsurenceDoc.FileName);
                sysFileName = fileName + ProspectId + Path.GetExtension(fileBaseUploadInsurenceDoc.FileName);
                fileBaseUploadInsurenceDoc.SaveAs(filePath + "//" + sysFileName);
                if (!string.IsNullOrWhiteSpace(fileBaseUploadInsurenceDoc.FileName))
                {
                    string afileName = HttpContext.Current.Server.MapPath("~/Content/assets/img/SureDeposit/") + "/" + sysFileName;
                }

                var moveInDet = db.tbl_SureDeposit.Where(p => p.ProspectID == ProspectId).FirstOrDefault();
                if (moveInDet == null)
                {
                    var saveSD = new tbl_SureDeposit()
                    {
                        ProspectID   = ProspectId,
                        SDUploadName = sysFileName.ToString(),
                    };
                    db.tbl_SureDeposit.Add(saveSD);
                    db.SaveChanges();
                }
                else
                {
                    moveInDet.SDUploadName = sysFileName.ToString();
                    db.SaveChanges();
                }
                msg = "File Uploaded Successfully |" + sysFileName.ToString();
            }
            else
            {
                msg = "Something went wrong file not Uploaded";
            }
            return(msg);
        }
Example #22
0
        public string SaveUpdateTenantStorage(TenantStorageModel model)
        {
            ShomaRMEntities db = new ShomaRMEntities();
            decimal         totalStorageAmt = 0;
            string          result          = "";

            if (model.lstTStorage != null)

            {
                // check storage available //
                long storageid = model.lstTStorage[0].StorageID ?? 0;

                var storagedata        = db.tbl_Storage.Where(p => p.StorageID == storageid).FirstOrDefault();
                var isStorageAvailable = db.tbl_TenantStorage.Where(p => p.StorageID == storageid && TenantID != model.TenantID).FirstOrDefault();
                if (isStorageAvailable != null)
                {
                    result = "0|" + storagedata.StorageName + " - " + storagedata.Description + " is not available.<br/>Please select other storage unit.|0.00";
                }
                // check storage available //
                else
                {
                    var TenantStorageData = db.tbl_TenantStorage.Where(p => p.TenantID == model.TenantID).ToList();
                    db.tbl_TenantStorage.RemoveRange(TenantStorageData);
                    db.SaveChanges();

                    foreach (var cd in model.lstTStorage)
                    {
                        var cdData = new tbl_TenantStorage
                        {
                            StorageID   = cd.StorageID,
                            TenantID    = model.TenantID,
                            Charges     = storagedata.Charges,
                            CreatedDate = Convert.ToDateTime(DateTime.Now.ToString("MM/dd/yyyy"))
                        };
                        db.tbl_TenantStorage.Add(cdData);
                        db.SaveChanges();
                        totalStorageAmt = totalStorageAmt + Convert.ToDecimal(storagedata.Charges);
                    }

                    result = "1|Progress saved|" + totalStorageAmt.ToString();
                }
            }
            else
            {
                var TenantStorageData = db.tbl_TenantStorage.Where(p => p.TenantID == model.TenantID).ToList();
                db.tbl_TenantStorage.RemoveRange(TenantStorageData);
                db.SaveChanges();
                result = "1|Progress saved|0.00";
            }
            return(result);
        }
        public string SaveUpdateVisit(VisitModel model)
        {
            ShomaRMEntities db      = new ShomaRMEntities();
            string          msg     = "";
            var             visitID = db.tbl_Visit.Where(p => p.VisitID == model.VisitID).FirstOrDefault();

            if (model.VisitID == 0)
            {
                var saveVisit = new tbl_Visit()
                {
                    VisitID       = model.VisitID,
                    ProspectID    = model.ProspectID,
                    VisitDateTime = model.VisitDateTime,
                    ResultCode    = model.ResultCode,
                    VisitNumber   = model.VisitNumber,
                    Details       = model.Details,
                    Activity      = model.Activity,
                    VisitIncharge = model.VisitIncharge,
                    VisitSlot     = model.VisitSlot,
                };
                db.tbl_Visit.Add(saveVisit);
                db.SaveChanges();


                msg = "Visit Saved Successfully";
            }
            else
            {
                var visitData = db.tbl_Visit.Where(p => p.VisitID == model.VisitID).FirstOrDefault();
                if (visitData != null)
                {
                    visitData.VisitID       = model.VisitID;
                    visitData.ProspectID    = model.ProspectID;
                    visitData.VisitDateTime = model.VisitDateTime;
                    visitData.ResultCode    = model.ResultCode;
                    visitData.VisitNumber   = model.VisitNumber;
                    visitData.Details       = model.Details;
                    visitData.Activity      = model.Activity;
                    visitData.VisitIncharge = model.VisitIncharge;
                    visitData.VisitSlot     = model.VisitSlot;
                }
                db.SaveChanges();
                msg = "Visit Updated Successfully";
            }

            db.Dispose();
            return(msg);
        }
        public string SaveUpdateUtilityBilling(UtilityBillingModel model)
        {
            string          result = string.Empty;
            ShomaRMEntities db     = new ShomaRMEntities();

            if (model.UBID == 0)
            {
                var saveWorkorder = new tbl_UtilityBilling()
                {
                    UtilityID     = model.UtilityID,
                    LeaseID       = model.LeaseID,
                    Revision_Num  = model.Revision_Num,
                    Unit          = model.Unit,
                    ChargeType    = model.ChargeType,
                    EffectiveDate = model.EffectiveDate,
                    MeterReading  = model.MeterReading,
                    PricePerUnit  = model.PricePerUnit,
                    Posted        = model.Posted,
                    TenantID      = ShomaGroupWebSession.CurrentUser.TenantID,
                };
                db.tbl_UtilityBilling.Add(saveWorkorder);
                db.SaveChanges();
                result = "Utility Billing Saved Successfully";
            }
            else
            {
                var getUBDta = db.tbl_UtilityBilling.Where(p => p.UBID == model.UBID).FirstOrDefault();
                if (getUBDta != null)
                {
                    getUBDta.UtilityID     = model.UtilityID;
                    getUBDta.LeaseID       = model.LeaseID;
                    getUBDta.Revision_Num  = model.Revision_Num;
                    getUBDta.Unit          = model.Unit;
                    getUBDta.ChargeType    = model.ChargeType;
                    getUBDta.EffectiveDate = model.EffectiveDate;
                    getUBDta.MeterReading  = model.MeterReading;
                    getUBDta.PricePerUnit  = model.PricePerUnit;
                    getUBDta.Posted        = model.Posted;
                    getUBDta.TenantID      = model.TenantID;
                }
                db.SaveChanges();
                result = "Utility Billing Updated Successfully";
            }

            db.Dispose();

            return(result);
        }
Example #25
0
        public string SaveUpdateNotice(NoticeModel model)
        {
            ShomaRMEntities db      = new ShomaRMEntities();
            string          msg     = "";
            var             leaseID = db.tbl_Lease.Where(p => p.TenantID == model.TID && p.Status == 1).FirstOrDefault();

            if (model.NoticeID == 0)
            {
                var saveNotice = new tbl_Notice()
                {
                    PID               = model.PID,
                    UID               = model.UID,
                    TID               = model.TID,
                    LeaseID           = leaseID.LID,
                    Revision_Num      = model.Revision_Num,
                    NoticeDate        = model.NoticeDate,
                    IntendedMoveOut   = model.IntendedMoveOut,
                    CancelNoticeDate  = model.CancelNoticeDate,
                    TerminationReason = model.TerminationReason,
                };
                db.tbl_Notice.Add(saveNotice);
                db.SaveChanges();


                msg = "Notice Saved Successfully";
            }
            else
            {
                var getNOdata = db.tbl_Notice.Where(p => p.NoticeID == model.NoticeID).FirstOrDefault();
                if (getNOdata != null)
                {
                    getNOdata.PID               = model.PID;
                    getNOdata.UID               = model.UID;
                    getNOdata.TID               = model.TID;
                    getNOdata.LeaseID           = leaseID.LID;
                    getNOdata.Revision_Num      = model.Revision_Num;
                    getNOdata.NoticeDate        = model.NoticeDate;
                    getNOdata.IntendedMoveOut   = model.IntendedMoveOut;
                    getNOdata.CancelNoticeDate  = model.CancelNoticeDate;
                    getNOdata.TerminationReason = model.TerminationReason;
                }
                db.SaveChanges();
                msg = "Notice Updated Successfully";
            }

            db.Dispose();
            return(msg);
        }
        public string SaveTenantEventJoin(TenantEventJoinModel model)
        {
            string          msg = "";
            ShomaRMEntities db  = new ShomaRMEntities();
            var             isAlreadyTenantEventJoin = db.tbl_TenantEventJoin.Where(co => co.EventID == model.EventID && co.TenantID == model.TenantID).FirstOrDefault();

            if (isAlreadyTenantEventJoin == null)
            {
                var saveTenantEventJoin = new tbl_TenantEventJoin()
                {
                    TenantID    = model.TenantID,
                    EventID     = model.EventID,
                    Date        = DateTime.Now,
                    Time        = DateTime.Now.TimeOfDay,
                    Fees        = model.Fees,
                    Description = model.Description
                };
                db.tbl_TenantEventJoin.Add(saveTenantEventJoin);
                db.SaveChanges();
                msg = "Progress Saved";
            }
            else
            {
                msg = "You Already Registered For This Event";
            }
            db.Dispose();
            return(msg);
        }
Example #27
0
        public string UpdatePasswordUser(UsersModel model)
        {
            string          encryptedNewPassword = new EncryptDecrypt().EncryptText(model.NewPassword);
            string          encryptedOldPassword = new EncryptDecrypt().EncryptText(model.OldPassword);
            string          msg = "";
            long            uid = ShomaGroupWebSession.CurrentUser != null ? ShomaGroupWebSession.CurrentUser.UserID : 0;
            ShomaRMEntities db  = new ShomaRMEntities();

            var userNameExists = db.tbl_Login.Where(p => p.UserID == uid && p.Password == encryptedOldPassword).FirstOrDefault();


            if (userNameExists != null)
            {
                tbl_Login userData = new tbl_Login();

                userNameExists.Password = encryptedNewPassword;
                db.SaveChanges();
                msg = "Password Change Successfully";
            }
            else
            {
                msg = "Password / User Does Not Match with old";
            }
            return(msg);
        }
Example #28
0
        public String SaveUpdateTenantPet(TenantPetListModel model)
        {
            string          msg = "";
            ShomaRMEntities db  = new ShomaRMEntities();

            if (model.PetID != 0)
            {
                var TenantPetInfo = db.tbl_TenantPet.Where(p => p.PetID == model.PetID).FirstOrDefault();
                if (TenantPetInfo != null)
                {
                    TenantPetInfo.Breed      = model.Breed;
                    TenantPetInfo.Weight     = model.Weight;
                    TenantPetInfo.Age        = model.Age;
                    TenantPetInfo.PetName    = model.PetName;
                    TenantPetInfo.UniqID     = model.UniqID;
                    TenantPetInfo.ExpiryDate = model.ExpiryDate;
                    db.SaveChanges();
                    msg = "Pet information updated successfully.</br>";
                }
                else
                {
                    msg = "Pet information not updated successfully.</br>";
                }
            }
            db.Dispose();
            return(msg);
        }
        public string SaveUpdateFacilityBooking(FacilityBookingModel model)
        {
            string          msg      = "";
            ShomaRMEntities db       = new ShomaRMEntities();
            int             userid   = ShomaRM.Models.ShomaGroupWebSession.CurrentUser != null ? ShomaRM.Models.ShomaGroupWebSession.CurrentUser.UserID : 0;
            long            tenantid = ShomaRM.Models.ShomaGroupWebSession.CurrentUser != null ? ShomaRM.Models.ShomaGroupWebSession.CurrentUser.TenantID : 0;

            if (model.FacilityBookingID == 0)
            {
                var saveFacilityBooking = new tbl_FacilityBooking()
                {
                    FacilityBookingID = model.FacilityBookingID,
                    TenantID          = tenantid,
                    FacilityID        = model.FacilityID,
                    BookingDate       = model.BookingDate,
                    RequiredFromDate  = model.RequiredFromDate,
                    RequiredToDate    = model.RequiredToDate,
                    BookingDetails    = model.BookingDetails,
                    CreatedByID       = userid,
                    CreatedDate       = DateTime.Now
                };
                db.tbl_FacilityBooking.Add(saveFacilityBooking);
                db.SaveChanges();
                msg = "Facility Booking Save Successfully";
            }
            else
            {
                var GetFacilityBookingData = db.tbl_FacilityBooking.Where(p => p.FacilityBookingID == model.FacilityBookingID).FirstOrDefault();

                if (GetFacilityBookingData != null)
                {
                    GetFacilityBookingData.FacilityBookingID = model.FacilityBookingID;
                    GetFacilityBookingData.TenantID          = tenantid;
                    GetFacilityBookingData.FacilityID        = model.FacilityID;
                    GetFacilityBookingData.BookingDate       = model.BookingDate;
                    GetFacilityBookingData.RequiredFromDate  = model.RequiredFromDate;
                    GetFacilityBookingData.RequiredToDate    = model.RequiredToDate;
                    GetFacilityBookingData.BookingDetails    = model.BookingDetails;
                    CreatedByID = userid;
                    CreatedDate = DateTime.Now;
                    db.SaveChanges();
                    msg = "Facility Booking Updated Successfully";
                }
            }
            db.Dispose();
            return(msg);
        }
Example #30
0
        public string UpdateEmContactInfo(MyAccountModel model, long UserId)
        {
            string          msg       = "";
            ShomaRMEntities db        = new ShomaRMEntities();
            var             tblTenant = db.tbl_TenantInfo.Where(p => p.TenantID == model.ID).FirstOrDefault();

            if (tblTenant != null)
            {
                tbl_TenantInfo objTable = new tbl_TenantInfo();
                tblTenant.TenantID           = model.ID;
                tblTenant.EmergencyFirstName = model.EmFirstNane;
                tblTenant.EmergencyLastName  = model.EmLastName;
                tblTenant.EmergencyMobile    = model.EmMobile;
                tblTenant.EmergencyWorkPhone = model.EmWorkPhone;
                tblTenant.EmergencyHomePhone = model.EmHomePhone;
                tblTenant.EmergencyAddress1  = model.EmAddress1;
                tblTenant.EmergencyAddress2  = model.EmAddress2;
                tblTenant.EmergencyEmail     = model.EmEmail;
                tblTenant.Relationship       = model.EmRelation;
                db.SaveChanges();
            }
            var getTenatId = db.tbl_ApplyNow.Where(co => co.UserId == UserId).FirstOrDefault();

            var tblTInfo = db.tbl_TenantInfo.Where(p => p.ProspectID == getTenatId.ID).FirstOrDefault();

            var tblTenantOnline = db.tbl_TenantOnline.Where(p => p.ProspectID == tblTInfo.ProspectID).FirstOrDefault();

            if (tblTenantOnline != null)
            {
                tbl_TenantOnline objTable = new tbl_TenantOnline();

                tblTenantOnline.EmergencyFirstName = model.EmFirstNane;
                tblTenantOnline.EmergencyLastName  = model.EmLastName;
                tblTenantOnline.EmergencyMobile    = model.EmMobile;
                tblTenantOnline.EmergencyWorkPhone = model.EmWorkPhone;
                tblTenantOnline.EmergencyHomePhone = model.EmHomePhone;
                tblTenantOnline.EmergencyAddress1  = model.EmAddress1;
                tblTenantOnline.EmergencyAddress2  = model.EmAddress2;
                tblTenantOnline.EmergencyEmail     = model.EmEmail;
                tblTenantOnline.Relationship       = model.EmRelation;
                db.SaveChanges();
            }

            db.Dispose();
            return(msg);
        }