Esempio n. 1
0
        public static void PostRequirement_C(int? Budgetfrom, int? BudgetTo, string Discription,
            int Uid,short Aid,byte prID,int PlotArea ,byte PlotAreaUnit,int BuildArea,byte BuildAreaUnit,int ExpDate  )
        {
            //TODO
            var context = ObjectContextHelper.CurrentObjectContext;
            if (context == null)
                return;
            tblCommercialRequirement objcommercial = new tblCommercialRequirement();
            objcommercial.tblPropertyType = context.tblPropertyType.Where(pt => pt.PropertyTypeID == prID).First();
            objcommercial.MaxBudget = Budgetfrom;
            objcommercial.MinBudget = BudgetTo;
            objcommercial.ReqDescription = Discription;
            objcommercial.PlotArea = PlotArea;
            objcommercial.PlotUnitID = PlotAreaUnit;
            objcommercial.BuildArea = BuildArea;
            objcommercial.BuildUnitID = BuildAreaUnit;
            objcommercial.tblUser = context.tblUser.Where(us => us.UserId == Uid).First();
            objcommercial.AllowedContactsUserType = null;
            objcommercial.tblArea = context.tblArea.Where(ar => ar.AreaID == Aid).First();
            objcommercial.LeaseType = "I";
            objcommercial.ExpiryDate = DateTime.Today.AddDays(ExpDate);

            context.AddTotblCommercialRequirement(objcommercial);
            context.SaveChanges();
        }
Esempio n. 2
0
        public static void PostRequirement(tblCommercialRequirement objcommercial)
        {
            var context = ObjectContextHelper.CurrentObjectContext;
            if (context == null)
                return;

            context.AddTotblCommercialRequirement(objcommercial);
            context.SaveChanges();
        }