Пример #1
0
        public ActionResult Supplier(long placeId, long primaryIndustryId, long relatedIndustryId)
        {
            Guid?userid = null;

            if (User.Identity.IsAuthenticated)
            {
                userid = (Guid)Membership.GetUser().ProviderUserKey;
            }

            var item = new RelatedSupplier()
            {
                PrimaryIndustryId = primaryIndustryId,
                RelatedIndustryId = relatedIndustryId,
                PlaceId           = placeId,
                UserId            = userid
            };


            Singleton <Tracker> .Instance.RelatedSupplier(item);

            return(Json(true, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public void RelatedSupplier(RelatedSupplier reg)
        {
            TimeStamp stamp = new TimeStamp();

            reg.Day       = stamp.Day;
            reg.Hour      = stamp.Hour;
            reg.Minute    = stamp.Minute;
            reg.Month     = stamp.Month;
            reg.Quarter   = stamp.Quarter;
            reg.Year      = stamp.Year;
            reg.Week      = stamp.Week;
            reg.Timestamp = stamp.Stamp;
            reg.Session   = APIContext.Current.Session;

            Task.Factory.StartNew(() =>
            {
                using (var context = ContextFactory.AnalyticsContext)
                {
                    context.RelatedSuppliers.AddObject(reg);
                    context.SaveChanges();
                }
            });
        }