Exemple #1
0
 public void foodClick(ManagerList managerList)
 {
     StartCoroutine
     (
         managerList.FoodsList(FoodBought)
     );
 }
Exemple #2
0
        public void DeleteManager()
        {
            var     list    = new ManagerList();
            Manager manager = new Manager();

            manager.Name          = "LUO";
            manager.StreetAddress = "397 4th Ave S";
            manager.City          = "Saint Cloud";
            manager.State         = "MN";
            manager.ZipCode       = "56301";

            var newID = list.InsertManager(manager);

            Assert.IsTrue(null != newID, "Insert member Fail");

            var success = list.DeleteManager(newID.Value);

            Assert.IsTrue(success, "Delete Fail");

            //delete a manager who exists in the DB
            int managerID = 42;
            var result    = list.DeleteManager(managerID);

            Assert.IsFalse(result, "Failed to delete a manager who exists in the DB.");

            //delete a manager who does exist in the DB
            managerID = 0;
            result    = list.DeleteManager(managerID);
            Assert.IsFalse(result, "Failed to execute an operation of deleting a manager who does not exist in the DB");

            //delete a manager who does exist in the DB
            managerID = 100000;
            result    = list.DeleteManager(managerID);
            Assert.IsFalse(result, "Failed to execute an operation of deleting a manager who does not exist in the DB");
        }
Exemple #3
0
        private void btnManagers_Click(object sender, EventArgs e)
        {
            Hide();
            var managerListForm = new ManagerList();

            managerListForm.ShowDialog();
            Close();
        }
Exemple #4
0
        public ActionResult DeleteConfirmed(int id)
        {
            ManagerList managerList = db.ManagerLists.Find(id);

            db.ManagerLists.Remove(managerList);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #5
0
 public ActionResult Edit([Bind(Include = "ManagerListID,EmployeeID,GroupID")] ManagerList managerList)
 {
     if (ModelState.IsValid)
     {
         db.Entry(managerList).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ManagerListID = new SelectList(db.Assets, "AssetID", "AssetDescription", managerList.ManagerListID);
     ViewBag.EmployeeID    = new SelectList(db.Employees.Where(x => x.GroupID == 1), "EmployeeID", "FirstName", managerList.EmployeeID);
     ViewBag.GroupID       = new SelectList(db.Groups, "GroupID", "GroupName", managerList.GroupID);
     return(View(managerList));
 }
Exemple #6
0
        // GET: ManagerListsTable/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ManagerList managerList = db.ManagerLists.Find(id);

            if (managerList == null)
            {
                return(HttpNotFound());
            }
            return(View(managerList));
        }
Exemple #7
0
        // GET: ManagerListsTable/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ManagerList managerList = db.ManagerLists.Find(id);

            if (managerList == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ManagerListID = new SelectList(db.Assets, "AssetID", "AssetDescription", managerList.ManagerListID);
            ViewBag.EmployeeID    = new SelectList(db.Employees.Where(x => x.GroupID == 1), "EmployeeID", "FirstName", managerList.EmployeeID);
            ViewBag.GroupID       = new SelectList(db.Groups, "GroupID", "GroupName", managerList.GroupID);
            return(View(managerList));
        }
Exemple #8
0
        public void InsertManager()
        {
            var list = new ManagerList();

            //complete data
            var manager = new Manager();

            manager.Name          = "manager02";
            manager.StreetAddress = "124 77th Ave S";
            manager.State         = "MN";
            manager.City          = "Saint Cloud";
            manager.ZipCode       = "12345";

            var newManagerId = list.InsertManager(manager);

            //fields are null
            manager      = new Manager();
            newManagerId = list.InsertManager(manager);
            Assert.IsFalse(null != newManagerId, "feilds are null.");

            //object is null
            newManagerId = list.InsertManager(null);
            Assert.IsFalse(null != newManagerId, "adding a null object.");

            //boundary data
            manager               = new Manager();
            manager.Name          = "";
            manager.StreetAddress = "";
            manager.State         = "";
            manager.City          = "";
            manager.ZipCode       = "";
            newManagerId          = list.InsertManager(manager);
            Assert.IsFalse(null != newManagerId, "all field are empty.");

            //add a manager who does exists in the DB
            manager               = new Manager();
            manager.Name          = "manager01";
            manager.StreetAddress = "123 77th Ave S";
            manager.State         = "MN";
            manager.City          = "Saint Cloud";
            manager.ZipCode       = "56301";
            newManagerId          = list.InsertManager(manager);
            Assert.IsFalse(null != newManagerId, "failed to execute an operation of adding a manager who does exist in the DB.");
            Assert.IsFalse(null != newManagerId, "insert manager failed.");
        }
Exemple #9
0
        public void GetManager()
        {
            var list = new ManagerList();

            //search a manager who exists in the DB
            int managerID = 29;
            var result    = list.GetManager(managerID);

            Assert.IsNotNull(result, "The manager should exist in the DB.");

            //search a manager who does not exist in the DB
            managerID = 0;
            result    = list.GetManager(managerID);
            Assert.IsNull(result, "The manager ID does not exist in the DB.");

            //search a manager who does not exist in the DB
            managerID = 1000000;
            result    = list.GetManager(managerID);
            Assert.IsNull(result, "The manager ID does not exist in the DB.");
        }
Exemple #10
0
        public void UpdateManager()
        {
            var    list          = new ManagerList();
            int    managerID     = 46;
            string name          = "manager02";
            string streetAddress = "999 9th Ave S";
            string city          = "Saint Cloud";
            string state         = "MN";
            string ZIPcode       = "56399";

            var result = list.UpdateManager(name, managerID, streetAddress,
                                            city, state, ZIPcode);

            Assert.IsNotNull(result, "Failed to update the manager, and the manager may exist in the DB.");

            //fields are null
            result = list.UpdateManager(null, 0, null, null, null, null);
            Assert.IsNull(result, "Failed to execute updating where fields are null.");


            //fields are empty
            result = list.UpdateManager("", 0, "", "", "", "");
            Assert.IsNull(result, "Failed to execute updating where fields are empty.");

            //A manager does not exist in the DB
            managerID     = 0;
            name          = "manager02";
            streetAddress = "999 9th Ave S";
            city          = "Saint Cloud";
            state         = "MN";
            ZIPcode       = "56399";

            result = list.UpdateManager(name, managerID, streetAddress,
                                        city, state, ZIPcode);
            Assert.IsNull(result, "Failed to execute updating the manager, and the manager may not exist in the DB.");
        }
 private void vlButtonManage_Click(object sender, EventArgs e)
 {
     Button button = (Button)sender;
     ManagerInstance formInstance;
     ManagerList formList;
     ManagerDictionary formDictionary;
     MetaInstanceVariable metaInstanceVariable;
     switch (this.value.Type.CategoryType)
     {
         case ECategoryType.Integral:
             // can't happen
             break;
         case ECategoryType.Enum:
             // can't happen (for now)
             break;
         case ECategoryType.Class:
             for (int i = 0; i < this.value.Instance.InstanceVariables.Count; i++)
             {
                 metaInstanceVariable = this.value.Instance.InstanceVariables[i];
                 if (button.Name == metaInstanceVariable.ToString())
                 {
                     MetaValue value = metaInstanceVariable.Value;
                     switch (value.Type.CategoryType)
                     {
                         case ECategoryType.Integral:
                             // can't happen
                             break;
                         case ECategoryType.Class:
                             formInstance = new ManagerInstance(this.repository, value.Type, value, metaInstanceVariable.Variable.Nullable);
                             formInstance.Text = metaInstanceVariable.ToString();
                             formInstance.ShowDialog();
                             metaInstanceVariable.Value = formInstance.Value;
                             break;
                         case ECategoryType.List:
                             formList = new ManagerList(this.repository, value.Type.SubType1, value.List);
                             formList.Text = metaInstanceVariable.ToString();
                             formList.ShowDialog();
                             value.List = formList.ListValues;
                             break;
                         case ECategoryType.Dictionary:
                             formDictionary = new ManagerDictionary(this.repository, value.Type.SubType1, value.Type.SubType2, value.Dictionary);
                             formDictionary.Text = metaInstanceVariable.ToString();
                             formDictionary.ShowDialog();
                             value.Dictionary = formDictionary.DictionaryValues;
                             break;
                     }
                     this.RefreshData();
                     break;
                 }
             }
             break;
         case ECategoryType.List:
             formList = new ManagerList(this.repository, this.value.Type.SubType1, this.value.List);
             formList.Text = this.value.Type.GetNameWithModule();
             formList.ShowDialog();
             this.value.List = formList.ListValues;
             break;
         case ECategoryType.Dictionary:
             formList = new ManagerList(this.repository, this.value.Type.SubType1, this.value.List);
             formList.Text = this.value.Type.GetNameWithModule();
             formList.ShowDialog();
             this.value.List = formList.ListValues;
             break;
     }
 }
        private void vlButtonManage_Click(object sender, EventArgs e)
        {
            Button               button = (Button)sender;
            ManagerInstance      formInstance;
            ManagerList          formList;
            ManagerDictionary    formDictionary;
            MetaInstanceVariable metaInstanceVariable;

            switch (this.value.Type.CategoryType)
            {
            case ECategoryType.Integral:
                // can't happen
                break;

            case ECategoryType.Enum:
                // can't happen (for now)
                break;

            case ECategoryType.Class:
                for (int i = 0; i < this.value.Instance.InstanceVariables.Count; i++)
                {
                    metaInstanceVariable = this.value.Instance.InstanceVariables[i];
                    if (button.Name == metaInstanceVariable.ToString())
                    {
                        MetaValue value = metaInstanceVariable.Value;
                        switch (value.Type.CategoryType)
                        {
                        case ECategoryType.Integral:
                            // can't happen
                            break;

                        case ECategoryType.Class:
                            formInstance      = new ManagerInstance(this.repository, value.Type, value, metaInstanceVariable.Variable.Nullable);
                            formInstance.Text = metaInstanceVariable.ToString();
                            formInstance.ShowDialog();
                            metaInstanceVariable.Value = formInstance.Value;
                            break;

                        case ECategoryType.List:
                            formList      = new ManagerList(this.repository, value.Type.SubType1, value.List);
                            formList.Text = metaInstanceVariable.ToString();
                            formList.ShowDialog();
                            value.List = formList.ListValues;
                            break;

                        case ECategoryType.Dictionary:
                            formDictionary      = new ManagerDictionary(this.repository, value.Type.SubType1, value.Type.SubType2, value.Dictionary);
                            formDictionary.Text = metaInstanceVariable.ToString();
                            formDictionary.ShowDialog();
                            value.Dictionary = formDictionary.DictionaryValues;
                            break;
                        }
                        this.RefreshData();
                        break;
                    }
                }
                break;

            case ECategoryType.List:
                formList      = new ManagerList(this.repository, this.value.Type.SubType1, this.value.List);
                formList.Text = this.value.Type.GetNameWithModule();
                formList.ShowDialog();
                this.value.List = formList.ListValues;
                break;

            case ECategoryType.Dictionary:
                formList      = new ManagerList(this.repository, this.value.Type.SubType1, this.value.List);
                formList.Text = this.value.Type.GetNameWithModule();
                formList.ShowDialog();
                this.value.List = formList.ListValues;
                break;
            }
        }
Exemple #13
0
    private void DataListBind()
    {
        string type = GetMemberType();
        int    year = GetYear();
        string name = GetName();

        DAL.DMember list = new DAL.DMember();
        if (type.Equals(""))
        {
            ManagerList.DataSource = list.GetMemberByManyInfo("", "主管", name, year);
            ManagerList.DataBind();
            AndroiderList.DataSource = list.GetMemberByManyInfo(type + "%Android", "", name, year);
            AndroiderList.DataBind();
            ASPNETerList.DataSource = list.GetMemberByManyInfo(type + "%.NET", "", name, year);
            ASPNETerList.DataBind();
            PHPerList.DataSource = list.GetMemberByManyInfo(type + "%PHP", "", name, year);
            PHPerList.DataBind();
            JavaerList.DataSource = list.GetMemberByManyInfo(type + "%JAVA", "", name, year);
            JavaerList.DataBind();
            PSerList.DataSource = list.GetMemberByManyInfo(type + "%美工", "", name, year);
            PSerList.DataBind();
            UIerList.DataSource = list.GetMemberByManyInfo(type + "%UI", "", name, year);
            UIerList.DataBind();
            TesterList.DataSource = list.GetMemberByManyInfo("测试", "", name, year);
            TesterList.DataBind();
        }
        if (type.Contains("主管"))
        {
            ManagerList.DataSource = list.GetMemberByManyInfo("", "主管", name, year);
            ManagerList.DataBind();
            AndroiderList.DataSource = null;
            AndroiderList.DataBind();
            ASPNETerList.DataSource = null;
            ASPNETerList.DataBind();
            PHPerList.DataSource = null;
            PHPerList.DataBind();
            JavaerList.DataSource = null;
            JavaerList.DataBind();
            PSerList.DataSource = null;
            PSerList.DataBind();
            UIerList.DataSource = null;
            UIerList.DataBind();
            TesterList.DataSource = null;
            TesterList.DataBind();
        }
        if (type.Contains("开发"))
        {
            ManagerList.DataSource = null;
            ManagerList.DataBind();
            AndroiderList.DataSource = list.GetMemberByManyInfo(type + "%Android", "", name, year);
            AndroiderList.DataBind();
            ASPNETerList.DataSource = list.GetMemberByManyInfo(type + "%.NET", "", name, year);
            ASPNETerList.DataBind();
            PHPerList.DataSource = list.GetMemberByManyInfo(type + "%PHP", "", name, year);
            PHPerList.DataBind();
            JavaerList.DataSource = list.GetMemberByManyInfo(type + "%JAVA", "", name, year);
            JavaerList.DataBind();
            PSerList.DataSource = null;
            PSerList.DataBind();
            UIerList.DataSource = null;
            UIerList.DataBind();
            TesterList.DataSource = null;
            TesterList.DataBind();
        }
        if (type.Contains("特效"))
        {
            ManagerList.DataSource = null;
            ManagerList.DataBind();
            AndroiderList.DataSource = null;
            AndroiderList.DataBind();
            ASPNETerList.DataSource = null;
            ASPNETerList.DataBind();
            PHPerList.DataSource = null;
            PHPerList.DataBind();
            JavaerList.DataSource = null;
            JavaerList.DataBind();
            PSerList.DataSource = list.GetMemberByManyInfo(type + "%美工", "", name, year);
            PSerList.DataBind();
            UIerList.DataSource = list.GetMemberByManyInfo(type + "%UI", "", name, year);
            UIerList.DataBind();
            TesterList.DataSource = list.GetMemberByManyInfo("测试", "", name, year);
            TesterList.DataBind();
        }
        if (type.Contains("测试"))
        {
            ManagerList.DataSource = null;
            ManagerList.DataBind();
            AndroiderList.DataSource = null;
            AndroiderList.DataBind();
            ASPNETerList.DataSource = null;
            ASPNETerList.DataBind();
            PHPerList.DataSource = null;
            PHPerList.DataBind();
            JavaerList.DataSource = null;
            JavaerList.DataBind();
            PSerList.DataSource = null;
            PSerList.DataBind();
            UIerList.DataSource = null;
            UIerList.DataBind();
            TesterList.DataSource = list.GetMemberByManyInfo("测试", "", name, year);
            TesterList.DataBind();
        }
    }