//============================= 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]); }
protected override void Dispose(bool disposing) { if (disposing) { if (db != null) { db.Dispose(); db = null; } } base.Dispose(disposing); }
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); } }
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); } }
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); } }
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); } }
public int InsertFabricInfo(Fabrics fabric) { try { using (FabricGateway fabricsGateway = new FabricGateway()) { actionResult = fabricsGateway.InsertStyleInfo(fabric); } } catch (Exception ex) { } return(actionResult); }
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) { } }
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); }
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); }
public ClientController() { db = new Fabrics(); }
public OccupationController() { db = new Fabrics(); }