Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 3
0
 public SlopeRegion SetValue(Point2 _start, Point2 _end)
 {
     m_start = _start;
     m_end   = _end;
     m_inOut = Point2.InOutOf(_start, _end);
     return(this);
 }
Ejemplo n.º 4
0
    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;
                }
            }
        }
    }
Ejemplo n.º 5
0
        /// <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()));
        }
Ejemplo n.º 6
0
Archivo: Suica.cs Proyecto: FJB2784/NFC
        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})");
            }
        }
Ejemplo n.º 7
0
 public ResidentAccessManagement(Resident res, double temp, InOut inout, string notes)
 {
     Resident   = res;
     Tempreture = temp;
     In_Out     = inout;
     Notes      = notes;
 }
Ejemplo n.º 8
0
 static void Main()
 {
     InOut.vaciarLog();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new Form1(1));
 }
Ejemplo n.º 9
0
 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;
 }
Ejemplo n.º 10
0
        //********************************************************************************************
        private void ImportServer_Click(object sender, EventArgs e)
        {
            InOut inout = new InOut(true, null);

            inout.ShowDialog();
            LoadList();
        }
Ejemplo n.º 11
0
        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));
        }
Ejemplo n.º 12
0
 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));
     }
 }
Ejemplo n.º 13
0
        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();
            }
        }
Ejemplo n.º 14
0
            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);
            }
Ejemplo n.º 15
0
 public CommMethod(string name, ObservableCollection <Attribute> parameters, InOut inOutSuffix)
 {
     _id++;
     this.id          = _id;
     this.name        = name;
     this.parameters  = parameters;
     this.inOutSuffix = inOutSuffix;
 }
Ejemplo n.º 16
0
        /// <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);
        }
Ejemplo n.º 17
0
 /// <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()
            ));
 }
Ejemplo n.º 18
0
 /// <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"));
        }
Ejemplo n.º 20
0
        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);
        }
Ejemplo n.º 21
0
        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);
        }
Ejemplo n.º 22
0
        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();
        }
Ejemplo n.º 23
0
		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;
		}
Ejemplo n.º 24
0
        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++;
        }
Ejemplo n.º 25
0
    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
        //
    }
Ejemplo n.º 26
0
 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);
        }
Ejemplo n.º 28
0
        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();
        }
Ejemplo n.º 29
0
 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));
 }
Ejemplo n.º 31
0
        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);
        }
Ejemplo n.º 32
0
        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();
            }
        }