Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 3
0
 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;
     }
 }
Ejemplo n.º 4
0
 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();
        }
Ejemplo n.º 6
0
 void IPilesGroupView.setPile(CPile pile, int index)
 {
     this.ucPileView1.PileData = pile;
 }
 private void fill1Pile2PileView(CPile pile,int index)
 {
     view.setPile(pile,index);
 }
Ejemplo n.º 8
0
        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;
        }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
 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;
 }
Ejemplo n.º 11
0
 private void createPile()
 {
     this.curPile = new CPile();
     this.curPile.PileTypeId = getCurPileTypeId();
 }
Ejemplo n.º 12
0
 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);
 }