public SimulationModeItemManager(ContextMenuStrip contextMenuStrip, CarModelGraphicControl graphicControl) { model = new CarModel(new CarModelState(new PointD(ComMath.Normal(0, 0, 1, CarModelState.MIN_POS_X, CarModelState.MAX_POS_X), ComMath.Normal(0, 0, 1, CarModelState.MIN_POS_Y, CarModelState.MAX_POS_Y)), new PointD(0, 1))); finish = new FinishModel(new PointD(ComMath.Normal(0.5, 0, 1, CarModelState.MIN_POS_X, CarModelState.MAX_POS_X), ComMath.Normal(0.5, 0, 1, CarModelState.MIN_POS_Y, CarModelState.MAX_POS_Y)), 0); obstacles = new List <ObstacleModel>(); dragables = new List <IDragable>(); sampledCarState = model.state; dragables.Add(model); dragables.Add(finish); dragged = null; state = State.NONE; this.contextMenuStrip = contextMenuStrip; this.graphicControl = graphicControl; contextMenuStrip.Items[0].Click += new EventHandler(newObstacle); contextMenuStrip.Items[1].Click += new EventHandler(deleteObstacle); }
public ActionResult Finish() { FinishModel model = new FinishModel(); using (GrumServiceClient client = new GrumServiceClient()) { int groupRoomId = (int)Session["GroupRoomId"]; int groupSize = (int)Session["si"]; DateTime ds = (DateTime)Session["ds"]; DateTime df = (DateTime)Session["df"]; model.RentedGroupRoom = client.RentGroupRoom(groupRoomId, groupSize, ds, df); bool wh = (bool)Session["wh"]; bool mon = (bool)Session["mon"]; bool pr = (bool)Session["pr"]; if (!model.RentedGroupRoom) { model.ListedToClassRoom = client.RequestClassRoom(groupRoomId, groupSize, wh, mon, pr); } } return(View(model)); }
static void ImportProject(DatabaseIfc db) { #if IFCTest if (SQ.sql != null) { if (db.Project.GlobalId == ProjectModel.Set.Projectmodel.Code) { //the current model is the same as the IFC //TODO: ASk User if he want to replace the currently stored Data with the IFC One } var projectmodel = ProjectModel.Set.Projectmodel; #else var projectmodel = new ProjectModel(); #endif projectmodel.Code = db.Project.GlobalId; projectmodel.Name = db.Project.Name; IfcBuilding.ExtractBuilding(db); var walls = db.Where(o => o is IfcWall).Cast<IfcWall>(); foreach (var w in walls) { var finishmodel = new FinishModel(); IfcObjectType.ExtractTypicalProperties(w, finishmodel); finishmodel.FinishLib = IfcObjectType.ExtractType(w) as FinishLib; finishmodel.FinishLib.InsertOrReplace(); IfcData.InsertOrReplaceAll(finishmodel.FinishLib.Additional_Info); IfcData.InsertOrReplaceAll(finishmodel.Additional_Info); IfcMaterial.ExtractMaterial(w).ForEach(m=> { m.SetFkeyParent(finishmodel.FinishLib); m.InsertOrReplace(); }); finishmodel.InsertOrReplace(); } #if IFCTest } else { Utility.Constants.MainWindow.ShowModalMessageExternal("Please create a project first", ""); } #endif }
public async Task <IActionResult> Index(FinishFormModel formModel) { Console.WriteLine("File Session Id: " + formModel.FileSessionId); // Set Status to Finializing var sessionResponse = SetSessionStatus(formModel.SessionId, "Finializing"); // Initiate Snapshot var client = new HttpAuthClient(); var response = await StartSnapshot(formModel.SessionId, formModel.FileSessionId); var snapshotResponse = await WaitForSnapshotResponse(formModel.SessionId, formModel.FileSessionId); // Download Snapshot var snapshotStream = await DownloadSnapshot(snapshotResponse.DownloadURL); Console.WriteLine("Download URL: " + snapshotResponse.DownloadURL); // Delete Session response = await DeleteSession(formModel.SessionId); // Start Checkin var projectFilesResponse = await CheckinProjectFile(formModel.ProjectId, formModel.FileProjectId); var projectsHelper = new ProjectsHelper(); var awsStrResponse = await projectsHelper.UploadToAWS(projectFilesResponse, snapshotStream); Console.WriteLine("AWS Response: " + awsStrResponse); // Confirm Checkin response = await ConfirmCheckin(formModel.ProjectId, formModel.FileProjectId); var flattenResponse = await StartFlattenJob(formModel.ProjectId, formModel.FileProjectId); // Get Shared Link var sharedLinkResponse = await GetShareLink(formModel.ProjectId, formModel.FileProjectId); var model = new FinishModel() { ProjectLink = sharedLinkResponse.ShareLink }; return(View(model)); }
//public ActionResult JumpToCartContainer(int? memberId, int? orderId) //{ // return View(); //} //public ActionResult JumpToCart(int? memberId) //{ // if (memberId.HasValue) // { // CreditCardBillingModel billingModel = GetCreditCardBillingModel(memberId); // return View(billingModel); // } // else // return View(); //} //public ActionResult nmi(int orderId) //{ // SubmissionForNmiModel model = new SubmissionForNmiModel // { // amt = "25", // gwPayId = "6", // nmiOrderId = orderId.ToString(), // }; // return View(model); //} /* * ' ************************************************************************************************** * ' * GatewaySale (function) * ' ************************************************************************************************** * ' Returns True on Success, False on Failure */ /* * private bool GatewaySale(string amount, string ccnumber, string ccexp, string cvv, string name, string address, string zip) * { * Set OGateway = Server.CreateObject("MSXML2.ServerXMLHTTP") * OGateway.Open "POST", "https://secure.durango-direct.com/api/transact.php", false * OGateway.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" * DataToSend = "username="******"&password="******"&ccnumber=" & Server.URLEncode(ccnumber) &_ * "&ccexp=" & Server.URLEncode(ccexp) &_ * "&cvv=" & Server.URLEncode(nmi_cvv) &_ * "&amount=" & Server.URLEncode(amount) &_ * "&firstname=" & Server.URLEncode(name) &_ * "&address1=" & Server.URLEncode(address) &_ * "&zip=" & Server.URLEncode(zip) * * OGateway.Send DataToSend * * ResponseString = OGateway.responseText * Results = Split(ResponseString, "&") * * GatewaySale = False * For Each i in Results * Result = Split(i,"=") * If UBound(Result)>0 Then * If LCase(Result(0)) = "response" Then * If Result(1) = "1" Then * GatewaySale = True * End If * End If * End If * Next ' i * End Function * */ public ActionResult Finish(int?orderId) { if (orderId.HasValue) { Order order = new Order(); OrderData orderData = order.GetOrderInfoById <OrderData>(orderId.Value); Member member = new Member(false); MemberDemographicData memberData = member.GetMemberInfoById <MemberDemographicData>(orderData.MemberId); FinishModel model = new FinishModel(); model.MemberId = orderData.MemberId; model.FullName = memberData.FirstName + " " + memberData.LastName; model.Processing = 0; model.SubTotal = 25; return(View(model)); } else { return(View()); } }