public TerritoryController(WorkersInMotionDB context)
 {
     this._IRegionRepository = new RegionRepository(context);
     this._IMarketRepository = new MarketRepository(context);
     this._ITerritoryRepository = new TerritoryRepository(context);
     this._IGlobalUserRepository = new GlobalUserRepository(context);
 }
 public PlaceController(WorkersInMotionDB context)
 {
     this._IPlaceRepository = new PlaceRepository(context);
     this._IPeopleRepository = new PeopleRepository(context);
     this._IMarketRepository = new MarketRepository(context);
     this._IUserProfileRepository = new UserProfileRepository(context);
 }
Exemplo n.º 3
0
 public JobRepository(WorkersInMotionDB context)
 {
     this.context = context;
     this.contextWIM = new WorkersInMotionDB();
     this._IMarketRepository = new MarketRepository(new WorkersInMotionDB());
     this._IOrganizationRepository = new OrganizationRepository(new WorkersInMotionDB());
     this._IPlaceRepository = new PlaceRepository(new WorkersInMotionDB());
     this._IPORepository = new PORepository(new WorkersInMotionDB());
 }
Exemplo n.º 4
0
 public JobController(WorkersInMotionDB context)
 {
     this._IPlaceRepository = new PlaceRepository(context);
     this._IMarketRepository = new MarketRepository(context);
     this._IRegionRepository = new RegionRepository(context);
     this._ITerritoryRepository = new TerritoryRepository(context);
     this._IJobRepository = new JobRepository(context);
     this._IJobSchemaRepository = new JobSchemaRepository(context);
 }
 public ServicePointController(WorkersInMotionDB context)
 {
     this._IPlaceRepository = new PlaceRepository(context);
     this._IPeopleRepository = new PeopleRepository(context);
     this._IMarketRepository = new MarketRepository(context);
     this._IUserProfileRepository = new UserProfileRepository(context);
     this._ITerritoryRepository = new TerritoryRepository(context);
     this._IRegionRepository = new RegionRepository(context);
 }
 public AssignJobController(WorkersInMotionDB context)
 {
     this._IGlobalUserRepository = new GlobalUserRepository(context);
     this._IPlaceRepository = new PlaceRepository(context);
     this._IMarketRepository = new MarketRepository(context);
     this._IRegionRepository = new RegionRepository(context);
     this._ITerritoryRepository = new TerritoryRepository(context);
     this._IJobRepository = new JobRepository(context);
     this._IJobSchemaRepository = new JobSchemaRepository(context);
     // this._IGroupRepository = new GroupRepository(context);
 }
 public JobStatusController(WorkersInMotionDB context)
 {
     this._IGlobalUserRepository = new GlobalUserRepository(context);
     this._IUserProfileRepository = new UserProfileRepository(context);
     this._IPlaceRepository = new PlaceRepository(context);
     this._IMarketRepository = new MarketRepository(context);
     this._ITerritoryRepository = new TerritoryRepository(context);
     this._IRegionRepository = new RegionRepository(context);
     this._IUserRepository = new UserRepository(context);
     this._IJobRepository = new JobRepository(context);
     this._IPORepository = new PORepository(context);
 }
 public OrganizationController(WorkersInMotionDB context)
 {
     this._IOrganizationRepository = new OrganizationRepository(context);
     this._IUserProfileRepository = new UserProfileRepository(context);
     this._IUserRepository = new UserRepository(context);
     this._IGlobalUserRepository = new GlobalUserRepository(context);
     this._IRegionRepository = new RegionRepository(context);
     this._ITerritoryRepository = new TerritoryRepository(context);
     //  this._IGroupRepository = new GroupRepository(context);
     this._IOrganizationSubscriptionRepository = new OrganizationSubscriptionRepository(context);
     this._IUserSubscriptionRepository = new UserSubscriptionRepository(context);
     this._IMarketRepository = new MarketRepository(context);
 }
 public CustomerViewController(WorkersInMotionDB context)
 {
     this._IOrganizationRepository = new OrganizationRepository(context);
     this._IUserRepository = new UserRepository(context);
     this._IOrganizationSubscriptionRepository = new OrganizationSubscriptionRepository(context);
     this._IUserSubscriptionRepository = new UserSubscriptionRepository(context);
     this._IPlaceRepository = new PlaceRepository(context);
     this._IPeopleRepository = new PeopleRepository(context);
     this._IMarketRepository = new MarketRepository(context);
     this._IUserProfileRepository = new UserProfileRepository(context);
     this._IRegionRepository = new RegionRepository(context);
     this._ITerritoryRepository = new TerritoryRepository(context);
     this._IGlobalUserRepository = new GlobalUserRepository(context);
 }
 public StoreVisitController(WorkersInMotionDB context)
 {
     this._IOrganizationRepository = new OrganizationRepository(context);
     this._IPlaceRepository = new PlaceRepository(context);
     this._IPeopleRepository = new PeopleRepository(context);
     this._IMarketRepository = new MarketRepository(context);
     this._IUserProfileRepository = new UserProfileRepository(context);
     this._IRegionRepository = new RegionRepository(context);
     this._ITerritoryRepository = new TerritoryRepository(context);
     this._IJobRepository = new JobRepository(context);
     this._IUserRepository = new UserRepository(context);
     this._IGlobalUserRepository = new GlobalUserRepository(context);
     this._IPORepository = new PORepository(context);
 }
 public GlobalUserRepository()
 {
     WorkersInMotionDB context = new WorkersInMotionDB();
     this.context = context;
 }
 public UserSubscriptionRepository(WorkersInMotionDB context)
 {
     this.context = context;
 }
Exemplo n.º 13
0
 public PlaceRepository(WorkersInMotionDB context)
 {
     this.context = context;
 }
 public JobSchemaController(WorkersInMotionDB context)
 {
     this._IJobSchemaRepository = new JobSchemaRepository(context);
     this._IJobRepository = new JobRepository(context);
     this._IUserRepository = new UserRepository(context);
 }
Exemplo n.º 15
0
        public MasterLogin UserLoginServer(string userName, string password)
        {
            Logger.Debug("Inside UserLogin");
            MasterLogin masterlogin = new MasterLogin();
            try
            {
                //  MasterLogin masterlogin = new MasterLogin();
                //using (var dataContext = new WorkersInMotionDB())
                //{
                //    var aspuser = (from p in dataContext.GlobalUsers
                //                   where p.UserName == userName && p.Password == password
                //                   select p).FirstOrDefault();
                //    if (aspuser != null)
                //    {
                //        Logger.Debug("Inside Role");
                //        AspNetRole asprole = GetRole(aspuser.Role_Id);

                //        masterlogin = (from p in dataContext.MasterLogins
                //                       where p.UserGUID == aspuser.UserGUID
                //                       select p).FirstOrDefault();
                //        if (masterlogin != null)
                //        {
                //            Logger.Debug("Inside MasterLogin");

                //            var qry = from p in dataContext.MasterLogins where p.LoginGUID == masterlogin.LoginGUID select p;
                //            var item = qry.Single();
                //            item.SessionID = Guid.NewGuid().ToString();
                //            item.LastModifiedDate = DateTime.UtcNow;
                //            item.LastModifiedBy = aspuser.UserGUID;
                //            if (dataContext.SaveChanges() > 0)
                //            {
                //                return masterlogin;
                //            }
                //            else
                //            {
                //                return null;
                //            }
                //        }
                //        else
                //        {
                //            Logger.Debug("Inside MasterLogin Create");
                //            masterlogin = new MasterLogin();
                //            masterlogin.LoginGUID = Guid.NewGuid();
                //            masterlogin.UserGUID = aspuser.UserGUID;
                //            masterlogin.IsActive = true;
                //            masterlogin.SessionID = Guid.NewGuid().ToString();
                //            masterlogin.ExpiryTime = DateTime.UtcNow;
                //            masterlogin.SessionTimeOut = 60;
                //            masterlogin.IsLoggedIn = true;
                //            masterlogin.Phone = "";
                //            masterlogin.CreateDate = DateTime.UtcNow;
                //            masterlogin.CreateBy = aspuser.UserGUID;
                //            masterlogin.LastModifiedDate = DateTime.UtcNow;
                //            masterlogin.LastModifiedBy = aspuser.UserGUID;
                //            int result = InsertMasterLogin(masterlogin);
                //            //int result = Save();
                //            if (result > 0)
                //            {
                //                return masterlogin;
                //            }
                //            else
                //            {
                //                return null;
                //            }

                //        }
                //    }
                //    else
                //    {
                //        Logger.Debug("AspUser is null");
                //        return null;
                //    }
                //}

                using (var dataContext = new WorkersInMotionDB())
                {

                    var aspuser = UserLogin(userName, password);
                    if (aspuser != null)
                    {
                        Logger.Debug("Inside Role");
                        AspNetRole asprole = GetRole(aspuser.Role_Id);

                        SqlParameter[] Param = new SqlParameter[1];
                        Param[0] = new SqlParameter("@pUserGUID", SqlDbType.UniqueIdentifier);
                        Param[0].Value = aspuser.UserGUID;

                        masterlogin = context.Database.SqlQuery<MasterLogin>("select * from  MasterLogins where UserGUID=@pUserGUID", Param).FirstOrDefault();

                        if (masterlogin != null)
                        {
                            Logger.Debug("Inside MasterLogin");

                            //var qry = from p in dataContext.MasterLogins where p.LoginGUID == masterlogin.LoginGUID select p;
                            //var item = qry.Single();
                            //item.SessionID = Guid.NewGuid().ToString();
                            //item.LastModifiedDate = DateTime.UtcNow;
                            //item.LastModifiedBy = aspuser.UserGUID;

                            masterlogin.SessionID = Guid.NewGuid().ToString();
                            masterlogin.LastModifiedDate = DateTime.UtcNow;
                            if (UpdateMasterLogins(masterlogin) > 0)
                            {
                                return masterlogin;
                            }
                            else
                            {
                                return null;
                            }
                        }
                        else
                        {
                            Logger.Debug("Inside MasterLogin Create");
                            masterlogin = new MasterLogin();
                            masterlogin.LoginGUID = Guid.NewGuid();
                            masterlogin.UserGUID = aspuser.UserGUID;
                            masterlogin.IsActive = true;
                            masterlogin.SessionID = Guid.NewGuid().ToString();
                            masterlogin.ExpiryTime = DateTime.UtcNow;
                            masterlogin.SessionTimeOut = 60;
                            masterlogin.IsLoggedIn = true;
                            masterlogin.Phone = "";
                            masterlogin.CreateDate = DateTime.UtcNow;
                            masterlogin.CreateBy = aspuser.UserGUID;
                            masterlogin.LastModifiedDate = DateTime.UtcNow;
                            masterlogin.LastModifiedBy = aspuser.UserGUID;
                            int result = InsertMasterLogin(masterlogin);
                            //int result = Save();
                            if (result > 0)
                            {
                                return masterlogin;
                            }
                            else
                            {
                                return null;
                            }

                        }
                    }
                    else
                    {
                        Logger.Debug("AspUser is null");
                        return null;
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message);
                return null;
            }
        }
Exemplo n.º 16
0
        //public UserRepository()
        //{
        //    WorkersInMotionContext context = new WorkersInMotionContext();
        //    this.context = context;
        //}
        public UserRepository(WorkersInMotionDB context)
        {
            this.context = context;
            _ILogservice = new Log4NetService(GetType());

        }
 public OrganizationSubscriptionRepository(WorkersInMotionDB context)
 {
     this.context = context;
 }
 public JobSchemaRepository(WorkersInMotionDB context)
 {
     this.context = context;
 }
 public SessionExpireFilterAttribute(WorkersInMotionDB context)
 {
     this._IUserRepository = new UserRepository(context);
 }
Exemplo n.º 20
0
 public MarketRepository(WorkersInMotionDB context)
 {
     this.context = context;
 }
 public OrganizationSubscriptionController(WorkersInMotionDB context)
 {
     this._IOrganizationSubscriptionRepository = new OrganizationSubscriptionRepository(context);
     this._IOrganizationRepository = new OrganizationRepository(context);
     this._IGlobalUserRepository = new GlobalUserRepository(context);
 }
Exemplo n.º 22
0
 public PORepository()
 {
     WorkersInMotionDB context = new WorkersInMotionDB();
     this.context = context;
 }
 public TerritoryRepository(WorkersInMotionDB context)
 {
     this.context = context;
 }
Exemplo n.º 24
0
 public RegionRepository(WorkersInMotionDB context)
 {
     this.context = context;
 }
 public GlobalUserRepository(WorkersInMotionDB context)
 {
     this.context = context;
 }
 public UserProfileRepository(WorkersInMotionDB context)
 {
     this.context = context;
     this._IUserRepository = new UserRepository(new WorkersInMotionDB());
 }