public IActionResult InsertData(InOut inOut) { if (inOut.id > 0) { int result = inOutManager.Update(inOut); if (result > 0) { return(Json("Success")); } else { return(Json("Fail")); } } else { inOut.create_time = DateTime.Now; int result = inOutManager.Insert(inOut); if (result > 0) { return(Json("Success")); } else { return(Json("Fail")); } } }
public ProcessAmount(Process process, int amount, bool isEndProcess, InOut amountInOrOut) { this.Process = process; this.Amount = amount; this.IsEndProcess = isEndProcess; this.AmountIsInOrOut = amountInOrOut; }
public SlopeRegion SetValue(Point2 _start, Point2 _end) { m_start = _start; m_end = _end; m_inOut = Point2.InOutOf(_start, _end); return(this); }
void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { triggerable = false; } if (triggerable) { if (!check) { if (other.CompareTag("Visor")) { particles.SetActive(false); StopAllCoroutines(); coll.isTrigger = false; rend.enabled = true; fading = true; typeFade = InOut.In; intensity = 0; StartCoroutine(StartParticles()); check = true; } } } }
/// <summary>Pops the top value off the stack and prints it to STDOUT as either a number or character, depending on the particular incarnation of this command.</summary> internal static State OutChr(State state, InOut io) { var value = (char)state.Stack.Peek(); io.Out(value); return(state.With(state.Stack.Pop())); }
private static string GetChiikiCode(byte data, InOut io) { byte[] data_bit = ByteToBinary(data); int code; if (io == InOut.In) { code = BinaryToInt32(data_bit, 1, 2); } else { code = BinaryToInt32(data_bit, 3, 2); } switch (code) { case 0: return("首都圏"); case 2: return("関西圏"); case 3: return("地方"); default: return($"不明({code:X2})"); } }
public ResidentAccessManagement(Resident res, double temp, InOut inout, string notes) { Resident = res; Tempreture = temp; In_Out = inout; Notes = notes; }
static void Main() { InOut.vaciarLog(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1(1)); }
public override void Do(ref Storage storage, Menu menu) { InOut.Alert($"Flight {storage.Flight.GetRouteInfo()} set off!"); storage.Flight = new Flight(); Active = false; menu.Elements[0].Active = true; }
//******************************************************************************************** private void ImportServer_Click(object sender, EventArgs e) { InOut inout = new InOut(true, null); inout.ShowDialog(); LoadList(); }
public ResponseWrapper <bool> In([FromRoute] int deviceId, [FromRoute] string granterId) { Device device; try { device = CheckDevice(deviceId, granterId); } catch (RestReturnException e) { return(new ResponseWrapper <bool>(false, e.Value)); } var inObj = new InOut { Type = InOutType.In, Device = device, OnDate = DateTime.Now }; _dbContext.InOut.Add(inObj); _dbContext.SaveChanges(); return(new ResponseWrapper <bool>(true, Constants.RestReturn.OK)); }
private static FileStream createStream(string path, InOut io) { if (io == InOut.In) { FileInfo inputFile = new FileInfo(path); if (!inputFile.Exists) { throw new FileNotFoundException(inputFile.FullName); } return(new FileStream(inputFile.FullName, FileMode.Open, FileAccess.Read, FileShare.Read)); } else if (io == InOut.Out) { FileInfo outputFile = new FileInfo(path); if (!outputFile.Directory.Exists) { outputFile.Directory.Create(); } return(new FileStream(outputFile.FullName, FileMode.Create, FileAccess.Write, FileShare.Write)); } else { throw new NotImplementedException(string.Format("InOut.{0}", io)); } }
public static void CreateDummyInout() { using (var db = new RentBikeEntities()) { var stores = db.Stores.Where(c => c.ACTIVE == true).ToList(); foreach (var store in stores) { if (db.InOuts.Any(c => c.INOUT_DATE == DateTime.Today && c.STORE_ID == store.ID)) { continue; } InOut io = new InOut(); io.IN_AMOUNT = 0; io.OUT_AMOUNT = 0; io.CONTRACT_ID = 1; io.PERIOD_ID = 1; io.RENT_TYPE_ID = 3; io.INOUT_TYPE_ID = 23; io.PERIOD_DATE = DateTime.Today; io.MORE_INFO = Constants.DUMMY_INOUT; io.STORE_ID = store.ID; io.SEARCH_TEXT = Constants.DUMMY_INOUT; io.INOUT_DATE = DateTime.Now; io.CREATED_BY = Constants.DUMMY_USER; io.CREATED_DATE = DateTime.Now; io.UPDATED_BY = Constants.DUMMY_USER; io.UPDATED_DATE = DateTime.Now; io.IS_DUMMY = true; db.InOuts.Add(io); } db.SaveChanges(); } }
public Transport() { var c_to_s = new InOut(); var s_to_c = new InOut(); ServerSide = new DuplexStream(s_to_c.ReadObservable, c_to_s); ClientSide = new DuplexStream(c_to_s.ReadObservable, s_to_c); }
public CommMethod(string name, ObservableCollection <Attribute> parameters, InOut inOutSuffix) { _id++; this.id = _id; this.name = name; this.parameters = parameters; this.inOutSuffix = inOutSuffix; }
/// <param name="inOrOut">0 - in, 1 - out</param> public BodyModuleInOutCrouch(PlayerBodyModule module, InOut inOut) : base(module) { _inOut = (int)inOut; _crouchingTime = 0f; CachedId = ID + $"_{inOut.ToString()}"; Debug.Log(CachedId); }
/// <summary>Pops the top value off the stack and toggles the CC that many times (the absolute value of that many times if negative).</summary> internal static State Switch(State state, InOut io) { return(state.With ( state.Pointer.Switch(state.Stack.First()), state.Stack.Pop() )); }
/// <summary>Pops the top value off the stack and rotates the DP clockwise that many steps (anticlockwise if negative).</summary> internal static State Rotate(State state, InOut io) { return(state.With ( state.Pointer.Rotate(state.Stack.First()), state.Stack.Pop() )); }
public ActionResult DeleteConfirmed(int id) { InOut inOut = db.InOut.Find(id); db.InOut.Remove(inOut); db.SaveChanges(); return(RedirectToAction("Index")); }
public override void Do(ref Storage storage, Menu menu) { Random rand = new Random(); storage.Flight.SetNumberOfTickets(rand.Next(1, 100)); InOut.Alert($"Tickets sold - {storage.Flight.NumberOfTicketsPurchased}!"); base.Do(ref storage, menu); }
public override void Do(ref Storage storage, Menu menu) { string start = InOut.Dialog("Enter the starting point:"); string end = InOut.Dialog("Enter the destenation point:"); storage.Flight.SetRoute(start, end); InOut.Alert("Route created!"); base.Do(ref storage, menu); }
private void Save() { BindingSource bslistSP = (BindingSource)dgvSP.DataSource; BindingList <ReceiptModel> listSP = (BindingList <ReceiptModel>)bslistSP.DataSource; int voucherNo = entities.Issues.Max(x => x.VNo).GetValueOrDefault() + 1; DAL.Model.Issue objIssue = new DAL.Model.Issue(); objIssue.VNo = voucherNo; objIssue.VDate = dtDate.Value; objIssue.CustType = ((KeyValuePair <string, string>)cmbCustType.SelectedValue).Key; objIssue.LCode = Convert.ToString(cmbCustomer.SelectedValue); objIssue.GrossWt = Convert.ToDecimal(txtTotalGsWt.Text.Trim()); objIssue.NetWt = Convert.ToDecimal(txtTotalNetWt.Text.Trim()); objIssue.MakingTotal = Convert.ToDecimal(txtTotalMakingRate.Text.Trim()); objIssue.CGST = Convert.ToDecimal(txtCGST.Text.Trim()); objIssue.SGST = Convert.ToDecimal(txtSGST.Text.Trim()); objIssue.NetTotal = Convert.ToDecimal(txtNetTotal.Text.Trim()); objIssue.Remarks = txtRemark.Text.Trim(); entities.Issues.Add(objIssue); foreach (ReceiptModel rcModel in listSP) { if (String.IsNullOrEmpty(rcModel.BarCode)) { //Add in InOut InOut model = new InOut(); model.SeqNo = rcModel.SeqNo; model.TDate = rcModel.TDate; model.PCode = rcModel.PCode; model.MetalType = rcModel.MetalType; model.TType = rcModel.InType; model.RefVNo = voucherNo; model.RefVouType = rcModel.RefVouType; model.Pcs = rcModel.Pcs; model.GrossWt = rcModel.GrossWt; model.NetWt = rcModel.NetWt; model.MakingRate = rcModel.MakingRate; model.TotalRate = rcModel.TotalRate; entities.InOuts.Add(model); } else { //Update in StockInfo var stockInfo = (from stk in entities.StockInfoes where stk.BarCode == rcModel.BarCode && (stk.OutBillNo == null || stk.OutBillNo <= 0) select stk).FirstOrDefault(); if (stockInfo != null) { stockInfo.OutBillNo = voucherNo; stockInfo.OutType = "I"; stockInfo.OutDate = dtDate.Value; entities.Entry(stockInfo).State = System.Data.Entity.EntityState.Modified; } } } entities.SaveChanges(); }
public static String pedirTextoNoVacio(String mensaje, String mensajeDeError) { String valor = InOut.pedirTexto(mensaje); while (valor.isEmpty()) { InOut.mostrar(mensajeDeError); valor = InOut.pedirTexto(mensaje); } return valor; }
internal Slot(Node node, string name, SlotType type, InOut mode, Colour?colour = null) { Name = name; Colour = colour ?? DefaultColour; Type = type; Mode = mode; Node = node; Index = mode == InOut.In ? node.InSlotCount++ : node.OutSlotCount++; }
public static void Main() { RandomNum rNA = new RandomNum(); BubbleSort bs = new BubbleSort(); InOut <int> hello = new InOut <int>(); // generic class ExecutionTimer eT = new ExecutionTimer(); // to test execution time // Requires User's Interaction *** *** *** // // Console.WriteLine( "Input the quanity or amount of numbers to sort: " ); // // int size = hello.AskUserMore(); // NON-generic function // // Console.WriteLine( "Input the upper limit (not inclusive) of the range that the generator can randomize e.g. 0 to ? : " ); // // int max = hello.AskUserMore(); // NON-generic function // // // random number generator for array (initialize & instantiate) // int[] test = rNA.RandNumArrGen(size, max); // // rNA.showArrayValues( test ); // // bs.bubblesorting( test ); // // System.Console.WriteLine("After sorting: "); // // rNA.showArrayValues( test ); // // End of Requires User's Interaction *** *** *** int[] test2 = rNA.RandNumArrGen(100, 100); rNA.showArrayValues(test2); eT.startTimer(); bs.bubblesorting(test2); eT.stopTimer(); eT.elapsedTime(); rNA.showArrayValues(test2); //////////////////////////////// // Time execution conclusion: // //////////////////////////////// // // RunTime 00:00:00.0000 ( for almost all tests with 100 elements ) // Output: // 0 0 4 4 5 6 7 8 10 12 13 14 15 17 17 18 18 18 19 19 20 20 22 22 22 24 25 26 26 26 27 27 28 28 28 29 31 31 31 32 34 34 34 40 41 41 43 43 43 45 46 46 46 47 47 48 51 51 52 52 53 53 57 58 65 65 66 67 67 70 71 71 71 71 72 72 72 74 75 75 75 78 80 81 81 81 84 87 87 89 89 91 93 96 96 98 98 98 99 99 // }
private void IDC_IOOK_BUTTON_Click(object sender, EventArgs e) { InOut = new InOut() { OnePlus = Int32.Parse(m_lp.Text), OneMinus = Int32.Parse(m_lm.Text), KPlus = Int32.Parse(m_kp.Text), KMinus = Int32.Parse(m_km.Text) }; this.Close(); }
public static void Run(string meshPath, string finiteElementType, double accuracy) { var totalTimer = StartMeasuringTaskTime("Total"); var readInputTimer = StartMeasuringTaskTime("Read input files"); var mesh = Mesh.ReadFromFile($"{meshPath}.mesh"); ShowMeshParameters(mesh); StopAndShowTaskTime(readInputTimer); var calculationTimer = StartMeasuringTaskTime("Calculation"); var feSpace = CreateFiniteElementSpace(finiteElementType, mesh); var g = new LambdaVectorField(v => 0); var conditions = new Dictionary <int, IVectorField>() { [1] = g, [2] = g, [3] = g, [4] = g }; int stepCount = 20; double t = 0, dt = 1.0 / stepCount; var bilinearForm = new BilinearForm( (u, v, du, dv) => dt * Vector2.Dot(du, dv) + u * v); var solver = new ConjugateGradient(accuracy); IVectorField previous = new LambdaVectorField((x, y) => Sin(PI * x) * Sin(PI * y)); for (int i = 0; i < stepCount; i++) { t += dt; Func <Vector2, double> f = v => (1 + 2 * PI * PI) * Exp(t) * Sin(PI * v.x) * Sin(PI * v.y); var rhs = new LambdaVectorField(v => previous.GetValueAt(v, 0) + dt * f(v)); var laplaceEquation = new Problem(feSpace, conditions, bilinearForm, rhs, solver); previous = laplaceEquation.Solve(); } StopAndShowTaskTime(calculationTimer); var errorCalculationTimer = StartMeasuringTaskTime("Error calculation"); var solution = (FiniteElementVectorField)previous; Func <double, double, double> uExact = (x, y) => Exp(t) * Sin(PI * x) * Sin(PI * y); var error = CalculateError(feSpace, uExact, solution); Console.WriteLine($"L2 Error = {error}"); StopAndShowTaskTime(errorCalculationTimer); var outputTimer = StartMeasuringTaskTime("Output"); InOut.WriteSolutionToFile($"{meshPath}.sol", mesh, solution); StopAndShowTaskTime(outputTimer); StopAndShowTaskTime(totalTimer); }
public Evaluator(Point3f[] points, InOut[] inout) { _points = points; _len = _points.Length; Debug.Assert(_len > 3); // should also check for non-coplanarity _inout = inout; Debug.Assert(_len <= _inout.Length); _bbox = ComputeBBox(); }
public static State Execute(this Command cmd, State state, InOut io) { if (commands.TryGetValue(cmd, out var command)) { return(command(state, io)); } else { throw new UnkownCommand(); } }
public ActionResult Edit([Bind(Include = "id,descripcion,fechaInOut,tipoInOut,cantidadInOut,ubicacionInOut")] InOut inOut) { if (ModelState.IsValid) { db.Entry(inOut).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ubicacionInOut = new SelectList(db.DataBodega, "id", "nombreBodega", inOut.ubicacionInOut); ViewBag.tipoInOut = new SelectList(db.tipoInOut, "id", "nombretipoInOut", inOut.tipoInOut); return(View(inOut)); }
private static State Run(this Program program, State state, InOut io, Logger logger) { var traversed = Traverse(state, program, logger); var current = program.SelectBlock(traversed); var cmd = current.Colour - traversed.Colour; var executed = cmd.TryExecute(traversed, io, logger); executed = executed.SelectBlock(current); return(executed); }
public static void CreateDummyInout() { using (var db = new RentBikeEntities()) { var stores = db.Stores.Where(c => c.ACTIVE == true).ToList(); foreach (var store in stores) { if (db.InOuts.Any(c => c.INOUT_DATE == DateTime.Today && c.STORE_ID == store.ID)) continue; InOut io = new InOut(); io.IN_AMOUNT = 0; io.OUT_AMOUNT = 0; io.CONTRACT_ID = 1; io.PERIOD_ID = 1; io.RENT_TYPE_ID = 3; io.INOUT_TYPE_ID = 23; io.PERIOD_DATE = DateTime.Today; io.MORE_INFO = Constants.DUMMY_INOUT; io.STORE_ID = store.ID; io.SEARCH_TEXT = Constants.DUMMY_INOUT; io.INOUT_DATE = DateTime.Now; io.CREATED_BY = Constants.DUMMY_USER; io.CREATED_DATE = DateTime.Now; io.UPDATED_BY = Constants.DUMMY_USER; io.UPDATED_DATE = DateTime.Now; io.IS_DUMMY = true; db.InOuts.Add(io); } db.SaveChanges(); } }