Exemplo n.º 1
0
        private void SaveV_Click(object sender, EventArgs e)
        {
            try
            {
                AX.Enabled = false;
                AY.Enabled = false;
                AZ.Enabled = false;

                BX.Enabled = false;
                BY.Enabled = false;
                BZ.Enabled = false;

                Point p1 = new Point(Int32.Parse(AX.Text), Int32.Parse(AY.Text), Int32.Parse(AZ.Text));
                Point p2 = new Point(Int32.Parse(BX.Text), Int32.Parse(BY.Text), Int32.Parse(BZ.Text));

                Vectors vectros = new Vectors(p1, p2);

                Calculate.AppendText(vectros.Calculate());
                Scalar.AppendText(p1.ScalarV(p2) + ";");
                Collinearity.AppendText(vectros.IsCollinearity());
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);

                AX.Clear();
                AY.Clear();
                AZ.Clear();

                BX.Clear();
                BY.Clear();
                BZ.Clear();
            }
        }
Exemplo n.º 2
0
    public string checkFiscalYear(string month, string year)
    {
        string FY = "";

        try
        {
            int MM, CY, AY;

            MM = Int32.Parse(month);
            CY = Int32.Parse(year);
            if (MM < 4)
            {
                AY = CY - 1;
                FY = AY.ToString() + "/" + CY.ToString().Substring(2, 2);
            }
            else if (MM >= 4)
            {
                AY = CY + 1;
                FY = CY.ToString() + "/" + AY.ToString().Substring(2, 2);
            }
            else
            {
            }
        }
        catch
        {
        }
        return(FY);
    }
Exemplo n.º 3
0
        public Player()
        {
            this.playState = PlayStatus.Stopped;
            for (int i = 0; i < ayEmus.Length; i++)
            {
                ayEmus[i] = new AY();
                ayEmus[i].SetChipType(LibAYEmu.Chip.AY_Kay, null);
            }
            streamer = new PlaybackStreamer();
            streamer.BufferLengthInMs = 2 * GENSOUND_PERIOD;
            streamer.FillBuffer      += new EventHandler <FillBufferEventArgs>(OnFillBuffer);

            this.LimitLoops = -1;
            this.Volume     = 1.0;
        }
Exemplo n.º 4
0
        private void Reset_Click(object sender, EventArgs e)
        {
            AX.Clear();
            AY.Clear();
            AZ.Clear();

            BX.Clear();
            BY.Clear();
            BZ.Clear();

            Calculate.Clear();
            Scalar.Clear();
            Collinearity.Clear();

            AX.Enabled = true;
            AY.Enabled = true;
            AZ.Enabled = true;

            BX.Enabled = true;
            BY.Enabled = true;
            BZ.Enabled = true;
        }
Exemplo n.º 5
0
        public ActionResult CCenterList()
        {
            int userId = (int)Session[CDictionary.SK_LOGINED_USER_ID];
            var w      = (
                from o in db.OrderList
                where o.cId == userId
                join p in db.Product on o.pId equals p.pId
                select new CartVM
            {
                totalPrice = ((decimal)(o.oQty * p.pPrice))
            });

            if (db.OrderList.FirstOrDefault(o => o.cId == userId) != null)
            {
                Session[CDictionary.TK_Cart_TOTALPRICE] = w.Sum(p => p.totalPrice).ToString("0.##");
            }
            else
            {
                Session[CDictionary.TK_Cart_TOTALPRICE] = 0;
            }


            var user = (from c in db.Customer
                        join a in db.Admin on c.cId equals a.cId into AX
                        join cp in db.Company on c.CPId equals cp.CPId into AY
                        from x in AX.DefaultIfEmpty()
                        from y in AY.DefaultIfEmpty()


                        where c.cId == userId

                        select new vMemberCenterVM
            {
                firstName = c.cFName,
                lastName = c.cLName,
                email = c.cEmail,
                phoneNumber = c.cPhone,
                avatar = c.cAvatar,
                point = c.cPoint,
                birthday = c.cBD,
                companyId = c.CPId,
                companyAdd = y.CPAdd,
                companyBranch = y.CPBranch,
                companyName = y.CPName,
                aId = x.aId,
                adminDepartment = x.aDepartment,
                tp = w.Sum(p => p.totalPrice).ToString(),
                // tax=( w.Sum(p => p.totalPrice)*(decimal)0.12).ToString("0.##")
            }).FirstOrDefault();


            // Session[CDictionary.TK_Cart_TOTALPRICE] = x.Sum(a=>a.totalPrice).ToString();
            // Session[CDictionary.TK_Cart_TOTALPRICE] = w.Select(a => a.totalPrice).ToString();

            if (Session[CDictionary.SK_LOGINED_USER_ID] != null && Session[CDictionary.SK_LOGINED_ADMIN_ID] != null)
            {
                Session[CDictionary.SK_LOGINED_ADMIN_ID] = user.aId;
            }

            return(View(user));
        }