protected string GetStateName(string itemCode) { int itemCode2 = int.Parse(itemCode); BasicCodeListService basicCodeListService = new BasicCodeListService(); return(basicCodeListService.GetNameByTypeAndCode("ProjectState", itemCode2)); }
private void BindState() { BasicCodeListService basicCodeListService = new BasicCodeListService(); this.ddlState.DataSource = basicCodeListService.GetByType("EquState"); this.ddlState.DataTextField = "ItemName"; this.ddlState.DataValueField = "ItemCode"; this.ddlState.DataBind(); this.ddlState.Items.Insert(0, new ListItem("", "")); }
private void BindState() { BasicCodeListService basicCodeListService = new BasicCodeListService(); this.dropState.DataSource = ( from cs in basicCodeListService.GetByType("EquState") orderby cs.ItemCode select cs).ToList <BasicCodeList>(); this.dropState.DataTextField = "ItemName"; this.dropState.DataValueField = "ItemCode"; this.dropState.DataBind(); }
private void BindState() { BasicCodeListService basicCodeListService = new BasicCodeListService(); System.Collections.Generic.List <BasicCodeList> dataSource = ( from cs in basicCodeListService.GetByType("EquState") orderby cs.ItemCode select cs).ToList <BasicCodeList>(); this.ddlState.DataSource = dataSource; this.ddlState.DataTextField = "ItemName"; this.ddlState.DataValueField = "ItemCode"; this.ddlState.DataBind(); this.ddlState.Items.Insert(0, new ListItem("", "")); }
private System.Collections.Generic.List <EquipmentInfo> GetEquipments() { new ResResourceService(); BasicCodeListService inner = new BasicCodeListService(); string state = this.ddlState.SelectedValue; string code = this.txtCode.Text.Trim(); string name = this.txtName.Text.Trim(); System.Collections.Generic.List <EquipmentInfo> list = ( from es in this.equipmentSer join ets in this.equTypeSer on es.TypeId equals ets.Id join bs in inner on es.State equals bs.ItemCode where bs.TypeCode == "EquState" && es.TypeId == this.trvwEquipmentType.SelectedValue orderby es.EquCode select new EquipmentInfo { Id = es.Id, Code = es.EquCode, Name = es.EquName, TypeName = ets.Name, State = es.State, StateName = bs.ItemName, SupplierId = es.SupplierId, PurchasePrice = es.PurchasePrice, Note = es.Note, PurchaseDate = (es.PurchaseDate == (System.DateTime?)null) ? "" : es.PurchaseDate.Value.ToString("yyyy-MM-dd") }).ToList <EquipmentInfo>(); if (!string.IsNullOrEmpty(state)) { list = ( from res in list where res.State == System.Convert.ToInt32(state) select res).ToList <EquipmentInfo>(); } if (!string.IsNullOrEmpty(code)) { list = ( from res in list where res.Code.Contains(code) select res).ToList <EquipmentInfo>(); } if (!string.IsNullOrEmpty(name)) { list = ( from res in list where res.Name.Contains(name) select res).ToList <EquipmentInfo>(); } return(list); }
private void BindData() { string text = base.Request["ic"].ToString(); PTPrjInfoStateChange byPrjIdByOrder; if (string.IsNullOrEmpty(base.Request["pass"])) { byPrjIdByOrder = new PTPrjInfoStateChangeService().GetByPrjIdByOrder(text, 1); } else { byPrjIdByOrder = new PTPrjInfoStateChangeService().GetByPrjIdByOrder(text, -1); } BasicCodeListService basicCodeListService = new BasicCodeListService(); System.Guid id = new System.Guid(text); PTPrjInfoZTB byId = new PTPrjInfoZTBService().GetById(id); if (byPrjIdByOrder != null) { if (!string.IsNullOrEmpty(byPrjIdByOrder.ChangeUser)) { PTyhmc byId2 = new PTYhmcService().GetById(byPrjIdByOrder.ChangeUser); this.lblChangeMan.Text = byId2.v_xm; } this.lblChangeTime.Text = Common2.GetTime(byPrjIdByOrder.ChangeTime.ToString()); this.lblOldState.Text = basicCodeListService.GetNameByTypeAndCode("ProjectState", byPrjIdByOrder.OldState.Value); this.lblChangeState.Text = basicCodeListService.GetNameByTypeAndCode("ProjectState", byPrjIdByOrder.ChangeState.Value); this.lblprjChangeReason.Text = byPrjIdByOrder.ChangeReason; this.lblPrjRemark.Text = byPrjIdByOrder.Note; } if (byId != null) { this.lblPrjCode.Text = byId.PrjCode; this.lblPrjName.Text = byId.PrjName; this.lblStartDate.Text = Common2.GetTime(byId.StartDate).ToString(); this.lblEndDate.Text = Common2.GetTime(byId.EndDate).ToString(); } }
public IList <Project> GetOnelevelByState(int year, IList <string> idList, IList <string> stateList, string pcode, string pname) { IList <Project> list = new List <Project>(); Project project = new Project { Id = "root", Text = year + "年度项目", State = "open" }; PTPrjInfoService service = new PTPrjInfoService(); new PTPrjInfoZTBService(); BasicCodeListService service2 = new BasicCodeListService(); IList <BasicCodeList> first = new List <BasicCodeList>(); int num = (idList.Count / 0x5dc) + 1; for (int i = 0; i < num; i++) { List <string> theIdList = idList.Skip <string>((i * 0x5dc)).Take <string>(0x5dc).ToList <string>(); List <BasicCodeList> second = (from cl in service2 join p in service on cl.ItemCode equals p.PrjState into p where (((((cl.TypeCode == "ProjectState") && (p.StartDate.HasValue && (p.StartDate.Value.Year <= year))) && (!p.EndDate.HasValue || (p.EndDate.Value.Year >= year))) && theIdList.Contains(p.PrjGuid.ToString())) && stateList.Contains(cl.ItemCode.ToString())) && (p.PrjCode.Contains(pcode) || p.PrjName.Contains(pname)) orderby cl.ItemCode select cl).Distinct <BasicCodeList>().ToList <BasicCodeList>(); first = first.Union <BasicCodeList>(second).ToList <BasicCodeList>(); } foreach (BasicCodeList list4 in (from c in first orderby c.ItemCode select c).ToList <BasicCodeList>()) { Project item = new Project { Id = list4.ItemCode.ToString(), Text = list4.ItemName, State = "closed" }; list.Add(item); } return(list); }
private string GetStateName(int state) { BasicCodeListService basicCodeListService = new BasicCodeListService(); return(basicCodeListService.GetNameByTypeAndCode("ProjectState", state)); }