Exemplo n.º 1
0
        public IActionResult LinkStitchingunitWarehouse()
        {
            if (HttpContext.Session.GetString("Id") == null)
            {
                HttpContext.Session.Clear();
                return(RedirectToAction("Index", "Account"));
            }



            Gettablestitchingunitwarehouse            get = new Gettablestitchingunitwarehouse(_context);
            IEnumerable <Tablestitchingunitwarehouse> bussinessEntitiesList = get.gettable();

            GetEntity ga = new GetEntity(_context);



            IEnumerable <BusinessEntity> stitchingunitnotassociated = ga.getnotassociatedstitchingunit();

            ViewData["stitchingunitfree"] = stitchingunitnotassociated;
            IEnumerable <BusinessEntity> warehousenotassociated = ga.getnotassociatedwarehouse();

            ViewData["warehousefree"]  = warehousenotassociated;
            ViewData["tablestitching"] = bussinessEntitiesList;
            return(View());
        }
Exemplo n.º 2
0
        public override void Process()
        {
            if (_params.Count > 1)
            {
                SdtdConsole.Instance.Output("Wrong number of arguments");
                SdtdConsole.Instance.Output(Config.GetHelp(GetType().Name));
                return;
            }

            if (_params.Count == 1)
            {
                // specific player
                string _steamId = "";
                if (GetEntity.GetBySearch(_params[0], out _steamId, "CON"))
                {
                    displayPlayer(new GetPlayer().BySteamId(_steamId));
                }
            }
            else
            {
                // All players
                List <string> players = GetEntity.GetStoredPlayers(_options);
                foreach (string _steamId in players)
                {
                    displayPlayer(new GetPlayer().BySteamId(_steamId));
                }
                SendOutput("Total of " + players.Count + " player data files");
            }
        }
 public ObservableCollectionMapper(ConstructModel constructModel, GetEntity getEntity, UpdateModel updateModel, Comparison <TViewModel> comparison)
 {
     this.constructModel = constructModel;
     this.getEntity      = getEntity;
     this.updateModel    = updateModel;
     this.comparison     = comparison;
 }
Exemplo n.º 4
0
        public IActionResult LinkShopWarehouse()

        {
            if (HttpContext.Session.GetString("Id") == null)
            {
                HttpContext.Session.Clear();
                return(RedirectToAction("Index", "Account"));
            }



            Gettablewarehouse get = new Gettablewarehouse(_context);

            IEnumerable <tableshopwarehouse> bussinessEntitiesList = get.gettable();
            int       type = 2;//for warehouse
            GetEntity ga   = new GetEntity(_context);
            IEnumerable <BusinessEntity> warehouses = ga.getBussinessEntities(type);

            ViewData["warehousfree"] = warehouses;
            type = 1;
            IEnumerable <BusinessEntity> shops = ga.getBussinessEntities(type);
            IEnumerable <BusinessEntity> shopsnotassociated = ga.getnotassociatedshops();

            ViewData["shopsfree"] = shopsnotassociated;
            ViewData["table"]     = bussinessEntitiesList;

            return(View());
        }
 public bool AuthorizationRequest(HttpContextBase httpContext)
 {
     if (httpContext.Session["XzUserLogin"] == null && httpContext.Session["AdminUserLogin"] == null)
     {
         return(false);
     }
     else
     {
         if (httpContext.Session["XzUserLogin"] != null)
         {
             var ad = new AdministratorObject
             {
                 Account   = httpContext.Session["XzUserLogin"].ToString(),
                 Authority = "校长"
             };
             httpContext.Session["AdministratorObject"] = ad;
         }
         else
         {
             ISchoolAdministratorDal administratorDal = new SchoolAdministratorDal(ConfigurationManager.AppSettings["assembly"]);
             IGetEntity getEntity = new GetEntity();
             var        entity    = getEntity.GetEntityForKey(httpContext.Session["AdminUserLogin"].ToString(), administratorDal);
             var        ad        = new AdministratorObject()
             {
                 Account   = httpContext.Session["AdminUserLogin"].ToString(),
                 Authority = entity.CreateAdminitratorDetialDatas.AdministratorAuthority,
             };
             httpContext.Session["AdministratorObject"] = ad;
         }
         return(true);
     }
 }
Exemplo n.º 6
0
        public void TestMethod2()
        {
            //assumption: configuration file is stored in local drive c:
            GetEntity a    = new GetEntity("C:\\configuration.json", "U");
            var       list = a.EntityList(a.getData());

            Assert.IsNotNull(list, "No data found.");
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            GetEntity entity = new GetEntity("C:\\configuration.json", "U");
            var       list   = entity.EntityList(entity.getData());

            if (list != null)
            {
                foreach (var x in list)
                {
                    Console.WriteLine(x.Id.ToString() + ", " + x.Created + ", " + x.Type + ", " + x.Content);
                }
            }
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
Exemplo n.º 8
0
        public IActionResult SelectShop()
        {
            if (HttpContext.Session.GetString("Id") == null)
            {
                HttpContext.Session.Clear();
                return(RedirectToAction("Index", "Account"));
            }

            int       type = 1;//for shop
            GetEntity get  = new GetEntity(_context);
            IEnumerable <BusinessEntity> shops = get.getBussinessEntities(type);

            ViewData["Allshops"] = shops;

            return(View());
        }
Exemplo n.º 9
0
        public void TestMethod1()
        {
            List <Entity> ent = new List <Entity>();

            for (var x = 0; x < 5; x++)
            {
                var data = new Entity {
                    Id = x + 1, Created = DateTime.Now.AddMinutes(x + 1), Type = "U", Content = "test" + (x + 1).ToString()
                };
                ent.Add(data);
            }

            GetEntity a    = new GetEntity("", "U");
            var       list = a.EntityList(ent);

            Assert.IsNotNull(list, "No data found.");
        }
Exemplo n.º 10
0
        private int GeneratePlayerNumber()
        {
            while (true)
            {
                int number = new Random().Next(100_000, 999_999);

                PlayerEntity entity = GetEntity <PlayerEntity>
                                      .OfAnyPlayers()
                                      .Where("Number", number)
                                      .First();

                if (entity == null)
                {
                    return(number);
                }
            }
        }
Exemplo n.º 11
0
        public ActionResult GetEmailValidateCode(LogInModel model, string ValidateCode, string Option = "administartor")
        {
            bool isValidateForSend = false;
            bool sendIsOk          = false;

            //发送验证码
            ICreateEmail sendEmail = new CreateEnail();
            IGetEntity   getEntity = new GetEntity();
            //创建四位随机码
            String validateCode = CreateValidateCode.CreateValidateCodes();

            try
            {
                if (model.Account == null || model.Password == null)
                {
                    return(JavaScript(""));
                }
                Session["Administartor"] = validateCode;
                ILoinValidate log = new LoginValidate();
                if (sendIsOk == false && log.ValidateAccount(model, option: Option))
                {
                    var entity = getEntity.GetEntityForKey(model.Account,
                                                           accountSchoolDal);
                    sendIsOk = sendEmail.SeendEmail(entity.AdministratorAccount, entity.CreateAdminitratorDetialDatas.Email,
                                                    validateCode, "登陆验证");
                }
            }
            catch (Exception e)
            {
                isValidateForSend = false;
            }
            if (sendIsOk)
            {
                var createCookie = new CreateCooks();
                //创建Cookie
                var cookie = createCookie.CreateCooki(5);
                HttpContext.Response.Cookies.Add(cookie);
                isValidateForSend = true;
            }
            if (isValidateForSend)
            {
                var str = CreateJavaScript.CreateJS(5);
                return(JavaScript(str));
            }
            return(new HttpStatusCodeResult(400));
        }
Exemplo n.º 12
0
        public ActionResult StuStatusDeleteAdmin(IEnumerable <StudentDetialData> adminDatas)
        {
            IStudentDetialDataDal dal    = new StudentDetialDatasDal(ConfigurationManager.AppSettings["assembly"]);
            IStudentDetialDelete  delete = new DeleteDatas();
            bool isUpdate = delete.LibrayDelete(adminDatas, dal);

            if (isUpdate)
            {
                IGetEntity get = new GetEntity();
                List <StudentDetialData> list = new List <StudentDetialData>();
                list = dal.GetEntityForExpress(x => true).ToList();
                //序列化为JSON数据
                var json = CreateJson(list);
                return(Json(
                           json, JsonRequestBehavior.AllowGet));
            }
            return(new HttpStatusCodeResult(404, "无法保存"));
        }
Exemplo n.º 13
0
        //插入
        public ActionResult InserLibrayManagent(IEnumerable <LibrayManagent> adminDatas)
        {
            ILibrayManagentDAL    dal    = new LibrayManagetnDal(ConfigurationManager.AppSettings["assembly"]);
            ILibrayInsertDatabase update = new InsertData();
            bool isUpdate = update.Insert(adminDatas, dal);

            if (isUpdate)
            {
                IGetEntity         get        = new GetEntity();
                ILibrayManagentDAL sc         = new LibrayManagetnDal(ConfigurationManager.AppSettings["assembly"]);
                LibrayManagent     adminTable = new LibrayManagent();
                var jsonData = get.GetEntitys(x => true, sc).ToList();
                //将对象序列化为JSON格式
                var json = CreateJson(jsonData);
                return(Json(json, JsonRequestBehavior.AllowGet));
            }
            return(new HttpStatusCodeResult(404, "无法保存"));
        }
Exemplo n.º 14
0
        public ActionResult XzViews()
        {
            var adminObj  = Session["AdministratorObject"] as AdministratorObject;
            var account   = adminObj.Account;
            var authority = adminObj.Authority;

            if (authority != "学籍管理")
            {
                return(new HttpStatusCodeResult(404, "您没有权限查看此页面"));
            }
            IGetEntity get                     = new GetEntity();
            ISchoolAdministratorDal sc         = new SchoolAdministratorDal(ConfigurationManager.AppSettings["assembly"]);
            SchoolAdministrator     adminTable = new SchoolAdministrator();
            var jsonData = get.GetEntitys(x => true, sc).ToList();
            //将对象序列化为JSON格式
            var json = CreateJson(jsonData);

            return(Json(json, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 15
0
        public IActionResult AddStitchingunitEmployee()

        {
            if (HttpContext.Session.GetString("Id") == null)
            {
                HttpContext.Session.Clear();
                return(RedirectToAction("Index", "Account"));
            }



            int type = 3;//forstitchingunit

            GetEntity ga = new GetEntity(_context);
            IEnumerable <BusinessEntity> categories = ga.getBussinessEntities(type);

            ViewData["stunitid"] = categories;
            return(View());
        }
Exemplo n.º 16
0
        public IActionResult stunitdphead(int type)
        {
            if (HttpContext.Session.GetString("Id") == null)
            {
                HttpContext.Session.Clear();
                return(RedirectToAction("Index", "Account"));
            }


            //  @model List< MadetoMeasureT.Models.BusinessEntity >

            GetEntity ga = new GetEntity(_context);
            IEnumerable <BusinessEntity> categories = ga.getBussinessEntities(type);

            //  List<BusinessEntity> blist = new List<BusinessEntity>();
            //   blist = ga.getBussinessEntities(type);
            ViewData["stunitid"] = categories;
            return(View());
        }
Exemplo n.º 17
0
        public void Handle(GetEntity message)
        {
            var entityType = message.EntityType;
            var fileName   = GetFileName(message.Key, entityType);

            var info = new FileInfo(fileName);

            if (!info.Exists)
            {
                Sender.Tell(new EntityNotFound(message.Key));
            }

            _log.Info("Get entity: {0}/{1:n}", entityType.Name, message.Key);

            object entity;

            using (var stream = new FileStream(info.FullName, FileMode.Open, FileAccess.Read, FileShare.None))
                using (var reader = new StreamReader(stream))
                {
                    entity = JsonConvert.DeserializeObject(reader.ReadToEnd(), entityType, _serializerSettings);
                }

            Sender.Tell(new EntityRetrieved(message.Key, entity));
        }
Exemplo n.º 18
0
        public override async Task <T> PerformQueryAsync(GetEntity <T> request, CancellationToken cancellationToken)
        {
            var dbSet = dbContextProvider.GetDBSet <T>();

            return(await dbSet.QueryByIdAsync(request.Id, cancellationToken));
        }
Exemplo n.º 19
0
 public PlayerEntity GetPlayerEntity()
 {
     return(GetEntity <PlayerEntity> .OfPlayer(Caller).First());
 }