//============================= Constructor =====================================
 public TShirt(Fabrics fabric, Colors color, Sizes size)
 {
     TShirtFabric = fabric;
     TShirtColor  = color;
     TShirtSize   = size;
     TShirtPrice  = (Color.Cost[color] + Fabric.Cost[fabric] + Size.Cost[size]);
 }
Пример #2
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (db != null)
                {
                    db.Dispose();
                    db = null;
                }
            }

            base.Dispose(disposing);
        }
Пример #3
0
        void Fabrics_notHaveSpaceToMoreSCV(Fabrics obj)
        {
            if (soundActive)
            {
                casetera.Play(obj.notHaveFood);
            }

            if (netcm != null)
            {
                //netcm.sendData(new NetInformation(GameStatus.ready, GameCommands.playSound, -1, null, null, obj.notHaveFood));
                netcm.sendSound(obj.notHaveFood);
            }
        }
Пример #4
0
        void Fabrics_healtCompleted(Fabrics obj)
        {
            if (soundActive)
            {
                casetera.Play(obj.healt);
            }

            if (netcm != null)
            {
                //netcm.sendData(new NetInformation(GameStatus.ready, GameCommands.playSound, -1, null, null, obj.healt));

                netcm.sendSound(obj.healt);
            }
        }
Пример #5
0
        void Fabrics_notHaveMineralToBuy(Fabrics obj)
        {
            if (soundActive)
            {
                casetera.Play(obj.notMineralSuficient);
            }

            if (netcm != null)
            {
                //netcm.sendData(new NetInformation(GameStatus.ready, GameCommands.playSound, -1, null, null, obj.notMineralSuficient));

                netcm.sendSound(obj.notMineralSuficient);
            }
        }
Пример #6
0
        void Fabrics_mineralReseived(Fabrics obj)
        {
            if (soundActive)
            {
                casetera.Play(obj.startSound);
            }

            if (netcm != null)
            {
                //netcm.sendData(new NetInformation(GameStatus.ready, GameCommands.playSound, -1 , null, null, obj.startSound));

                netcm.sendSound(obj.startSound);
            }
        }
Пример #7
0
 public int InsertFabricInfo(Fabrics fabric)
 {
     try
     {
         using (FabricGateway fabricsGateway = new FabricGateway())
         {
             actionResult = fabricsGateway.InsertStyleInfo(fabric);
         }
     }
     catch (Exception ex)
     {
     }
     return(actionResult);
 }
Пример #8
0
    protected void submitButton_Click(object sender, EventArgs e)
    {
        Fabrics         fabric    = new Fabrics();
        FabricsEntryBLL fabricBLL = new FabricsEntryBLL();

        try
        {
            fabric.FabricType = fabricTypeTextBox.Text;
            fabric.FabricName = fabricNameTextBox.Text;

            if (fabricTypeTextBox.Text == "" || fabricTypeTextBox.Text == null)
            {
                messageLabel.Text = "Please Enter Fabric Type..";
                table             = LoadFabricInfo();
            }
            else if (fabricNameTextBox.Text == "" || fabricNameTextBox.Text == null)
            {
                messageLabel.Text = "Please Enter Fabric Name..";
                table             = LoadFabricInfo();
            }
            else
            {
                actionResult = fabricBLL.InsertFabricInfo(fabric);
                if (actionResult == 1)
                {
                    messageLabel.Text      = "Fabric Information Has Been Sucessfully Inserted...";
                    fabricTypeTextBox.Text = "";
                    fabricNameTextBox.Text = "";
                    table = LoadFabricInfo();
                }
                else
                {
                    messageLabel.Text = "Operation failed...";
                    table             = LoadFabricInfo();
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
Пример #9
0
    public int InsertStyleInfo(Fabrics fabric)
    {
        try
        {
            OpenConnection();
            ArrayList arlSqlParameter = new ArrayList();

            arlSqlParameter.Add(new SqlParameter("@FabricType", fabric.FabricType));
            arlSqlParameter.Add(new SqlParameter("@FabricName", fabric.FabricName));
            actionResult = this.ExecuteActionQuery("[Kp].[USP_InsertFabricTypeInfo]", arlSqlParameter);
        }

        catch (Exception ex)
        {
        }
        finally
        {
            CloseConnection();
        }
        return(actionResult);
    }
Пример #10
0
        public GameState GoNextState()
        {
            //end of state
            if (CurrentState == GameState.FixCosts)
            {
                //nothing
            }
            else if (CurrentState == GameState.UpdateMarket)
            {
                //nothing
            }
            else if (CurrentState == GameState.MatRequest)
            {
                RequestsOfMat = Bank.RequestOfMat(RequestsOfMat);
                foreach (Demand demand in RequestsOfMat)
                {
                    GetDirector(demand.Priority).MakeRequestOfMat(demand.Price, demand.UMat);
                }
                RequestsOfMat.Clear();
            }
            else if (CurrentState == GameState.Production)
            {
                foreach (Director director in Directors)
                {
                    director.NextState(this);
                }
            }
            else if (CurrentState == GameState.ProdRequest)
            {
                RequestsOfProd = Bank.RequestOfProd(RequestsOfProd);
                foreach (Offer offer in RequestsOfProd)
                {
                    GetDirector(offer.Priority).MakeRequestOfProd(offer.Price, offer.UProd);
                }
                RequestsOfProd.Clear();
            }
            else if (CurrentState == GameState.BuildUpgrade)
            {
                foreach (Director director in Directors)
                {
                    director.UpdateFabCosts();
                }
            }

            CurrentState = GetNextState;

            // start of new state
            if (CurrentState == GameState.FixCosts)
            {
                CurrentMonth += 1;
                Director currentMain = GetDirector(0);
                foreach (Director director in Directors.ToList())
                {
                    director.NextState(this);
                    if (director.IsBankrupt)
                    {
                        if (currentMain != null)
                        {
                            CurrentMainDirector--;
                        }
                        Directors.Remove(director);
                    }
                    if (currentMain == director)
                    {
                        currentMain = null;
                    }
                }
                CurrentMainDirector = (CurrentMainDirector + 1) % Directors.Count;
            }
            else if (CurrentState == GameState.UpdateMarket)
            {
                Bank.NextState(this);
            }
            else if (CurrentState == GameState.MatRequest)
            {
                //wait for requests
            }
            else if (CurrentState == GameState.Production)
            {
                //wait for production
            }
            else if (CurrentState == GameState.ProdRequest)
            {
                //wait for requests
            }
            else if (CurrentState == GameState.BuildUpgrade)
            {
                foreach (Fabric fabric in Fabrics.ToList())
                {
                    fabric.NextState(this);
                }
            }

            return(CurrentState);
        }
Пример #11
0
 public ClientController()
 {
     db = new Fabrics();
 }
Пример #12
0
 public OccupationController()
 {
     db = new Fabrics();
 }