public void copyPiles(List<CPile> src, List<CPile> dest)
 {
     dest.Clear();
     CPile[] arrPiles = new CPile[src.Count];
     src.CopyTo(arrPiles);
     dest.AddRange(arrPiles);
 }
 private void genNewGroupData1Pile(CPile pile)
 {
     if (this.oneGroupPilesNum == this.newGroupData.Piles.Count)
     {
         this.genNew1GroupData();
     }
     this.newGroupData.Piles.Add(pile);
 }
 void IPilesGroupView.setPile(CPile pile, int index)
 {
     switch (index)
     {
         case 0:
             this.ucPileView1.PileData = pile;
             break;
         case 1:
             this.ucPileView2.PileData = pile;
             break;
         case 2:
             this.ucPileView3.PileData = pile;
             break;
     }
 }
 internal void saveCurPile()
 {
     // 保存当前桩到桩数据库
     if (this.curPileState == CUR_PILE_STATE_NEW)
     {
         this.saveNewPile2DB();
     }
     else if (this.curPileState == CUR_PILE_STATE_EDIT)
     {
         this.saveEditPile2DB();
     }
     this.curPile = null;
     this.pileImagSrc = null;
     this.CurPileState = CUR_PILE_STATE_NON;
 }
        internal void choice(CPile pile)
        {
            if (this.isChoiceCorrect(pile))
            {
                this.onChoiceCorrect();
                return;
            }

            this.onChoiceErr();
        }
 void IPilesGroupView.setPile(CPile pile, int index)
 {
     this.ucPileView1.PileData = pile;
 }
 private void fill1Pile2PileView(CPile pile,int index)
 {
     view.setPile(pile,index);
 }
        private CPile dummyPile1()
        {
            CPile ret = new CPile();
            ret.PileNumber = "0";
            ret.PrimOrder = 1;
            ret.Word = "��";
            ret.Action = "����춣��";
            ret.Pic = Application.StartupPath + "\\pics\\20131114005.jpg";//"File:\\" + Application.StartupPath + "\\pics\\20131114005.jpg";

            return ret;
        }
        internal void saveNewEnt(CPile newEnt)
        {
            string sql = "insert into " + TABLE_NAME +
                " (" +
                FIELD_PILE_NUMBER + "," +
                FIELD_PILE_PIC + "," +
                FIELD_PILE_TYPE_ID + "," +
                FIELD_PILE_WORD + "," +
                FIELD_PILE_ROLE + "," +
                FIELD_PILE_ACTION + "," +
                FIELD_PRIM_ORDER +
                ") values(" +
                "'" + newEnt.PileNumber + "'," +
                "'" + newEnt.Pic + "'," +
                "'" + newEnt.PileTypeId + "'," +
                "'" + newEnt.Word + "'," +
                "'" + newEnt.Role + "'," +
                "'" + newEnt.Action + "'," +
                newEnt.PrimOrder
                +
                ")";

            this.exeNonQuerSql(sql);
        }
 private CPile create1EntByDtAndRowIndex(DataTable dtRet, int i)
 {
     CPile ret = new CPile();
     ret.PileNumber = dtRet.Rows[i][FIELD_PILE_NUMBER].ToString();
     ret.PileTypeId = dtRet.Rows[i][FIELD_PILE_TYPE_ID].ToString();
     ret.Pic = dtRet.Rows[i][FIELD_PILE_PIC].ToString();
     ret.Word = dtRet.Rows[i][FIELD_PILE_WORD].ToString();
     ret.Role = dtRet.Rows[i][FIELD_PILE_ROLE].ToString();
     ret.Action = dtRet.Rows[i][FIELD_PILE_ACTION].ToString();
     ret.PrimOrder = Int32.Parse(dtRet.Rows[i][FIELD_PRIM_ORDER].ToString());
     return ret;
 }
 private void createPile()
 {
     this.curPile = new CPile();
     this.curPile.PileTypeId = getCurPileTypeId();
 }
 internal void saveEntByPileNumberAndPileTypeId(CPile ent)
 {
     string sql = "update " + TABLE_NAME + " set " +
         FIELD_PILE_PIC + "='" + ent.Pic + "'," +
         FIELD_PILE_WORD + "='" + ent.Word + "'," +
         FIELD_PILE_ROLE + "='" + ent.Role + "'," +
         FIELD_PILE_ACTION + "='" + ent.Action + "'," +
         FIELD_PRIM_ORDER + "=" + ent.PrimOrder +
         " where " + FIELD_PILE_NUMBER + "='" + ent.PileNumber + "'" +
         " and " + FIELD_PILE_TYPE_ID + "='" + ent.PileTypeId + "'";
     this.exeNonQuerSql(sql);
 }
 private void cleanPiles()
 {
     this.pileLeft = null;
     this.pileRight = null;
 }
 protected virtual void concrectRemovePile(CPile pile)
 {
     throw new Exception("The method or operation is not implemented.");
 }
 void IPileForwardOrderOwnerController.removePile(CPile pile)
 {
     this.concrectRemovePile(pile);
 }
 private bool isChoiceCorrect(CPile pile)
 {
     if(pile.PrimOrder == this.curPicPile.PrimOrder)
     {
         return true;
     }
     return false;
 }
 protected override void concrectRemovePile(CPile pile)
 {
     this.piles.Remove(pile);
 }