private DataTable GetItemTable(DrawItemStyle itemStyle) { ItemFromTableRead itemFrom = new ItemFromTableRead(ItemID); string tablename = itemFrom.ReturnItemInstance(itemStyle).ToString(); return(WorkDataManage.WorkDataManage.FindWorkDataTableByName(tablename)); }
public string ItemSubStyle; //绘图项分类的子类型; //构造函数 public DrawItemName(string drawItemID, string drawItemShowName, DrawItemStyle itemStyle, string itemSubStyle) { DrawItemID = drawItemID.Trim(); DrawItemShowName = drawItemShowName.Trim(); ItemStyle = itemStyle; ItemSubStyle = itemSubStyle; }
public static bool isInSelectedDrawItemNamesLst(DrawItemName sourceDrawItemName, List <DrawItemName> selectedDrawItemsNameLst) { bool result = false; for (int i = 0; i < selectedDrawItemsNameLst.Count; i++) { DrawItemName tmp = selectedDrawItemsNameLst[i]; string id = tmp.DrawItemID; DrawItemStyle dis = tmp.ItemStyle; if (sourceDrawItemName.DrawItemID == id && sourceDrawItemName.ItemStyle == dis) { result = true; break; } } return(result); }
public object ReturnItemInstance(DrawItemStyle ItemStyle) { _selfdrawItemStyle = ItemStyle; if (ItemStyle.Equals(DrawItemStyle.LineItem)) { return(LineItemOper()); } else if (ItemStyle.Equals(DrawItemStyle.SymbolItem)) { return(SymbolItemOper()); } else if (ItemStyle.Equals(DrawItemStyle.TextItem)) { return(TextItemOper()); } else if (ItemStyle.Equals(DrawItemStyle.ImageItem)) { return(ImageItemOper()); } else if (ItemStyle.Equals(DrawItemStyle.HCGZItem)) { return(HCGZItemOper()); } else if (ItemStyle.Equals(DrawItemStyle.MultiHatchCurveItem)) { return(MultiHatchCurveItemOper()); } else if (ItemStyle.Equals(DrawItemStyle.HatchRectItem)) { return(HatchRectItemOper()); } else if (ItemStyle.Equals(DrawItemStyle.NormalPuTuItem)) { return(NormalPuTuItemOper()); } else if (ItemStyle.Equals(DrawItemStyle.CurveHasHatchItem)) { return(CurveHasHatchItemOper()); } else { return(null); } }
public Hashtable GetItemStrucHtByDB(DrawItemStyle drawItemStyle) { Hashtable itemStrucHt = new Hashtable(); ItemDAL itemDal = new ItemDAL(drawItemStyle); DbDataReader itemDr = itemDal.GetDrawItemDataReader(); if (itemDr.HasRows) { while (itemDr.Read()) { DrawItemFactory drawItemFactory = new DrawItemFactory(); object drawItemObj = drawItemFactory.ReturnItemInstance(drawItemStyle); Type type = drawItemObj.GetType(); foreach (PropertyInfo p in type.GetProperties()) { string proName = p.Name.Trim(); Type pt = p.PropertyType; object proValue; if (pt.Equals(typeof(bool))) { proValue = itemDr[proName]; } else { proValue = itemDr[proName].ToString().Trim(); } type.GetProperty(proName).SetValue(drawItemObj, proValue, null); } try { itemStrucHt.Add(itemDr["ID"], drawItemObj);//将表中的主键作为key值,将对象赋予到哈希表中 } catch { continue; } } } itemDr.Close(); return(itemStrucHt); }
public DrawItemStyle ItemStyle; //该绘图项的分类类型 public DrawItemKey(string drawItemID, DrawItemStyle drawItemStyle) { this.DrawItemID = drawItemID; this.ItemStyle = drawItemStyle; }
private void AddDrawItems(ref List <DrawItemName> drawItems, string itemCollectionsStr, DrawItemStyle drawItemStyle) { if (string.IsNullOrEmpty(itemCollectionsStr)) { return; } else { string tmp = itemCollectionsStr.Trim(); string[] items = tmp.Split(itemCollectionSplitter); if (items.Count() > 0) { for (int i = 0; i < items.Count(); i++) { string tmpitemId = items[i]; if (!string.IsNullOrEmpty(tmpitemId)) { DrawItemNameRead drawItemNameRead = new DrawItemNameRead(tmpitemId); drawItems.Add((DrawItemName)drawItemNameRead.ReturnItemInstance(drawItemStyle)); } } } } }
public ItemDAL(DrawItemStyle itemstyle) { _itemstyle = itemstyle; }
private LineRoadDesignClass CreateLRDesignStrucByFrm(string Lrmodelid) { LineRoadModel tmplrmodel = new LineRoadModel(); tmplrmodel.LineRoadDesignDetailID = Lrmodelid; //1,测网设计; if (this.rb_CeWangYes.Checked)//绘制测网; { tmplrmodel.ifAddCeWang = true; tmplrmodel.IfCeWangHeng = this.chb_cWHeng.Checked; tmplrmodel.IfCeWangZong = this.chb_cwZong.Checked; if (null != this.cb_CeWangStyle.SelectedValue) { tmplrmodel.cewangstyle = this.cb_CeWangStyle.SelectedValue.ToString(); } tmplrmodel.cewangfixlen = this.tb_CeWangFixLen.Text.Trim(); tmplrmodel.cewangsepnum = this.tb_CeWangSepNum.Text.Trim(); tmplrmodel.duishuminvalue = this.tb_CWDuiShuMin.Text.Trim(); tmplrmodel.duishuParam = this.tb_CWDuiShuParam.Text.Trim(); } else { tmplrmodel.ifAddCeWang = false; } //2,线道样式 tmplrmodel.IfLeftSecondKD = this.chb_ifLeftSecondKD.Checked; tmplrmodel.IfRightSecondKD = this.chb_ifRightSecondKD.Checked; tmplrmodel.IfzhengMiLine = this.chb_ifZhengMiLine.Checked; tmplrmodel.LineRoadWidth = this.tb_LineGroupWidth.Text.Trim(); tmplrmodel.LineRoadName = this.tb_LineRoadName.Text.Trim(); tmplrmodel.LineroadTitleHeight = this.tb_titleStartHeight.Text.Trim(); if (null != this.cb_LineRoadStyle.SelectedValue) { tmplrmodel.LineRoadStyle = this.cb_LineRoadStyle.SelectedValue.ToString(); } //3,线道头左侧线 tmplrmodel.TitleLeftFrameLineChecked = this.chk_IfDrawTitleLeft.Checked; if (null != this.cb_leftline.SelectedValue) { tmplrmodel.LeftLineStyle = this.cb_leftline.SelectedValue.ToString().Trim(); } tmplrmodel.LeftLineLength = this.tb_leftlineLength.Text; //4,线道所包含的绘图项 for (int i = 0; i < this.lb_selected.Items.Count; i++) { string tmpItem = this.lb_selected.Items[i].ToString(); string[] tmpItemArr = tmpItem.Split(';'); if (tmpItemArr.Length == 3) { string id = tmpItemArr[0]; string style = tmpItemArr[1]; string name = tmpItemArr[2]; DrawItemStyle dis = EnumUtil.GetEnumByStr(style, DrawItemStyle.NoneItem); if (dis.Equals(DrawItemStyle.LineItem)) { tmplrmodel.CurveItemCollections = tmplrmodel.CurveItemCollections + id + ";"; } else if (dis.Equals(DrawItemStyle.TextItem)) { tmplrmodel.TextItemCollections = tmplrmodel.TextItemCollections + id + ";"; } else if (dis.Equals(DrawItemStyle.HCGZItem)) { tmplrmodel.HcgzItemCollections = tmplrmodel.HcgzItemCollections + id + ";"; } else if (dis.Equals(DrawItemStyle.SymbolItem)) { tmplrmodel.SymbolItemCollections = tmplrmodel.SymbolItemCollections + id + ";"; } else if (dis.Equals(DrawItemStyle.ImageItem)) { tmplrmodel.ImageItemCollections = tmplrmodel.ImageItemCollections + id + ";"; } else if (dis.Equals(DrawItemStyle.MultiHatchCurveItem)) { tmplrmodel.MultiHatchCurveItemCollections = tmplrmodel.MultiHatchCurveItemCollections + id + ";"; } else if (dis.Equals(DrawItemStyle.HatchRectItem)) { tmplrmodel.HatchRectItemCollections = tmplrmodel.HatchRectItemCollections + id + ";"; } else if (dis.Equals(DrawItemStyle.NormalPuTuItem)) { tmplrmodel.NormalPuTuItemCollections = tmplrmodel.NormalPuTuItemCollections + id + ";"; } else if (dis.Equals(DrawItemStyle.CurveHasHatchItem)) { tmplrmodel.CurveHasHatchItemCollections = tmplrmodel.CurveHasHatchItemCollections + id + ";"; } } } LineRoadDesignClass tmplr = new LineRoadDesignClass(tmplrmodel); return(tmplr); }