예제 #1
0
    protected void PersonRefresh(object sender, StoreRefreshDataEventArgs e)
    {
        //需要添加权限判断-判断是否为走动干部进入

        //var q = dc.Person.Where(p => p.Posid == Convert.ToInt32(cbb_zhiwu.SelectedItem.Value) && p.Maindeptid == SessionBox.GetUserSession().DeptNumber);
        var q = from p in dc.Person
                where p.Posid == Convert.ToInt32(cbb_zhiwu.SelectedItem.Value) && p.Maindeptid == SessionBox.GetUserSession().DeptNumber
                orderby p.Name ascending
                select new
        {
            p.Personnumber,
            p.Name
        };

        PersonStore.DataSource = q;
        PersonStore.DataBind();
        cbb_person.Disabled = q.Count() > 0 ? false : true;
    }
예제 #2
0
        async Task ExecuteLoadPersonCommand(bool loadAPI = false)
        {
            IsBusy = true;
            try
            {
                Items.Clear();
                var items = await PersonStore.GetItemsAsync(true, loadAPI);

                foreach (var item in items)
                {
                    Items.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
예제 #3
0
 public void TearDown()
 {
     PersonStore.DELETE_ALL();
 }
예제 #4
0
 public void AddPerson([DataBind("Person")] Person p)
 {
     PersonStore.AddPerson(p);
     RedirectToAction("Index");
 }
예제 #5
0
        public void SetUp()
        {
            IPersonStore PersonStore = new PersonStore();

            george                = PersonStore.AddPerson("George", Gender.Male);
            mary                  = PersonStore.AddPerson("Mary", Gender.Female);
            bob                   = PersonStore.AddPerson("Bob", Gender.Male);
            sally                 = PersonStore.AddPerson("Sally", Gender.Female);
            dave                  = PersonStore.AddPerson("Dave", Gender.Male);
            davesMaternalUncle    = PersonStore.AddPerson("Hulk", Gender.Male);
            davesPaternalAunt     = PersonStore.AddPerson("Aunt", Gender.Female);
            davesMaternalGrandDad = PersonStore.AddPerson("Thor", Gender.Male);
            davesMaternalGrandMom = PersonStore.AddPerson("Wonder", Gender.Female);
            davesPaternalGrandDad = PersonStore.AddPerson("Thor1", Gender.Male);
            davesPaternalGrandMom = PersonStore.AddPerson("Wonder1", Gender.Female);

            amy          = PersonStore.AddPerson("Amy", Gender.Female);
            bamy         = PersonStore.AddPerson("Bamy", Gender.Female);
            miller       = PersonStore.AddPerson("Miller", Gender.Male);
            amysBrother  = PersonStore.AddPerson("BigB", Gender.Male);
            amysBrother1 = PersonStore.AddPerson("ABig", Gender.Male);
            amysMom      = PersonStore.AddPerson("Miley", Gender.Female);
            amysDad      = PersonStore.AddPerson("Brad", Gender.Male);

            FamilyGraph familyGraph = new FamilyGraph(PersonStore);

            //Daves Family
            familyGraph.AddRelationship("Thor", "Mary", "Parent");
            familyGraph.AddRelationship("Wonder", "Mary", "Parent");
            familyGraph.AddRelationship("Thor", "Hulk", "Parent");
            familyGraph.AddRelationship("Wonder", "Hulk", "Parent");

            familyGraph.AddRelationship("Thor1", "George", "Parent");
            familyGraph.AddRelationship("Wonder1", "George", "Parent");
            familyGraph.AddRelationship("Thor1", "Aunt", "Parent");
            familyGraph.AddRelationship("Wonder1", "Aunt", "Parent");

            familyGraph.AddRelationship("George", "Bob", "Parent");
            familyGraph.AddRelationship("Mary", "Bob", "Parent");
            familyGraph.AddRelationship("George", "Dave", "Parent");
            familyGraph.AddRelationship("Mary", "Dave", "Parent");
            familyGraph.AddRelationship("George", "Sally", "Parent");
            familyGraph.AddRelationship("Mary", "Sally", "Parent");


            //Spouse
            familyGraph.AddRelationship("Dave", "Amy", "Spouse");

            //Amy's Family
            familyGraph.AddRelationship("Brad", "Miller", "Parent");
            familyGraph.AddRelationship("Miley", "Miller", "Parent");
            familyGraph.AddRelationship("Brad", "ABig", "Parent");
            familyGraph.AddRelationship("Miley", "ABig", "Parent");
            familyGraph.AddRelationship("Brad", "BigB", "Parent");
            familyGraph.AddRelationship("Miley", "BigB", "Parent");
            familyGraph.AddRelationship("Brad", "Amy", "Parent");
            familyGraph.AddRelationship("Miley", "Amy", "Parent");
            familyGraph.AddRelationship("Brad", "Bamy", "Parent");
            familyGraph.AddRelationship("Miley", "Bamy", "Parent");

            relationships = new Relationships(familyGraph);
        }
예제 #6
0
    public ActionResult Image(int id)
    {
        var image = PersonStore.GetPersonImageById(id);

        return(BinaryResult(image.Content, image.MimeType));
    }
예제 #7
0
    public ActionResult Index()
    {
        var people = PersonStore.GetAllPeople();

        return(View(people));
    }
예제 #8
0
 public PersonService(DatabaseContext context, PersonStore store, IEventDispatcher eventDispatcher)
     : base(context, store, eventDispatcher)
 {
 }
 public void SetUp()
 {
     PersonStore.DELETE_ALL();
 }
예제 #10
0
 public void SetUp()
 {
     PersonStore.DELETE_ALL();
     new CreatePersonCommand("Boris", "Britian").Execute();
 }
예제 #11
0
 public PersonController()
 {
     _dbContext = ServiceLocator.Current.GetService <IDbContext>();
     _store     = new PersonStore(_dbContext, "Person", "Crm");
 }