public Employee(int id, string name, PositionID pid, DivisionID did) { ID = id; Name = name; PID = pid; DID = did; }
public void Draw(ICanvas canvas, RectangleF unitrect) { try { Brush Pen = new SolidBrush(Color.White); Color StateColor = canvas.DataModel.GetStateColor(State); if (Selected) { Pen = Brushes.Magenta; } canvas.DrawPosition(canvas, Pen, PositionID.ToString(), Location); } catch (Exception ex) { throw ex; } }
protected void bindPositionList()//binding the position dropdown { DataTableConversion lsttodt = new DataTableConversion(); IPositionInterface service = new PositionRepository(); var lst = service.GetPositionListFunc().Select(x => new { x.PositionName, x.ID }).ToList(); DataTable dt = lsttodt.ToDataTable(lst); if (dt != null && dt.Rows.Count > 0) { PositionID.DataSource = dt; PositionID.DataTextField = "PositionName"; PositionID.DataValueField = "ID"; PositionID.DataBind(); } else { PositionID.DataBind(); } }
public eDrawObjectMouseDownEnum OnMouseDown(ICanvas canvas, UnitPoint point, ISnapPoint snappoint) { try { Int64 MaxID = 1; if (canvas.DataModel.ActiveLayer.Objects.Count() > 0) { if (canvas.DataModel.ActiveLayer.Objects.Where(p => p.Id == "PositionTool").Count() > 0) { MaxID = canvas.DataModel.ActiveLayer.Objects.Where(p => p.Id == "PositionTool").Max(p => (p as PositionTool).PositionID); PositionID = MaxID + 1; } } Selected = false; location = point; Brush Pen = Brushes.White; canvas.DrawPosition(canvas, Pen, PositionID.ToString(), Location); return(eDrawObjectMouseDownEnum.Done); } catch (Exception ex) { throw ex; } }
public override void Init() { PositionID found = PlanetSave.CitizensID.Find(c => new Vector3(c.x, c.y, c.z) == transform.position); ID = found.ID; }
public Position(PositionID id, string title, decimal salary) { PosID = id; Title = title; Salary = salary; }
public override void Awake() { //base.Awake(); positions = new List <Position>(); departments = new List <Department>(); titles = new List <Title>(); var notchoose = new Dropdown.OptionData("未选中"); List <Dropdown.OptionData> list = new List <Dropdown.OptionData>(); positions.AddRange(Kernel.Current.Sql.LoadEntitys <Position>()); foreach (var item in positions) { list.Add(new Dropdown.OptionData(item.Name)); } PositionID.ClearOptions(); list.Add(notchoose); PositionID.AddOptions(list); //Debug.Log(PositionID.options.Count + " " + PositionID.value); PositionID.value = PositionID.options.Count - 1; list.Clear(); departments.AddRange(Kernel.Current.Sql.LoadEntitys <Department>()); foreach (var item in departments) { list.Add(new Dropdown.OptionData(item.Name)); } DepartmentID.ClearOptions(); list.Add(notchoose); DepartmentID.AddOptions(list); DepartmentID.value = DepartmentID.options.Count - 1; list.Clear(); titles.AddRange(Kernel.Current.Sql.LoadEntitys <Title>()); foreach (var item in titles) { list.Add(new Dropdown.OptionData(item.Name)); } TitleID.ClearOptions(); list.Add(notchoose); TitleID.AddOptions(list); TitleID.value = TitleID.options.Count - 1; query.onClick.AddListener(() => { string sql = null; bool oneWhere = true; if (NationText.input.text.IsNotEmpty()) { sql += $"Nation like \'%{NationText.input.text}%\' "; oneWhere = false; } if (BirthDay.transform.Find("PickButton").GetComponent <Button>().interactable) { string and = null; if (oneWhere == true) { oneWhere = false; } else { and = "and"; } sql += $"{and} BirthDay=\'{(new SqlDateTime(BirthDay.DateTime)).ToSqlString()}\' "; } if (NameText.input.text.IsNotEmpty()) { string and = null; if (oneWhere == true) { oneWhere = false; } else { and = "and"; } sql += $"{and} Name=\'{NameText.input.text}\' "; } if (PoliticalOutlookText.input.text.IsNotEmpty()) { string and = null; if (oneWhere == true) { oneWhere = false; } else { and = "and"; } sql += $"{and} PoliticalOutlook like \'%{PoliticalOutlookText.input.text}%\' "; } if (EducationText.input.text.IsNotEmpty()) { string and = null; if (oneWhere == true) { oneWhere = false; } else { and = "and"; } sql += $"{and} Education=\'{EducationText.input.text}\' "; } if (AddressText.input.text.IsNotEmpty()) { string and = null; if (oneWhere == true) { oneWhere = false; } else { and = "and"; } sql += $"{and} Address like \'%{AddressText.input.text}%\' "; } if (infoText.input.text.IsNotEmpty()) { string and = null; if (oneWhere == true) { oneWhere = false; } else { and = "and"; } sql += $"{and} Info like \'%{infoText.input.text}%\' "; } if (PositionID.value != PositionID.options.Count - 1) { string and = null; if (oneWhere == true) { oneWhere = false; } else { and = "and"; } sql += $"{and} PositionID={positions[PositionID.value].ID} "; } if (TitleID.value != TitleID.options.Count - 1) { string and = null; if (oneWhere == true) { oneWhere = false; } else { and = "and"; } sql += $"{and} TitleID={titles[TitleID.value].ID} "; } if (DepartmentID.value != DepartmentID.options.Count - 1) { string and = null; if (oneWhere == true) { oneWhere = false; } else { and = "and"; } sql += $"{and} DepartmentID={departments[DepartmentID.value].ID} "; } try { Debug.Log(sql); var result = Kernel.Current.Sql.QueryWhere <Personnel>(sql); Kernel.Current.Desktop.OpenNew <SearchResultForm>().AddItems(new List <Personnel>(result)); } catch (Exception e) { Debug.Log(e.Message); Kernel.Current.Desktop.OpenNew <DialogForm>().SetDialog(null, "错误!", "输入的数据全为空或格式有错误!"); } }); datetimeToggle.onValueChanged.AddListener(x => { BirthDay.transform.Find("PickButton").GetComponent <Button>().interactable = x; }); datetimeToggle.isOn = false; goBack.onClick.AddListener(() => Kernel.Current.Desktop.GoBack()); }