Пример #1
0
        internal void delEnt(CPileType ent)
        {
            if(!ent.IsLeaf)
            {
                delAllChildren(ent);
            }

            delEntOnly(ent);
        }
Пример #2
0
        internal void create(object parentPileType)
        {
            this.parentPileType = parentPileType;

            pileType = new CPileType();
            pileType.PileTypeId = this.newPileTypeId();
            pileType.ParentTypeId = this.newTypeParentTypeId();
            pileType.TypeOrder = this.newTypeOrder();
            pileType.IsLeaf = this.newTypeIsLeaf();
        }
Пример #3
0
 void ILeafPileTypeSelectOberver.onPileTypeSelectChanged(SuperMemory.Entities.CPileType curPileType)
 {
     Biz.CurPileType = curPileType;
     if (Biz.hasPiles())
     {
         this.enableBtns();
     }
     else
     {
         this.unenableBtns();
     }
 }
Пример #4
0
 private void delEntOnly(CPileType ent)
 {
     string sql = "delete from " + TABLE_NAME +
         " where " + FIELD_PILE_TYPE_ID + "='" + ent.PileTypeId + "'";
     this.exeNonQuerSql(sql);
 }
Пример #5
0
 private void delAllChildren(CPileType ent)
 {
     string sql = "delete from " + TABLE_NAME +
         " where " + FIELD_PARENT_TYPE_ID + "='" + ent.PileTypeId + "'";
     this.exeNonQuerSql(sql);
 }
Пример #6
0
 private CPileType create1EntByDtAndRowIndex(DataTable dtRet, int i)
 {
     CPileType ret = new CPileType();
     ret.PileTypeId = dtRet.Rows[i][FIELD_PILE_TYPE_ID].ToString();
     ret.PileTypeName = dtRet.Rows[i][FIELD_PILE_TYPE_NAME].ToString();
     ret.ParentTypeId = dtRet.Rows[i][FIELD_PARENT_TYPE_ID].ToString();
     ret.IsLeaf = bool.Parse(dtRet.Rows[i][FIELD_IS_LEAF].ToString());
     ret.TypeOrder = int.Parse(dtRet.Rows[i][FIELD_TYPE_ORDER].ToString());
     return ret;
 }
Пример #7
0
        internal void saveNewEnt(CPileType newEnt)
        {
            string sql = "insert into " + TABLE_NAME + "(" + FIELD_PILE_TYPE_ID +
              "," + FIELD_PARENT_TYPE_ID +
              "," + FIELD_PILE_TYPE_NAME +
              "," + FIELD_TYPE_ORDER +
              "," + FIELD_IS_LEAF + ") values('" + newEnt.PileTypeId + "'" +
              ",'" + newEnt.ParentTypeId + "'" +
              ",'" + newEnt.PileTypeName + "'" +
              "," + newEnt.TypeOrder +
              ",'" + this.bool2intStr(newEnt.IsLeaf) + "')";

            this.exeNonQuerSql(sql);
        }
Пример #8
0
 /// <summary>
 /// ����һ�������ڵ�������ӽڵ�
 /// </summary>
 /// <param name="parentNode"></param>
 /// <param name="parnetEnt"></param>
 private void load1parentAllChildrenNodes(TreeNode parentNode, CPileType parnetEnt)
 {
     List<CPileType> chidrenEnts = CModelMgr.Inst.Db.PileType.load1ParentAllChildrenEnts(parnetEnt.PileTypeId);
     foreach (CPileType ent in chidrenEnts)
     {
         parentNode.Nodes.Add(this.create1SubPileTypeNodeByEnt(ent));
     }
 }
Пример #9
0
 /// <summary>
 /// ����һ�������ڵ�
 /// </summary>
 /// <param name="ent"></param>
 /// <returns></returns>
 private TreeNode create1SubPileTypeNodeByEnt(CPileType ent)
 {
     TreeNode ret = new TreeNode();
     ret.Text = ent.PileTypeName;
     ret.Tag = ent;
     return ret;
 }
Пример #10
0
 /// <summary>
 /// ����һ�������ڵ�
 /// </summary>
 /// <param name="ent"></param>
 /// <returns></returns>
 private TreeNode create1ParentPileTypeNodeByEnt(CPileType ent)
 {
     TreeNode ret = new TreeNode();
     ret.Text = ent.PileTypeName;
     ret.Tag = ent;
     this.load1parentAllChildrenNodes(ret,ent);
     return ret;
 }
Пример #11
0
 void ILeafPileTypeSelectOberver.onPileTypeSelectChanged(CPileType curPileType)
 {
     biz().CurPileType = curPileType;
 }