public void loadCostCenterCmbData() { //load cbxCostcenter TODO ObjTmp s = (ObjTmp)this.headerControl1.cbxResponsibleSite.SelectedItem; costCenterList = Contract.getCostCenter(s.strValue1); if (costCenterList != null && costCenterList.Count > 0) { List <ObjTmp> myccs = new List <ObjTmp>(costCenterList.Count); foreach (clsBaseListItem cc in costCenterList) { myccs.Add(new ObjTmp(cc.strValue1, cc.strValue1 + "-" + cc.strText)); } this.headerControl1.cbxCostcenter.DataSource = myccs; this.headerControl1.cbxCostcenter.DisplayMember = "strText"; this.headerControl1.cbxCostcenter.ValueMember = "strValue1"; if (objContract.CostCenter != null) { int costIdx = -1; costIdx = myccs.FindIndex(x => x.strValue1 == objContract.CostCenter.strValue1); this.headerControl1.cbxCostcenter.SelectedIndex = costIdx;//objContract.CostCenter.strValue1; } } }
/// <summary> /// 底层单元格生成 /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="type"></param> void CellInstantiate(int x, int y, int type) { ObjTmp = Instantiate(CellPrefab) as GameObject; ObjTmp.transform.SetParent(GridParent.transform, false); ObjTmp.transform.localPosition = new Vector3(x, y); cellScript = ObjTmp.GetComponent <CellObj>(); cellScript.CellCode = type; cellScript.Cell = SetCell(type, x, y); cellScript.SetSprite(cellScript.Cell.CellType - 1); GridCell[x, y] = objTmp; GridCellObj[x, y] = cellScript; }
public void updateContract() { objContract.ExtContractNo = this.headerControl1.txtExtContractNr.Text; objContract.IsStatistic = this.headerControl1.cbStatistic.Checked; if (this.headerControl1.cbxCostcenter.SelectedIndex >= 0) { if (this.headerControl1.cbxCostcenter.SelectedItem != null) { ObjTmp s = (ObjTmp)this.headerControl1.cbxCostcenter.SelectedItem; objContract.CostCenter = findclsBaseListItem(s.strValue1, this.costCenterList); //MessageBox.Show(s.value); } } if (this.headerControl1.cbxResponsibleSite.SelectedIndex >= 0) { if (this.headerControl1.cbxResponsibleSite.SelectedItem != null) { ObjTmp s = (ObjTmp)this.headerControl1.cbxResponsibleSite.SelectedItem; clsBaseListItem site = null; site = SCBase.findSite(s.strValue1); if (site != null) { objContract.SiteId = site; } //MessageBox.Show(s.value); } } if (this.headerControl1.cbxValidWorkshop.SelectedIndex >= 0) { if (this.headerControl1.cbxValidWorkshop.SelectedItem != null) { ObjTmp s = (ObjTmp)this.headerControl1.cbxValidWorkshop.SelectedItem; objContract.ValidWorkshopCode = findclsBaseListItem(s.strValue1, this.ws); //MessageBox.Show(s.value); } } }
private void loadData() { SCBase sCBase = new SCBase(); List <string> result = typeof(ContractStatusString).GetAllPublicConstantValues <string>(); List <ObjTmp> lstModel = new List <ObjTmp>(result.Count); string[] words; string[] stringSeparators = new string[] { "-" }; foreach (string s in result) { words = s.Split(stringSeparators, StringSplitOptions.RemoveEmptyEntries); lstModel.Add(new ObjTmp(words[0], words[1])); } //List<ObjTmp> statusList = new List<ObjTmp>(); ObjTmp m = new ObjTmp(); ObjTmp o = new ObjTmp(); ObjTmp n = new ObjTmp(); ObjTmp w = new ObjTmp(); ObjTmp a = new ObjTmp(); ObjTmp h = new ObjTmp(); ObjTmp c = new ObjTmp(); ObjTmp d = new ObjTmp(); m = lstModel.Find(x => x.strValue1.Equals("M")); o = lstModel.Find(x => x.strValue1.Equals("O")); n = lstModel.Find(x => x.strValue1.Equals("N")); w = lstModel.Find(x => x.strValue1.Equals("W")); a = lstModel.Find(x => x.strValue1.Equals("A")); h = lstModel.Find(x => x.strValue1.Equals("H")); c = lstModel.Find(x => x.strValue1.Equals("C")); d = lstModel.Find(x => x.strValue1.Equals("D")); switch (this.status) { case "M": statusList.Add(o); break; case "O": statusList.Add(n); statusList.Add(w); statusList.Add(d); break; case "N": statusList.Add(w); statusList.Add(d); break; case "W": statusList.Add(a); break; case "A": statusList.Add(h); statusList.Add(c); break; case "H": statusList.Add(a); statusList.Add(c); statusList.Add(d); break; case "C": statusList.Add(d); break; } }