コード例 #1
0
        public static void setInRentProperty(Classes.PropertyDetails pd, MainUI m)
        {
            DataClasses1DataContext cntx = ToLet.Database.DBConnectionProvider.getDBConnection();
            var info = (from p in cntx.Properties
                        where p.TenantCategory == pd.TenantCategory && p.HomeCategory == pd.HomeCategory && p.Location == pd.Location && p.RoomCount == int.Parse(pd.RoomCount) &&
                        p.Detailed_Address == pd.DetailedAddress && p.Additional_Comments == pd.AdditionalComment && p.RentRangeId == int.Parse(pd.RentRange)
                        select p).SingleOrDefault();

            info.PropertyStatus   = "inrent";
            info.Request_for_rent = 0;

            cntx.SubmitChanges();
            m.GetData();
        }
コード例 #2
0
        public static void setTenant(Classes.User tenant, Classes.PropertyDetails pd, MainUI m)
        {
            DataClasses1DataContext cntx = ToLet.Database.DBConnectionProvider.getDBConnection();


            var info = (from p in cntx.Properties
                        where p.TenantCategory == pd.TenantCategory && p.HomeCategory == pd.HomeCategory && p.Location == pd.Location && p.RoomCount == int.Parse(pd.RoomCount) &&
                        p.Detailed_Address == pd.DetailedAddress && p.Additional_Comments == pd.AdditionalComment && p.RentRangeId == int.Parse(pd.RentRange)
                        select p).SingleOrDefault();

            var userid = (from q in cntx.Users
                          where q.UserName == tenant.UserName
                          select q).SingleOrDefault();


            Tenant t = new Tenant();

            t.UserId     = userid.UserId;
            t.PropertyId = info.PropertyId;

            cntx.Tenants.InsertOnSubmit(t);
            cntx.SubmitChanges();
            m.GetData();
        }
コード例 #3
0
        public static void setMyLandlord(Classes.User tenant, Classes.PropertyDetails pd, MainUI m)
        {
            DataClasses1DataContext cntx = ToLet.Database.DBConnectionProvider.getDBConnection();

            m.GetData();
        }