private void Awake() { selectItem = this.transform.GetComponent <LuaSelectItem>(); if (luafun_UILoopItem_Set == null) { luaEnv = LuaManager.GetInstance().LuaEnvGetOrNew(); if (functionName == null && functionName.Equals("")) { luafun_UILoopItem_Set = luaEnv.Global.GetInPath <UILoopItem_Set>("UILoopItem_Set"); } else { luafun_UILoopItem_Set = luaEnv.Global.GetInPath <UILoopItem_Set>(functionName); } } if (isAutoListener) { Button[] btns = this.transform.GetComponentsInChildren <Button>(); SelectGroup group = this.transform.parent.GetComponent <SelectGroup>(); group.AddItem(selectItem); foreach (Button btn in btns) { btn.onClick.AddListener(() => { group.SelectByIndex(selectItem.index); }); } } UILoopItem_Set luafun_UILoopItem_Awake = luaEnv.Global.GetInPath <UILoopItem_Set>(awakefunctionName); if (luafun_UILoopItem_Awake != null) { luafun_UILoopItem_Awake(itemIndex, transform, GetData()); } }
private void OnSelectExtentsExecute() { var selectGroup = new SelectGroup(Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager.MdiActiveDocument); var ext = selectGroup.Select(); SelectedExtents = ext; }
public ContentResult GetAllGroups() { var groups = SelectGroup.SelectAll(); return(new ContentResult { Content = JsonSerializer.Serialize(groups), ContentType = "application/json", StatusCode = (int)HttpStatusCode.OK }); }
public ContentResult GetGroups() { // select groups unused in schedule var groups = SelectGroup.SelectAvailable(); return(new ContentResult { Content = JsonSerializer.Serialize(groups), ContentType = "application/json", StatusCode = (int)HttpStatusCode.OK }); }
//会员组等下拉框绑定 private void DPBind() { DataTable dt = groupBll.GetGroupList(); UserGroup_DP.DataSource = dt; UserGroup_DP.DataBind(); SelectGroup.DataSource = dt;//数据绑定 SelectGroup.DataBind(); this.SelectGroup.Items.Insert(0, new ListItem("选择等级", "0")); ddlGroup.DataSource = dt; ddlGroup.DataBind(); }
//会员组等下拉框绑定 private void DPBind() { DataTable dt = groupBll.GetGroupList(); UserGroup_DP.DataSource = dt; UserGroup_DP.DataBind(); SelectGroup.DataSource = dt;//数据绑定 SelectGroup.DataBind(); SelectGroup.Items.Insert(0, new ListItem(Resources.L.择等级, "0")); ddlGroup_DP.DataSource = dt; ddlGroup_DP.DataBind(); ddlGroup_DP.Items.Insert(0, new ListItem(Resources.L.全部会员, "0")); }
/// <summary> /// 获取周计划时间 /// </summary> /// <returns></returns> public async Task <List <SelectGroup> > GetWeekOfMonthAsync(Guid id) { DateTime startMonth = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); //该月第一天 DateTime startWeek; int dayOfWeek = Convert.ToInt32(startMonth.DayOfWeek.ToString("d")); if (Convert.ToInt32(startMonth.DayOfWeek.ToString("d")) > 1) { startWeek = startMonth.AddDays(8 - dayOfWeek); //该月第一周开始日期 } else if (Convert.ToInt32(startMonth.DayOfWeek.ToString("d")) == 0) { startWeek = startMonth.AddDays(1); //该月第一周开始日期 } else { startWeek = startMonth; //该月第一周开始日期 } List <SelectGroup> list = new List <SelectGroup>(); for (int i = 0; i < 4; i++) { SelectGroup item = new SelectGroup(); DateTime startDayOfWeeks = startWeek.AddDays(i * 7); //index周的起始日期 DateTime endDayOfWeeks = startWeek.AddDays((i * 7) + 6); //index周的结束日期 item.text = DateTime.Now.Month + "月第" + (i + 1) + "周(" + startDayOfWeeks.ToString("D") + " - " + endDayOfWeeks.ToString("D") + ")"; item.value = string.Format($"{startDayOfWeeks.ToString("yyyy-MM-dd")},{endDayOfWeeks.ToString("yyyy-MM-dd")}"); list.Add(item); } string emptyId = "{00000000-0000-0000-0000-000000000000}"; if (id != new Guid(emptyId)) { var entity = await _scheduleRepository.GetAll().Where(v => v.Id == id).FirstOrDefaultAsync(); if (entity.Type == ScheduleType.每周) { if (DateTime.Now.Year != entity.BeginTime.Value.Year || DateTime.Now.Month != entity.BeginTime.Value.Month) { { SelectGroup item = new SelectGroup(); item.text = entity.BeginTime.Value.ToString("D") + " - " + entity.EndTime.Value.ToString("D"); item.value = string.Format($"{entity.BeginTime.Value.ToString("yyyy-MM-dd")},{entity.EndTime.Value.ToString("yyyy-MM-dd")}"); list.Add(item); } } } } return(list); }
protected void GetElementFromForm(XmlElement ele, string elementGroup) { elementGroup = (elementGroup == null ? "" : elementGroup); Dictionary <string, ControlNodeData> dicElementBindControl = _dicElementBindGroup[elementGroup]; foreach (KeyValuePair <string, ControlNodeData> keyvalue in dicElementBindControl) { if (keyvalue.Value.Control is CheckBox) { SetValueToElement(ele, keyvalue.Key, keyvalue.Value.Type, ((CheckBox)keyvalue.Value.Control).Checked.ToString()); } else if (keyvalue.Value.Control is ListControl) { SetValueToElement(ele, keyvalue.Key, keyvalue.Value.Type, ((ListControl)keyvalue.Value.Control).SelectedValue.ToString()); } else if (keyvalue.Value.Control is SelectGroup) { SelectGroup selectGroup = (SelectGroup)keyvalue.Value.Control; ///多选 if (selectGroup.MultiSelect) { SetValuesToElement(ele, keyvalue.Key, keyvalue.Value.Type, ((SelectGroup)keyvalue.Value.Control).SelectedStringValues); } ///单选 else { SetValueToElement(ele, keyvalue.Key, keyvalue.Value.Type, Convert.ToString(((SelectGroup)keyvalue.Value.Control).SelectedValue)); } } else if (keyvalue.Value.Control is TextBox) { SetValueToElement(ele, keyvalue.Key, keyvalue.Value.Type, keyvalue.Value.Control.Text); } else if (keyvalue.Value.Control is NumericUpDown) { SetValueToElement(ele, keyvalue.Key, keyvalue.Value.Type, keyvalue.Value.Control.Text); } else if (keyvalue.Value.Control is DateTimePicker) { SetValueToElement(ele, keyvalue.Key, keyvalue.Value.Type, keyvalue.Value.Control.Text); } else { MessageBox.Show("未知的控件:" + keyvalue.Value.Control.GetType().FullName); } } }
public async Task <IActionResult> AddEditSelectGroup(int Id, SelectGroup model, string redirecturl) { if (ModelState.IsValid) { if (Id == 0) { using (var db = _serviceProvider.GetRequiredService <ApplicationDbContext>()) { db.SelectGroups.Add(model); await db.SaveChangesAsync(); } TempData["Notif"] = Notification.ShowNotif(MessageType.Add, type: ToastType.green); return(PartialView("_Succefullyresponse", redirecturl)); } else { using (var db = _serviceProvider.GetRequiredService <ApplicationDbContext>()) { db.SelectGroups.Update(model); await db.SaveChangesAsync(); } TempData["Notif"] = Notification.ShowNotif(MessageType.Edit, type: ToastType.blue); return(PartialView("_Succefullyresponse", redirecturl)); } } else { if (Id == 0) { TempData["Notif"] = Notification.ShowNotif(MessageType.addError, type: ToastType.yellow); } else { TempData["Notif"] = Notification.ShowNotif(MessageType.editError, type: ToastType.yellow); } return(PartialView("AddEditSelectGroup", model)); } }
public async Task <IActionResult> AddEditSelectGroup(int Id) { var SelectGroup = new SelectGroup(); if (Id != 0) { using (var db = _serviceProvider.GetRequiredService <ApplicationDbContext>()) { SelectGroup = await _context.SelectGroups.Where(c => c.Id == Id).SingleOrDefaultAsync(); if (SelectGroup == null) { return(RedirectToAction("Index")); } } } return(PartialView("AddEditSelectGroup", SelectGroup)); }
public void Select(bool isSelected) { _seq?.Kill(); var s = _seq = DOTween.Sequence(); Button.interactable = false; if (isSelected) { s.Insert(0.00f, SelectGroup.DOFade(0f, 0.25f)); s.Insert(0.25f, GoBackGroup.DOFade(1f, 0.25f)); s.Insert(0.25f, GlowGroup.DOFade(1f, 0.25f)); } else { s.Insert(0.00f, GoBackGroup.DOFade(0f, 0.25f)); s.Insert(0.00f, GlowGroup.DOFade(0f, 0.25f)); s.Insert(0.25f, SelectGroup.DOFade(1f, 0.25f)); } s.OnComplete(() => Button.interactable = true); }
private void InsAddFrontExecute() { // Выбор области на чертеже var selectGroup = new SelectGroup(Front.Model.Doc); Extents3d selReg; try { selReg = selectGroup.Select(); } catch { return; } // Проверка, что в указанной области есть свободные дома if (!Front.Model.Map.Houses.GetHousesInExtents(selReg).Any(h => h.FrontGroup == null)) { // В области новой группы не должно быть домов из других групп InsService.ShowMessage($"В выбранной области нет домов не входящих в другие группы.", System.Windows.MessageBoxImage.Error); return; } // Создание группы фронтонов try { var frontGroup = FrontGroup.New(selReg, Front); Front.AddGroup(frontGroup); // Запись статистики PluginStatisticsHelper.AddStatistic(); } catch (Exception ex) { InsService.ShowMessage(ex, "Ошибка при создании группы фронтонов."); } }
public void SetSelectGroup(SelectGroup selectGroup) { this.selectGroup = selectGroup; }
void BindFile(Control control, Control selectControl, string id) { ///载入数据 DataTable dt = _controlsDataTable[id]; if (selectControl != null) { ///若有selectControl控件,则在selectControl选择项改变后绑定control ListControl listSelect = (ListControl)selectControl; if (control is ListControl) { ListControl listControl = (ListControl)control; EventHandler bindingHandler = delegate(object sender, EventArgs e) { DataView dv = new DataView(_controlsDataTable[_dicControlDataBindId[listControl]]); dv.RowFilter = string.Format("selectValue='{0}'", listSelect.SelectedValue); listControl.DataSource = dv; listControl.DisplayMember = "text"; listControl.ValueMember = "value"; }; listSelect.SelectedValueChanged += bindingHandler; //首先执行一次绑定 bindingHandler(listSelect, EventArgs.Empty); } else { SelectGroup listControl = (SelectGroup)control; EventHandler bindingHandler = delegate(object sender, EventArgs e) { DataView dv = new DataView(_controlsDataTable[_dicControlDataBindId[listControl]]); dv.RowFilter = string.Format("selectValue='{0}'", listSelect.SelectedValue); listControl.DataSource = dv; listControl.DisplayMember = "text"; listControl.ValueMember = "value"; listControl.DataBinding(); }; listSelect.SelectedValueChanged += bindingHandler; //首先执行一次绑定 bindingHandler(listSelect, EventArgs.Empty); } } else { //无selectControl控件,直接绑定数据 if (control is ListControl) { ListControl listControl = (ListControl)control; listControl.DataSource = dt; listControl.DisplayMember = "text"; listControl.ValueMember = "value"; } else { SelectGroup listControl = (SelectGroup)control; listControl.DataSource = dt; listControl.DisplayMember = "text"; listControl.ValueMember = "value"; listControl.DataBinding(); } } }
public static IDisposable UxSelectGroup(this HtmlHelper htmlHelper, string label, bool disabled = false, string clientId = null) { var group = new SelectGroup(label, disabled, clientId); return RenderUxDispoableWebControl(htmlHelper, group); }
protected void SetElementToForm(XmlElement ele, string elementGroup) { elementGroup = (elementGroup == null ? "" : elementGroup); Dictionary <string, ControlNodeData> dicElementBindControl = _dicElementBindGroup[elementGroup]; foreach (KeyValuePair <string, ControlNodeData> keyvalue in dicElementBindControl) { if (keyvalue.Value.Control is CheckBox) { string strBindValue = GetValueFromElement(ele, keyvalue.Key, keyvalue.Value.Type); ((CheckBox)keyvalue.Value.Control).Checked = bool.Parse(strBindValue); } else if (keyvalue.Value.Control is ListControl) { string strBindValue = GetValueFromElement(ele, keyvalue.Key, keyvalue.Value.Type); ((ListControl)keyvalue.Value.Control).SelectedValue = strBindValue; } else if (keyvalue.Value.Control is SelectGroup) { SelectGroup selectGroup = (SelectGroup)keyvalue.Value.Control; ///多选 if (selectGroup.MultiSelect) { string[] strBindValues = GetValuesFromElement(ele, keyvalue.Key, keyvalue.Value.Type); selectGroup.SelectedStringValues = strBindValues; } ///单选 else { string strBindValue = GetValueFromElement(ele, keyvalue.Key, keyvalue.Value.Type); ((SelectGroup)keyvalue.Value.Control).SelectedValue = strBindValue; } } else if (keyvalue.Value.Control is TextBox) { string strBindValue = GetValueFromElement(ele, keyvalue.Key, keyvalue.Value.Type); keyvalue.Value.Control.Text = strBindValue; } else if (keyvalue.Value.Control is NumericUpDown) { string strBindValue = GetValueFromElement(ele, keyvalue.Key, keyvalue.Value.Type); keyvalue.Value.Control.Text = strBindValue; } else if (keyvalue.Value.Control is DateTimePicker) { string strBindValue = GetValueFromElement(ele, keyvalue.Key, keyvalue.Value.Type); if (string.IsNullOrEmpty(keyvalue.Value.Format)) { ((DateTimePicker)keyvalue.Value.Control).Value = DateTime.Parse(strBindValue); } else { ((DateTimePicker)keyvalue.Value.Control).Value = DateTime.ParseExact(strBindValue, keyvalue.Value.Format, null); } } else { MessageBox.Show("未知的控件:" + keyvalue.Value.Control.GetType().FullName); } } }
void Start() { gt = GetComponent <Text>(); allWordSetPanel = GetAllWordSetPanel(); selectGroup = FindObjectOfType <SelectGroup>(); }