Example #1
0
        public override void RefreshData()
        {
            base.RefreshData();

            List <Student> students = SimpleDBHelper.GetStudent(this.currentStudentQueryString);

            for (int i = 0; i < students.Count; i++)
            {
                if (students[i].photoPath.Trim() != string.Empty)
                {
                    try
                    {
                        Bitmap   bmp  = (Bitmap)Image.FromFile(students[i].photoPath);
                        Bitmap   temp = new Bitmap(bmp.Width, bmp.Height, bmp.PixelFormat);
                        Graphics g    = Graphics.FromImage(temp);
                        g.DrawImage(bmp, 0, 0);
                        students[i].photo = temp;

                        bmp.Dispose();
                    }
                    catch (Exception ex) {  }
                }
            }
            this.gridControl1.DataSource = students;

            this.gridControl1.RefreshDataSource();
        }
        public void CreateDomain_Should_Succeed()
        {
            var store = new ClientDetailsStore();
            AwsClientDetails clientDetails = store.Load(Container);

            SimpleDBHelper helper = new SimpleDBHelper(clientDetails);

            const string domainName = "TestDomain";

            helper.CreateDomain(domainName);
        }
        public void PutAttrubute_Should_Succeed()
        {
            var store = new ClientDetailsStore();
            AwsClientDetails clientDetails = store.Load(Container);

            SimpleDBHelper helper = new SimpleDBHelper(clientDetails);

            const string domainName = "TestDomain";
            const string itemName   = "TesItem";
            const string name       = "attributeName";
            const bool   replace    = true;
            string       value      = DateTime.Now.ToLongTimeString();

            helper.PutAttribute(domainName, itemName, name, replace, value);
        }
        public void DeleteAttributes_Should_Succeed()
        {
            var store = new ClientDetailsStore();
            AwsClientDetails clientDetails = store.Load(Container);

            SimpleDBHelper helper = new SimpleDBHelper(clientDetails);

            const string domainName    = "TestDomain";
            const string itemName      = "TesItem";
            const string attributeName = "attributeName";
            string       expectedValue = DateTime.Now.ToLongTimeString();

            // Ensure the domain exists and store the test item.
            helper.CreateDomain(domainName);
            helper.PutAttribute(domainName, itemName, attributeName, true, expectedValue);

            helper.DeleteAttributes(domainName, itemName, new [] { attributeName });
        }
        public void GetUnknownAttribute_Should_ReturnEmptyString()
        {
            var store = new ClientDetailsStore();
            AwsClientDetails clientDetails = store.Load(Container);

            SimpleDBHelper helper = new SimpleDBHelper(clientDetails);

            const string domainName    = "TestDomain";
            const string itemName      = "TesItem";
            const string attributeName = "UnknownAttributeThatDoesntExist";
            string       expectedValue = string.Empty;

            // Ensure the domain exists and store the test item.
            helper.CreateDomain(domainName);

            string actualValue = helper.GetAttribute(domainName, itemName, attributeName);

            Assert.AreEqual(expectedValue, actualValue);
        }
Example #6
0
        public Register()
        {
            InitializeComponent();


            this.RefreshNeeded = true;
            this.DisposeNeeded = false;

            tileView1.ItemClick += TileView1_ItemClick;;

            // bind class
            List <Class> classes = SimpleDBHelper.GetClass("");

            foreach (Class c in classes)
            {
                TileItem item = new TileItem();
                item.Text       = c.name;
                item.Tag        = c.id;
                item.ItemSize   = TileItemSize.Wide;
                item.ItemClick += Item_ItemClick;
                this.tileBarGroup2.Items.Add(item);
            }
        }