Example #1
0
        public TradelaneTrackingConfigurationModel SavingTrackingConfiguration(TradelaneTrackingConfigurationModel TradelaneConfig)
        {
            TradelaneTrackingConfigurationModel TC = new TradelaneTrackingConfigurationModel();

            //Saving Tradelane Milestone

            # region MileStone Save
            foreach (var TRKMileStone in TradelaneConfig.TrackingMileStone)
Example #2
0
        public IHttpActionResult SavingTrackingConfiguration(TradelaneTrackingConfigurationModel TradelaneConfig)
        {
            var a = new TradelaneTrackingConfigurationRepository().SavingTrackingConfiguration(TradelaneConfig);

            return(Ok(a));
        }
Example #3
0
        public List <TradelaneTrackingMileStoneModel> GetTrackingConfiguration(int UserId, string TrackIds)
        {
            List <TradelaneUserTrackingConfiguration> Result        = new List <TradelaneUserTrackingConfiguration>();
            TradelaneTrackingConfigurationModel       TradTrackList = new TradelaneTrackingConfigurationModel();
            var TrackId = TrackIds.Split(',');
            var Resu    = dbContext.TradelaneUserTrackingConfigurations.Where(a => a.UserId == UserId).ToList();

            if (TrackIds != null)
            {
                foreach (var tr in TrackId)
                {
                    foreach (var a in Resu)
                    {
                        if (a.TrackingMileStoneId == Convert.ToInt32(tr))
                        {
                            Result.Add(a);
                        }
                    }
                }
            }
            if (Result.Count > 0)
            {
                TradTrackList.TrackingMileStone = new List <TradelaneTrackingMileStoneModel>();
                foreach (var res in Result.Where(a => a.TrackingMileStoneId != null).ToList())
                {
                    TradelaneTrackingMileStoneModel TM = new TradelaneTrackingMileStoneModel();
                    TM.TradelaneUserTrackingConfigurationId = res.TradelaneUserTrackingConfigurationId;
                    TM.IsEmailSend         = res.IsEmailSend;
                    TM.TrackingMileStoneId = res.TrackingMileStoneId.Value;
                    TM.UserId = res.UserId;
                    var ConfigResult = dbContext.TradelaneUserTrackingConfigurationDetails.Where(a => a.TradelaneUserTrackingConfigurationId == res.TradelaneUserTrackingConfigurationId).ToList();
                    TM.ConfigurationDetail = new List <TradelaneTrackingDetail>();
                    foreach (var ConfigDtl in ConfigResult)
                    {
                        TradelaneTrackingDetail TD = new TradelaneTrackingDetail();
                        TD.TradelaneUserTrackingConfigurationDetailId = ConfigDtl.TradelaneUserTrackingConfigurationDetailId;
                        TD.Name         = ConfigDtl.Name;
                        TD.Email        = ConfigDtl.Email;
                        TD.CreatedBy    = ConfigDtl.CreatedBy;
                        TD.CreatedOnUtc = ConfigDtl.CreatedOnUtc;
                        TD.UpdatedOn    = ConfigDtl.UpdatedOn.Value;
                        TD.UpdatedOnUtc = ConfigDtl.UpdatedOnUtc.Value;
                        TM.ConfigurationDetail.Add(TD);
                    }
                    TradTrackList.TrackingMileStone.Add(TM);
                }
                //TradTrackList.PreAlert = new TradelaneTrackingPreAlert();
                //var Pre = dbContext.TradelaneUserTrackingConfigurations.Where(a => a.OtherMethod != null).ToList();
                //foreach(var P in Pre)
                //{
                //    if(P.UserId == UserId)
                //    {
                //        TradTrackList.PreAlert.TradelaneUserTrackingConfigurationId = P.TradelaneUserTrackingConfigurationId;
                //        TradTrackList.PreAlert.IsEmailSend = P.IsEmailSend;
                //        TradTrackList.PreAlert.OtherMethod = P.OtherMethod;
                //        TradTrackList.PreAlert.UserId = P.UserId;
                //        var ConfigResult1 = dbContext.TradelaneUserTrackingConfigurationDetails.Where(a => a.TradelaneUserTrackingConfigurationId == TradTrackList.PreAlert.TradelaneUserTrackingConfigurationId).ToList();
                //        TradTrackList.PreAlert.ConfigurationDetail = new List<TradelaneTrackingDetail>();
                //        foreach (var ConfigDtl in ConfigResult1)
                //        {
                //            TradelaneTrackingDetail TD = new TradelaneTrackingDetail();
                //            TD.TradelaneUserTrackingConfigurationDetailId = ConfigDtl.TradelaneUserTrackingConfigurationDetailId;
                //            TD.Name = ConfigDtl.Name;
                //            TD.Email = ConfigDtl.Email;
                //            TD.CreatedBy = ConfigDtl.CreatedBy;
                //            TD.CreatedOnUtc = ConfigDtl.CreatedOnUtc;
                //            TD.UpdatedOn = ConfigDtl.UpdatedOn.Value;
                //            TD.UpdatedOnUtc = ConfigDtl.UpdatedOnUtc.Value;
                //            TradTrackList.PreAlert.ConfigurationDetail.Add(TD);
                //        }
                //        return TradTrackList;
                //    }
                //}
                return(TradTrackList.TrackingMileStone);
            }
            else
            {
                return(TradTrackList.TrackingMileStone);
            }
        }