private void CreateCheckBox(CheckGroup checkGroup, string propertyName, bool autoUpdate = false) { var property = GetType().GetProperty(propertyName, BindingFlags.NonPublic | BindingFlags.Instance); var getValue = new Func <bool>(() => (bool)property.GetValue(this)); var toggle = new Action(() => property.SetValue(this, !getValue())); CreateCheckBox(checkGroup, getValue, toggle, autoUpdate); }
public bool SquaresAreValid() { foreach (Group CheckGroup in Squares()) { if (!CheckGroup.IsValid()) { return(false); } } return(true); }
public bool ColumnsAreValid() { foreach (Group CheckGroup in Columns()) { if (!CheckGroup.IsValid()) { return(false); } } return(true); }
public bool SquaresAreComplete() { foreach (Group CheckGroup in Squares()) { if (!CheckGroup.IsComplete()) { return(false); } } return(true); }
public bool ColumnsAreComplete() { foreach (Group CheckGroup in Columns()) { if (!CheckGroup.IsComplete()) { return(false); } } return(true); }
public ActionResult Prof_CheckGroupEditor(CheckGroup Obj) //评审组编辑信息提交以后 { rsklldb.OpenConnection(); //更新数据项 string sql3 = "delete from [CheckGroup] where CheckGroupName = '" + Obj.CheckGroupName + "'"; rsklldb.InsertData(sql3); string sql = "insert into [CheckGroup](CheckGroupID,CheckAdminTeaID,CheckGroupName) values('" + Obj.CheckGroupID + "','" + Obj.CheckAdminTeaID + "','" + Obj.CheckGroupName + "')"; rsklldb.InsertData(sql); string sql2 = "select * from [CheckGroup]"; List <CheckGroup> list1 = rsklldb.Detail <CheckGroup>(sql2); @ViewBag.ck = list1; return(View("Prof_CreateCheckGroup")); }
public ActionResult Prof_InsertCheckGroup(string ID) //评审组编辑信息提交之前 { rsklldb.OpenConnection(); string sql = "select * from [CheckGroup] where CheckGroupName like '%" + ID + "%'"; List <CheckGroup> list = rsklldb.Detail <CheckGroup>(sql); @ViewData["CheckGroupName"] = list[0].CheckGroupName; @ViewData["CheckGroupID"] = list[0].CheckGroupID; @ViewData["CheckAdminTeaID"] = list[0].CheckAdminTeaID; CGObj = list[0]; string sql1 = "select * from [Teacher]"; List <Teacher> list1 = rsklldb.Detail <Teacher>(sql1); @ViewBag.tea = list1; return(View("Prof_CheckGroupEditor")); }
public ActionResult TeaStuTopicPass(string topicid, string topicname, string teacherid, string studentid, int pass) { rsklldb.OpenConnection(); string sql1 = "UPDATE [TopicState] SET [StuIsPassed] = " + pass + "WHERE StudentID ='" + studentid + "'"; rsklldb.InsertData(sql1); if (pass == 1) { string sql2 = "SELECT * FROM CheckGroup WHERE CheckGroupName = '" + topicname + "'"; CheckGroup cg = rsklldb.Detail <CheckGroup>(sql2)[0]; string sql3 = "UPDATE [Student] SET [TeaID] = '" + teacherid + "',TopicID = '" + topicid + "',GroupID= '" + cg.CheckGroupID + "',CheckGroupID = '" + cg.CheckGroupID + "' WHERE UserID = '" + studentid + "'"; rsklldb.InsertData(sql3); } rsklldb.CloseConnection(); return(TeaStuTopicState()); }
public List <string> FindErrors(CheckGroup checkGroup, IEnumerable <GroupDto> groups) { List <string> errors = new(); if (groups.SingleOrDefault(g => g.Name == checkGroup.Name) is not null) { errors.Add("Group with such name already exists"); } if (!checkGroup.StudentIds.Contains(checkGroup.HeadManId)) { errors.Add("Students list must contain a headman as well"); } return(errors); }
private static void CreateCheckBox(CheckGroup checkGroup, Func <bool> getValue, Action toggleValue, bool autoUpdate = false) { var check = checkGroup._Check; RunConditionalAnimation(getValue, check.RunAnimationChecked, check.RunAnimationUnchecked); checkGroup._BtnCheck.It.Clicked = () => { toggleValue?.Invoke(); RunConditionalAnimation(getValue, check.RunAnimationCheck, check.RunAnimationUncheck); }; if (autoUpdate) { checkGroup.It.Updating += delta => { if (check.It.IsStopped) { RunConditionalAnimation(getValue, check.RunAnimationChecked, check.RunAnimationUnchecked); } }; } }
private List<CheckGroup> GetSubGroupList(string strFatherItemValue) { List<CheckGroup> list = new List<CheckGroup>(); foreach (CCheckItem objCheckItem in CheckItems) { if (objCheckItem.FatherItemValue == strFatherItemValue && objCheckItem.ItemType == ItemType.组) { CheckGroup objCheckGroup = new CheckGroup(objCheckItem.Text, objCheckItem.Value); if (!list.Contains(objCheckGroup)) { list.Add(objCheckGroup); } } } return list; }