protected void bt_AddCate_Click(object sender, EventArgs e) { lb_Error.Text = ""; try { CY.GFive.Core.Business.ParentCode pct = CY.GFive.Core.Business.ParentCode.GetInstance("RoomState"); if (pct == null) { ParentCode pc = new ParentCode(); pc.Des = "寝室状态"; pc.PCateCode = "RoomState"; pc.PName = "RoomState"; pc.Save(); } CateCode ncc = new CateCode(); ncc.Code = tb_CateCode.Text; ncc.CateName = tb_CateName.Text.Trim(); ncc.CateDes = tb_CateName.Text; ncc.ParentCode = "RoomState"; ncc.Save(); tb_CateCode.Text = ""; tb_CateName.Text = ""; BindddlRoomState(); } catch (Exception ex) { lb_Error.Text = "错误:" + ex.Message; } }
public IList<CateCode> Fill(ParentCode parent) { IList<Core.Business.CateCode> cateCodelist = new List<Core.Business.CateCode>(); if (parent != null) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@ParentCode", SqlDbType.NVarChar, parent.PCateCode, 30); SqlDataReader reader = sql.ExecuteSqlReader(SqlFillWithParam); if (reader != null) { while (reader.Read()) { Core.Business.CateCode cateCode = new Core.Business.CateCode(); if (!reader.IsDBNull(0)) cateCode.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) cateCode.Code = reader.GetString(1); if (!reader.IsDBNull(2)) cateCode.CateName = reader.GetString(2); if (!reader.IsDBNull(3)) cateCode.CateDes = reader.GetString(3); if (!reader.IsDBNull(4)) cateCode.ParentCode = reader.GetString(4); cateCode.MarkOld(); cateCodelist.Add(cateCode); } reader.Close(); } } return cateCodelist; }
//添加记录类型 protected void btn_AddRcdCate_Click(object sender, EventArgs e) { lab_Error.Text = ""; try { CY.GFive.Core.Business.ParentCode pctemp = CY.GFive.Core.Business.ParentCode.GetInstance("RoomRcdCate"); if (pctemp == null) { ParentCode pc = new ParentCode(); pc.Des = "寝室记录类型"; pc.PCateCode = "RoomRcdCate"; pc.PName = "RoomRcdCate"; pc.Save(); } CateCode cc = new CateCode(); //备注:RRC为RoomRcdCate简写 cc.CateDes =txt_name.Text.Trim(); cc.CateName =txt_name.Text.Trim(); cc.Code ="RRC"+txt_code.Text.Trim(); cc.ParentCode = "RoomRcdCate"; bool temp = CateCode.IsExist(cc.Code); if (temp) { Page.ClientScript.RegisterStartupScript(typeof(string), "", "alert('编号已存在');", true); return; } cc.Save(); txt_code.Text = ""; txt_name.Text = ""; BindRcdCate(); } catch (Exception ex) { lab_Error.Text = "错误:" + ex.Message; } }
public void UpdateValueByEnum(ParentCode parentCode, ChildCode childCode, object Value) { _isFileSave = true; ParentCode Child_Parent = (ParentCode)GEI.GetParameter<ChildCode>(childCode, 0); if (Child_Parent == parentCode) { this.SetValue(parentCode.ToString(), childCode.ToString(), Value); } else { throw new Exception("부모 코드와 자식 코드가 매칭되지 않습니다."); } _isFileSave = false; }
/// <summary> /// 해당 환경설정 값 가져오기 /// </summary> /// <param name="parentCode">환경설정 부모코드</param> /// <param name="childCode">환경설정 자식코드</param> /// <returns>환경설정 값</returns> public object GetValueByEnum(ParentCode parentCode, ChildCode childCode) { ParentCode Child_Parent = (ParentCode)GEI.GetParameter<ChildCode>(childCode, 0); if (Child_Parent == parentCode) { object ReturnObj = this.GetValue(parentCode.ToString(), childCode.ToString()); // 사용자가 환경설정 값 저장을 안한 경우 if (ReturnObj == null) { // 기본 환경설정 값 string DefaultVal = GEI.GetParameter<ChildCode>(childCode, 1).ToString(); // 기본 환경설정 값 저장 this.UpdateValueByEnum(parentCode, childCode, DefaultVal); // 다시 불러옴. return this.GetValue(parentCode.ToString(), childCode.ToString()); } return ReturnObj; } else { throw new Exception("부모 코드와 자식 코드가 매칭되지 않습니다."); } }
static FileItemCate() { pcate = Business.ParentCode.GetInstance("FileItemCate"); }
public override int GetHashCode() { return(Code.GetHashCode() ^ NumericCode.GetHashCode() ^ Alpha3Code.GetHashCode() ^ Fips10Code.GetHashCode() ^ Type.GetHashCode() ^ IdStatus.GetHashCode() ^ CurrencyCode.GetHashCode() ^ ParentCode.GetHashCode() ^ ParentGroupCodes.GetHashCode() ^ LanguageCodes.GetHashCode() ^ LanguageAltCodes.GetHashCode()); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public void DrawTransformer(Entity PostContainerEntity) { Editor ed = Application.DocumentManager.MdiActiveDocument.Editor; bool conti = true; double MyScale = Atend.Base.Design.DProductProperties.AccessSelectBySoftwareCode((int)Atend.Control.Enum.ProductType.Transformer).Scale; double MyCommentScale = Atend.Base.Design.DProductProperties.AccessSelectBySoftwareCode((int)Atend.Control.Enum.ProductType.Transformer).CommentScale; DrawTransformerJig transformerJig = new DrawTransformerJig(PostContainerEntity, MyScale); PromptResult pr; while (conti) { pr = ed.Drag(transformerJig); if (pr.Status == PromptStatus.OK) { conti = false; #region Save data here List <Entity> Entities = transformerJig.GetEntities(); if (NodeCode != null && ParentCode != null) { ObjectIdCollection OIC = new ObjectIdCollection(); foreach (Entity ent in Entities) { ObjectId NewEntOI = Atend.Global.Acad.UAcad.DrawEntityOnScreen(ent, Atend.Control.Enum.AutoCadLayerName.MED_GROUND.ToString()); Atend.Base.Acad.AT_INFO EntInfo = new Atend.Base.Acad.AT_INFO(NewEntOI); EntInfo.ParentCode = ParentCode.ToString(); // TransformerParent.ToString(); EntInfo.NodeCode = ""; Atend.Global.Acad.AcadJigs.MyPolyLine poly = ent as Atend.Global.Acad.AcadJigs.MyPolyLine; object ProductType = null; if (poly != null) { if (poly.AdditionalDictionary.ContainsKey("ProductType")) { poly.AdditionalDictionary.TryGetValue("ProductType", out ProductType); } } else { Atend.Global.Acad.AcadJigs.MyLine lin = ent as Atend.Global.Acad.AcadJigs.MyLine; if (lin != null) { if (lin.AdditionalDictionary.ContainsKey("ProductType")) { lin.AdditionalDictionary.TryGetValue("ProductType", out ProductType); } } else { Atend.Global.Acad.AcadJigs.MyCircle cir = ent as Atend.Global.Acad.AcadJigs.MyCircle; if (cir != null) { if (cir.AdditionalDictionary.ContainsKey("ProductType")) { cir.AdditionalDictionary.TryGetValue("ProductType", out ProductType); } } } } if (ProductType != null) { EntInfo.NodeType = Convert.ToInt32(ProductType); } else { EntInfo.NodeType = 0; } EntInfo.ProductCode = 0; EntInfo.Insert(); OIC.Add(NewEntOI); } ObjectId TransformerGroupOI = Atend.Global.Acad.Global.MakeGroup(NodeCode.ToString(), OIC); Atend.Base.Acad.AT_INFO GroupInfo = new Atend.Base.Acad.AT_INFO(TransformerGroupOI); GroupInfo.ParentCode = ParentCode.ToString(); GroupInfo.NodeCode = NodeCode.ToString(); GroupInfo.NodeType = (int)Atend.Control.Enum.ProductType.Transformer; GroupInfo.ProductCode = ProductCode; GroupInfo.Insert(); string comment = string.Format("Tr: {0} KVR", Atend.Base.Equipment.ETransformer.AccessSelectByCode(ProductCode).Capaciy); ObjectId TextOi = Atend.Global.Acad.UAcad.DrawEntityOnScreen(Atend.Global.Acad.UAcad.WriteNote(comment, new Point3d(transformerJig.MyCenterPoint.X, transformerJig.MyCenterPoint.Y, transformerJig.MyCenterPoint.Z) , MyCommentScale), Atend.Control.Enum.AutoCadLayerName.GENERAL.ToString()); Atend.Base.Acad.AT_INFO TextInfo = new Atend.Base.Acad.AT_INFO(TextOi); TextInfo.ParentCode = NodeCode.ToString(); TextInfo.NodeCode = ""; TextInfo.NodeType = (int)Atend.Control.Enum.ProductType.Comment; TextInfo.ProductCode = 0; TextInfo.Insert(); //ed.WriteMessage("ADD TO POST TRANSFORMER\n"); Atend.Base.Acad.AT_SUB.AddToAT_SUB(TransformerGroupOI, PostContainerEntity.ObjectId); Atend.Base.Acad.AT_SUB.AddToAT_SUB(PostContainerEntity.ObjectId, TransformerGroupOI); Atend.Base.Acad.AT_SUB.AddToAT_SUB(TextOi, TransformerGroupOI); } #endregion } else { conti = false; } } }//