public void setGroup(GroupTable group) { model = group; if (model != null) { this.BeginInvoke(new EventHandler((s, e) => { if (!string.IsNullOrEmpty(model.avatar)) { DCWebImageMaanager.shard.downloadImageAsync(model.avatar, (imagePath, b) => { if (imagePath != null) { avatarPictureBox.BeginInvoke(() => { avatarPictureBox.Image = imagePath; }); } }); } nameLabel.Text = model.groupName; nameLabel.Size = TextRenderer.MeasureText(nameLabel.Text, nameLabel.Font); avatarPictureBox.Location = new Point((Width - avatarPictureBox.Width) / 2, 60); nameLabel.Location = new Point((Width - nameLabel.Width) / 2, 170); sendMessageButton.Location = new Point((Width - sendMessageButton.Width) / 2, 230); })); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (group == null) { group = (GroupTable)RowData; } if (group != null) { DCWebImageMaanager.shard.downloadImageAsync(group.avatar, (imagePath, b) => { Image image = imagePath; if (image != null) { headPictureBox.BeginInvoke(() => { headPictureBox.Image = image; }); } }); this.BeginInvoke(() => { nameLabel.Text = group.groupName; this.Invalidate(); }); } }
/// <summary> /// Populate group grid with paging. /// </summary> private void FillGroupGrid() { int totalRecords = 0; int fetchedRecords = _pageSize * GroupTable.PageIndex; GroupTable.PageSize = _pageSize; List <Group> groupList = new List <Group>(); using (ZentityContext context = Utility.CreateContext()) { IEnumerable <Group> groups = UserManager.GetAllGroups(context).OrderBy(tuple => tuple.GroupName); totalRecords = groups.Count(); UpdatePageCount(GroupTable, totalRecords); if (totalRecords > 0) { int lastPage = GroupTable.PageCount - 1; if (GroupTable.PageIndex > lastPage) { // If requested page is not found, show last page. GroupTable.PageIndex = lastPage; fetchedRecords = _pageSize * GroupTable.PageIndex; } groupList = context.Resources.OfType <Group>().OrderBy(tuple => tuple.GroupName).Skip(fetchedRecords).Take(_pageSize).ToList(); } } if (groupList.Count > 0) { Utility.UpdateResourcesEmptyTitle(groupList); GroupTable.DataSource = groupList; GroupTable.DataBind(); } }
public static GroupTable ReadGroupDto(string filePath) { FileInfo fileInfo = new FileInfo(filePath); using (ExcelPackage package = new ExcelPackage(fileInfo)) { ExcelWorksheet excelWorksheet = package.Workbook.Worksheets.First(); if (excelWorksheet == null) { return(null); } List <AccountDto> accountDtos = excelWorksheet.Extract <AccountDto>().WithProperty(p => p.Email, "C") .GetData(8, i => !string.IsNullOrEmpty(excelWorksheet.Cells[i, 3].Text)).ToList(); string groupName = excelWorksheet.Cells[5, 1].Text; groupName = groupName. Split(':') .First(g => g.Contains("anul")) .Split(',') .First().Trim(); GroupTable groupTable = new GroupTable(groupName); int id = 0; accountDtos.ForEach(account => groupTable.AddStudent(new StudentDto(account))); //groupTable.GroupDto = new GroupDto(-1,); return(groupTable); } }
void RefreshGroupTable() { PreviousGroupTypeOrder = null; GroupTable.ClearGrid(); PopulateGroupTable(MyGroupTypeOrder); DisableAllowDropByNewLineItem(); }
void DisableAllowDropByNewLineItem() { int row = 1; while (row < GroupTable.RowDefinitions.Count) { List <ItemTypeOrder> itemTypeList = GetItemsByRow(row); bool found = false; int i = 0; while (i < itemTypeList.Count && !found) { if (itemTypeList[i].DesignID != null && itemTypeList[i].DesignID.Equals("198")) { found = true; i++; // To make sure that AllowDrop is disabled for the rest of the items } else { i++; } } while (i < GroupTable.ColumnDefinitions.Count && found) { Border borderCell = (Border)GroupTable.GetCellChild(row, i); borderCell.AllowDrop = false; i++; } row++; } }
public GroupTable ReadGroups(string path) { GroupTable groupTable = ExcelReader.ReadGroupDto(path); return(groupTable); //roupTable.StudentDtos.ForEach(student=>); }
public frmAddDesign() { InitializeComponent(); ManufacturerTable ma = new ManufacturerTable(); GroupTable gr = new GroupTable(); Suport.FillCombox(cmbGroup, gr.GetTable(), "describeGroup", "coudeGroup"); Suport.FillCombox(cmbManufactore, ma.GetTable(), "nameManufacturer", "coudeManufacturer"); }
/// <inheritdoc cref="ISessionResultReport.GetReport(int)"/> public SessionResultReportView GetReport(int sessionId) { return(new SessionResultReportView { GroupTables = GroupTable.GetGroupTableData(sessionId), SpecialtyAssessmetsTable = SpecialtyAssessmetsTable.GetSpecialtyAssessmetsTableData(sessionId), ExaminersTable = ExaminersTable.GetExaminersTableData(sessionId) }); }
/// <inheritdoc cref="ISessionResultReport.GetReport(int, Func{GroupTableRowView, object}, bool)"/> public SessionResultReportView GetReport(int sessionId, Func <GroupTableRowView, object> predicate, bool isDescOrder) { return(new SessionResultReportView { GroupTables = GroupTable.GetGroupTableData(sessionId, predicate, isDescOrder), SpecialtyAssessmetsTable = SpecialtyAssessmetsTable.GetSpecialtyAssessmetsTableData(sessionId), ExaminersTable = ExaminersTable.GetExaminersTableData(sessionId) }); }
void EnableAllowDropNewLine(int startColumnPosition, int row) { int i = startColumnPosition; while (i < GroupTable.ColumnDefinitions.Count) { Border borderCell = (Border)GroupTable.GetCellChild(row, i); borderCell.AllowDrop = true; i++; } }
public ActionResult UploadGroupTable(HttpPostedFileBase file) { string fileName = Path.GetFileName(file.FileName); string path = Path.Combine(Server.MapPath("~/App_Data/"), fileName); file.SaveAs(path); GroupTable groupTable = _studentsPopManager.ReadGroups(path); _studentsPopManager.AddGroups(groupTable); return(RedirectToAction("Index", "Home")); }
public void GroupTable_Repository_Create() { GroupTable groupTable = new GroupTable(); groupTable.Name = "test-name"; groupTable.Description = "test-description"; groupTable.IsDelete = false; var rs = objRepository.Add(groupTable); unitOfWork.Commit(); Assert.IsNotNull(rs); Assert.Equals(1, rs.ID); }
public MainForm() { InitializeComponent(); classTableWorker = new WorkerTable(GridViewWorker); classTableService = new ServiceTable(GridViewService); classTableCustomer = new CustomerTable(GridViewСustomers); groupTable = new GroupTable(GridViewGroups); visitTable = new VisitTable(GridViewVisitGroup); timetable = new TimetableTable(GridViewTimeTable); recordGroup = new RecordGroupTable(GridViewRecordGroups); timetable.DateDay = SelectDate.Value; timetable.Room = cbRoom.Text; }
public void MakeFullGroupTable() { var exp = SqlExpression.Function(new ObjectName("count"), new InvokeArgument(SqlExpression.Reference(ObjectName.Parse("tab1.a")))); var cols = new[] { new FunctionColumnInfo(exp, "exp1", PrimitiveTypes.Integer()) }; var table = new GroupTable(context, left, cols, new ObjectName[0]); Assert.Equal(2, table.RowCount); }
public List <GroupTable> GetListGroupTable() { List <GroupTable> groups = new List <GroupTable>(); DataTable data = DataProvider.Instance.ExecuteQuery("SELECT * FROM GroupTable"); foreach (DataRow row in data.Rows) { GroupTable group = new GroupTable(row); groups.Add(group); } return(groups); }
public ActionResult Get() { Object result = GroupTable.getAllGroups(); if (result.GetType() == typeof(List <Student>)) { return(Ok(result)); } else { return(NotFound(result)); } }
public void AddGroups(GroupTable groupTable) { groupTable.GroupDto.Id = _populateRepository.GetGroupByName(groupTable.GroupDto.Name).Id; if (groupTable.GroupDto.Id == -1) { groupTable.GroupDto.Id = _populateRepository.AddGroup(groupTable.GroupDto); } groupTable.StudentDtos.ForEach(student => { student.Account.Id = _populateRepository.AddAccount(student.Account); _populateRepository.AddStudent(student); }); }
public ActionResult Get(int id) { Object result = GroupTable.getGroupForId(id); Group group = result as Group; if (null != group) { return(Ok(result)); } else { return(NotFound(result)); } }
public GroupInfoForm(GroupTable table) { GC.AddMemoryPressure(100 * 1024); model = table; rightIndex = -1; InitializeComponent(); if (model != null) { ThreadPool.QueueUserWorkItem((o) => { var dbGroupMembers = DBHelper.Instance.getGroupAllUser(model.groupId); for (int i = 0; i < dbGroupMembers.Count; i++) { if (dbGroupMembers[i].is_manager == 1) { var data = dbGroupMembers[i]; dbGroupMembers.RemoveAt(i); dbGroupMembers.Insert(0, data); } } for (int i = 0; i < dbGroupMembers.Count; i++) { if (dbGroupMembers[i].is_administrator == 1) { var data = dbGroupMembers[i]; dbGroupMembers.RemoveAt(i); dbGroupMembers.Insert(0, data); break; } } duiGridList1.BeginInvoke(() => { this.menbers = new List <GroupMemberViewModel>(); foreach (GroupUser item in dbGroupMembers) { this.menbers.Add(new GroupMemberViewModel(item)); } if (duiGridList1.Loaded) { loadData(); } }); }); ThreadPool.QueueUserWorkItem((o) => { refreshGroupMember(); }); } }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } GroupTable = await _context.GroupTable.FirstOrDefaultAsync(m => m.ID == id); if (GroupTable == null) { return(NotFound()); } return(Page()); }
private IEnumerable<string> GetRow(IEnumerable<VariableDescription> variables, GroupTable table) { foreach (var variableDescription in variables) { yield return variableDescription.TargetValue; } yield return table.Variable1Value; yield return table.Variable1Count; yield return table.Variable2Value; yield return table.Variable2Count; yield return table.SigValue; }
public void GroupTable_Service_Create() { GroupTable groupTable = new GroupTable(); groupTable.Name = "test-name"; groupTable.IsDelete = true; _mockRepository.Setup(m => m.Add(groupTable)).Returns((GroupTable g) => { g.ID = 1; return(g); }); var rs = _groupService.Add(groupTable); Assert.IsNotNull(rs); Assert.AreEqual(1, rs.ID); }
public ActionResult Add(GroupTable groupTable) { groupTable.ShopID = 1; groupTableService.Add(groupTable); groupTableService.Save(); var result = new { ID = groupTable.ID, Name = groupTable.Name, Surcharge = groupTable.Surcharge, TableCount = groupTable.Table.Count, Description = groupTable.Description }; return(Json(result, JsonRequestBehavior.AllowGet)); }
private List <ItemTypeOrder> GetItemsByRow(int row) { List <UIElement> uieList = GroupTable.GetGridCellChildrenByRow(row); List <ItemTypeOrder> itemTypeListCheck = new List <ItemTypeOrder>(); foreach (UIElement uie in uieList) { if (uie is Border) { Border bCell = (Border)uie; ItemTypeOrder it = (ItemTypeOrder)bCell.DataContext; itemTypeListCheck.Add(it); } } return(itemTypeListCheck); }
public GroupAdd() { InitializeComponent(); arrControl = new Control[3][]; arrControl[0] = new Control[0]; arrControl[1] = new Control[0]; arrControl[2] = new Control[0]; controls = new Control[] { tbNumberGroup, cbWorker, cbService, tbMaxPeople, tbRoom }; groupTable = new GroupTable(); cbService.TextChanged += ClearTime; tbRoom.TextChanged += ClearTime; DateFinish.TextChanged += ClearTime; }
private IEnumerable<string> GetHeaders( IEnumerable<string> variables, GroupTable mainTable) { foreach (var variable in variables) { yield return variable; } yield return mainTable.Variable1Name + " Correlation"; yield return mainTable.Variable1Name + " #"; yield return mainTable.Variable2Name + " Correlation"; yield return mainTable.Variable2Name + " #"; yield return " Sig. (2-tailed)"; }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } GroupTable = await _context.GroupTable.FindAsync(id); if (GroupTable != null) { _context.GroupTable.Remove(GroupTable); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
/// <summary></summary> public CQApiClient( Callers.ICaller caller, Listeners.IListener listener, bool use_group_table = false, bool use_message_table = false ) { this.caller = caller; this.listener = listener; if (use_group_table) { this.group_table = new GroupTable(); } if (use_message_table) { this.message_table = new MessageTable(); } }
public string UpdateGroupTable(int ID, string Name, string Description, long Surcharge) { GroupTable newGroupTable = new GroupTable(); newGroupTable.ID = ID; newGroupTable.Name = Name; newGroupTable.Description = Description; newGroupTable.Surcharge = Surcharge; if (groupTableService.ValidateGroupTableInfo(newGroupTable) == true) { if (groupTableService.UpdateGroupTable(newGroupTable) == true) { result = Status.Success.ToString(); } } return(result); }
public JsonResult AddGroupTable(string Name, string Description, long Surcharge) { GroupTable newGroupTable = new GroupTable(); newGroupTable.Name = Name; newGroupTable.Description = Description; newGroupTable.Surcharge = Surcharge; if (groupTableService.ValidateGroupTableInfo(newGroupTable) == true) { if (groupTableService.AddGroupTable(newGroupTable) == true) { result = Status.Success.ToString(); } } return(Json(new { Result = result, ID = newGroupTable.ID }, JsonRequestBehavior.AllowGet)); }
void InitialisePermissions() { _groups = new GroupTable(); _nodes = new PermissionTable(); _userPerms = new UserPermissions(); _groupPerms = new GroupPermissions(); _users = new UserGroupsTable(); _nodes.Initialise(this); _userPerms.Initialise(this); _groupPerms.Initialise(this); _users.Initialise(this); //Used to create default permissions _groups.Initialise(this); //Initialise procedures Procedures.Init(this); }