protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Master.HeadingMessage("Material Details(" + Request.QueryString["MAT_CODE1"] + ")");
            MR.MasterTableView.AllowPaging = false;
            MR.Rebind();
            decimal mr_sum = WebTools.DSum("MR_QTY", "VIEW_MAT_REQUISITION", "CLIENT_PART_NO='" + Request.QueryString["MAT_CODE1"] + "'");
            lblMrCnt.Text = "Count :" + MR.MasterTableView.Items.Count.ToString();
            lblMrSum.Text = "Sum :" + mr_sum.ToString();

            PO.MasterTableView.AllowPaging = false;
            PO.Rebind();
            decimal po_sum = WebTools.DSum("PO_QTY", "VIEW_PO_REPORT_MAIN", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'");
            lblPoCnt.Text = "Count :" + PO.MasterTableView.Items.Count.ToString();
            lblPoSum.Text = "Sum :" + po_sum.ToString();

            Batch.MasterTableView.AllowPaging = false;
            Batch.Rebind();
            decimal batch_sum = WebTools.DSum("BATCH_QTY", "VIEW_PO_BATCH_PLAN_DETAIL", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'");
            lblBatchCnt.Text = "Count :" + Batch.MasterTableView.Items.Count.ToString();
            lblBatchSum.Text = "Sum :" + batch_sum.ToString();

            IRN.MasterTableView.AllowPaging = false;
            IRN.Rebind();
            decimal irn_sum = WebTools.DSum("RELEASE_QTY", "VIEW_PO_IRN_DETAIL_REP", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'");
            lblIrnCnt.Text = "Count :" + IRN.MasterTableView.Items.Count.ToString();
            lblIrnSum.Text = "Sum :" + irn_sum.ToString();

            MRR.MasterTableView.AllowPaging = false;
            MRR.Rebind();
            decimal mrr_sum = WebTools.DSum("RECV_QTY", "VIEW_MAT_RCV_REPORT_DT", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'");
            lblMrrCnt.Text = "Count :" + MRR.MasterTableView.Items.Count.ToString();
            lblMrrSum.Text = "Sum :" + mrr_sum.ToString();

            RFI.MasterTableView.AllowPaging = false;
            RFI.Rebind();
            decimal rfi_sum = WebTools.DSum("INSP_QTY", "VIEW_MAT_RFI_REPORT", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'");
            lblRfiCnt.Text = "Count :" + RFI.MasterTableView.Items.Count.ToString();
            lblRfiSum.Text = "Sum :" + rfi_sum.ToString();

            MRIR.MasterTableView.AllowPaging = false;
            MRIR.Rebind();
            decimal mrir_sum = WebTools.DSum("ACPT_QTY", "VIEW_MAT_MRIR_REPORT", "MAT_CODE='" + Request.QueryString["MAT_CODE1"] + "'");
            lblMrirCnt.Text = "Count :" + MRIR.MasterTableView.Items.Count.ToString();
            lblMrirSum.Text = "Sum :" + mrir_sum.ToString();

            MaterialRequest.MasterTableView.AllowPaging = false;
            MaterialRequest.Rebind();
            decimal mat_req_sum = WebTools.DSum("REQ_QTY", "VIEW_MATERIAL_REQUEST_DT1", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'");
            lblMaterialRequestCnt.Text = "Count :" + MaterialRequest.MasterTableView.Items.Count.ToString();
            lblMaterialRequestSum.Text = "Sum :" + mat_req_sum.ToString();

            MTN.MasterTableView.AllowPaging = false;
            MTN.Rebind();
            decimal mtn_sum = WebTools.DSum("TRANSF_QTY", "VIEW_ADAPTER_MAT_TRANSF_DT1", "MATERIAL_CODE='" + Request.QueryString["MAT_CODE1"] + "'");
            lblMtnCnt.Text = "Count :" + MTN.MasterTableView.Items.Count.ToString();
            lblMtnSum.Text = "Sum :" + mtn_sum.ToString();

            MTNreceive.MasterTableView.AllowPaging = false;
            MTNreceive.Rebind();
            decimal mtn_recv_sum = WebTools.DSum("RCV_QTY", "VIEW_MAT_TRANSFER_RCV_DT", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'");
            lblMtnRcvCnt.Text = "Count :" + MTNreceive.MasterTableView.Items.Count.ToString();
            lblMtnRcvSum.Text = "Sum :" + mtn_recv_sum.ToString();

            MIV.MasterTableView.AllowPaging = false;
            MIV.Rebind();
            decimal miv_sum = WebTools.DSum("ISSUE_QTY", "VIEW_ADAPTER_ISSUE_ADD_DETAIL", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'");
            lblMivCnt.Text = "Count :" + MIV.MasterTableView.Items.Count.ToString();
            lblMivSum.Text = "Sum :" + miv_sum.ToString();

            Reconcilation.MasterTableView.AllowPaging = false;
            Reconcilation.Rebind();
            decimal recon_sum = WebTools.DSum("BAL_QTY", "VIEW_ITEM_REP_A", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'");
            lblReconCnt.Text = "Count :" + Reconcilation.MasterTableView.Items.Count.ToString();
            lblReconSum.Text = "Sum :" + recon_sum.ToString();
        }
    }
コード例 #2
0
        protected override void Run()
        {
            //code for the command line
            if (RealH == "true")
            {
                Console.Write("Limited Mode> ");
            }
            else
            {
                Console.Write(username + "| " + current_directory + "> ");
            }
            var input = Console.ReadLine().ToLower();

            shell = input;
            //misc commands
            if (input.StartsWith("echo "))
            {
                var text = Kernel.shell.Substring(5);

                Console.WriteLine(text);
            }

            else if (input == "cls")
            {
                Console.Clear();
            }



            //info amd help
            else if (input == "cmd")
            {
                //lists all commands
                if (RealH == "false")
                {
                    Console.WriteLine("");
                    Console.BackgroundColor = ConsoleColor.Gray;
                    Console.ForegroundColor = ConsoleColor.Black;
                    Console.WriteLine("|List of Commands/Apps on Limited Mode|");
                    Bcolor();
                    Console.WriteLine("");

                    Console.WriteLine("Info/help Commands:");
                    Bcolor();
                    Console.WriteLine(" cmd - Shows all commands");
                    Console.WriteLine(" about - about the Operating System");
                    Console.WriteLine(" new - New Features in Build");

                    Console.WriteLine("Misc Commands:");
                    Bcolor();
                    Console.WriteLine(" cls - Clears the screen");
                    Console.WriteLine(" echo - Repeats Text Given");

                    Console.WriteLine("Programs:");
                    Bcolor();
                    Console.WriteLine(" time - tells the time");
                    Console.WriteLine(" piano - Piano Program");
                    Console.WriteLine(" calc - Simple calculator");

                    Console.WriteLine("Games:");
                    Bcolor();
                    Console.WriteLine(" numguess - A Number Guessing Game");
                    Console.WriteLine(" snake - A Classic Game of Snake");

                    Console.WriteLine("Power Commands:");
                    Bcolor();
                    Console.WriteLine(" shutdown - Powers off your computer");
                    Console.WriteLine(" restart - Restarts your computer");
                    Console.WriteLine("");
                }
                else
                {
                    Console.WriteLine("");
                    Console.BackgroundColor = ConsoleColor.Gray;
                    Console.ForegroundColor = ConsoleColor.Black;
                    Console.WriteLine("|List of Commands/Apps|");
                    Bcolor();
                    Console.WriteLine("");

                    Console.WriteLine("Info/help Commands:");
                    Bcolor();
                    Console.WriteLine(" cmd - Shows all commands");
                    Console.WriteLine(" about - about the Operating System");
                    Console.WriteLine(" new - New Features in Build");

                    Console.WriteLine("Misc Commands:");
                    Bcolor();
                    Console.WriteLine(" cls - Clears the screen");
                    Console.WriteLine(" echo - Repeats Text Given");

                    Console.WriteLine("File System:");
                    Bcolor();
                    Console.WriteLine(" drive - Displays drive info");
                    Console.WriteLine(" dir - displays all files and sub-dirs in directory");
                    Console.WriteLine(" mkdir - Makes a Directory");
                    Console.WriteLine(" rmdir - Removes a Directory");
                    Console.WriteLine(" cd - Changes current directory");
                    Console.WriteLine(" type - Quickly Types out file content (use MIV to view files)");
                    Console.WriteLine(" del - deletes specified file");
                    Console.WriteLine(" copy - copies a file to the location given");
                    Console.WriteLine(" move - moves a file to the location given");
                    Console.WriteLine(" format - Formats the drive");
                    Console.WriteLine("Press any key to Continue...");
                    Console.ReadKey();

                    Console.WriteLine("Programs:");
                    Bcolor();
                    Console.WriteLine(" time - tells the time");
                    Console.WriteLine(" piano - Piano Program");
                    Console.WriteLine(" mkcal - Creates a calender");
                    Console.WriteLine(" chkcal - checks for a calender");
                    Console.WriteLine(" calc - Simple calculator");
                    Console.WriteLine(" MIV - Text Editor");

                    Console.WriteLine("Games:");
                    Bcolor();
                    Console.WriteLine(" numguess - A Number Guessing Game");
                    Console.WriteLine(" snake - A Classic Game of Snake");

                    Console.WriteLine("Power Commands:");
                    Bcolor();
                    Console.WriteLine(" shutdown - Powers off your computer");
                    Console.WriteLine(" restart - Restarts your computer");
                    Console.WriteLine("");
                }
            }

            else if (input == "about")
            {
                //about the OS
                Console.BackgroundColor = ConsoleColor.Gray;
                Console.ForegroundColor = ConsoleColor.Black;
                Console.WriteLine("PC Info:");
                Bcolor();
                Console.WriteLine("Ram:" + Cosmos.Core.CPU.GetAmountOfRAM() + "MB");

                Console.BackgroundColor = ConsoleColor.Gray;
                Console.ForegroundColor = ConsoleColor.Black;
                Console.WriteLine("\nOS Info:");
                Bcolor();
                Console.WriteLine("Sia OS 1.2");
                Console.WriteLine("Built on 4/13/2021.");
                Console.WriteLine("Sia OS is Created by Evyn Vega.");
                Console.WriteLine("Cosmos belongs to the COSMOS Project.");
                //Console.WriteLine("Some code in the project is not mine and some are from the Cobalt and Aura \nProjects.");
            }

            else if (input == "new")
            {
                Console.BackgroundColor = ConsoleColor.Gray;
                Console.ForegroundColor = ConsoleColor.Black;
                Console.WriteLine("|Whats New in 1.2?|\n");
                Bcolor();
                Console.WriteLine("Features and Additions");
                Console.WriteLine("- Snake Game.");
                Console.WriteLine("- Dir command has switches /w(default) /l(list).");
                Console.WriteLine("- Piano 2.0 (More keys).");
                Console.WriteLine("- About command can now tell CPU info.");
                Console.WriteLine("Change Log:");
                Console.WriteLine("- Dir command defaults to the wide format.");
                Console.WriteLine("- Color Personalization Removed");
                Console.WriteLine("- You can now exit out and go into Limited mode at anytime at prompt");
            }

            //File System Commands
            else if (input.StartsWith("cd "))
            {
                if (RealH == "false")
                {
                    chngdir.cd();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input.StartsWith("mkdir "))
            {
                if (RealH == "false")
                {
                    mkd.mkdir();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input.StartsWith("rmdir "))
            {
                if (RealH == "false")
                {
                    rmd.rmdir();
                }
                else
                {
                    RH.RError();
                }
            }

            //dir regular. I am to lazy and too dumb to make it work into one thing.
            else if (input == "dir")
            {
                if (RealH == "false")
                {
                    Files.dir();
                }
                else
                {
                    RH.RError();
                }
            }
            //dir option
            else if (input.StartsWith("dir "))
            {
                if (RealH == "false")
                {
                    Files.diropt();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input == "drive")
            {
                if (RealH == "false")
                {
                    DRV.drives();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input == "miv")
            {
                if (RealH == "false")
                {
                    MIV.StartMIV();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input.StartsWith("type "))
            {
                if (RealH == "false")
                {
                    open.type();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input.StartsWith("del "))
            {
                if (RealH == "false")
                {
                    dl.del();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input.StartsWith("copy "))
            {
                if (RealH == "false")
                {
                    cpy.copy();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input.StartsWith("move "))
            {
                if (RealH == "false")
                {
                    mv.move();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input == "format")
            {
                if (RealH == "false")
                {
                    frm.format();
                }
                else
                {
                    RH.RError();
                }
            }

            // Misc Applications
            else if (input == "time")
            {
                if (time == "12hour")
                {
                    Console.WriteLine(DateTime.UtcNow);
                }
                else
                {
                    Console.WriteLine(DateTime.Now);
                }
            }

            else if (input == "mkcal")
            {
                Calender.mkcal();
            }

            else if (input == "chkcal")
            {
                if (RealH == "false")
                {
                    try
                    {
                        Console.Write("What day do you want to check for (Example: 1-1-2020): ");
                        var day = Console.ReadLine().ToLower();
                        if (File.Exists(day + ".cal"))
                        {
                            Console.BackgroundColor = ConsoleColor.Black;
                            Console.ForegroundColor = ConsoleColor.Yellow;
                            Console.WriteLine("You have a Calender! Type 'open " + day + ".cal' to veiw it.");
                            Console.ResetColor();
                        }
                        else
                        {
                            Console.WriteLine("You have no calenders for that day");
                        }
                    }
                    catch (Exception Ex)
                    {
                        Console.WriteLine("Woah Sia OS just ran into a issue, here's some details.");
                        Console.WriteLine(Ex.ToString());
                    }
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input == "piano")
            {
                Console.WriteLine("Cat Piano ver 1.0");
                Console.WriteLine("Press any key to continue");

                Piano.Pian();
            }

            else if (input == "calc")
            {
                Calculator.Calc();
            }

            else if (input == "setup")
            {
                if (RealH == "false")
                {
                    Setup.SetupStart();
                }
                else
                {
                    RH.RError();
                }
            }

            //Games (I stole lmao)
            else if (input == "numguess")
            {
                try
                {
                    Random random = new Random();

                    int returnValue = random.Next(1, 100);
                    int Guess       = 0;
                    int numGuesses  = 0;

                    Console.WriteLine("I am thinking of a number between 1-100.  Can you guess what it is?");

                    while (Guess != returnValue)
                    {
                        Guess = Convert.ToInt32(Console.Read());
                        string line = Console.ReadLine();   // Get string from user
                        if (!int.TryParse(line, out Guess)) // Try to parse the string as an integer
                        {
                            Console.WriteLine("Not an integer!");
                        }
                        else
                        {
                            numGuesses++;
                            if (Guess < returnValue)
                            {
                                Console.WriteLine("No, the number I am thinking of is higher than " + Guess + " .  Can you guess what it is?");
                            }
                            if (Guess > returnValue)
                            {
                                Console.WriteLine("No, the number I am thinking of is lower than " + Guess + " .  Can you guess what it is");
                            }
                        }
                    }
                    Console.WriteLine("Well done! The answer was " + returnValue + ".\nYou took " + numGuesses + " guesses.");
                }
                catch (Exception Ex)
                {
                    Console.WriteLine("Woah Sia OS just ran into a issue, here's some details.");
                    Console.WriteLine(Ex.ToString());
                }
            }

            else if (input == "snake")
            {
                SnakeGame.Init();
            }

            //Power
            else if (input == "shutdown")
            {
                int sec = 10;
                while (sec > 0)
                {
                    Console.WriteLine("Thank You for using Sia OS. Your computer will shutdown in  " + sec + " seconds, or press any key to shutdown now.");
                    sec--;
                    WaitSeconds(1);

                    if (System.Console.KeyAvailable == true)
                    {
                        Cosmos.System.Power.Shutdown();
                    }
                    else if (sec == 0)
                    {
                        Cosmos.System.Power.Shutdown();
                    }
                    Console.Clear();
                }
            }

            else if (input == "restart")
            {
                Sys.Power.Reboot();
            }

            //Limit mode stuff
            else if (input == "rhoff")
            {
                RealH = "false";

                Console.WriteLine("Real Hardware/Limited Mode Disabled");
            }

            else if (input == "rhon")
            {
                RealH = "true";
                Console.WriteLine("Real Hardware/Limited Mode enabled");
            }

            else if (input == "ison")
            {
                Console.WriteLine("Is in Real Harware/Limited Mode?: " + RealH);
            }

            //if a unknown command is typed then nothing because you deserve nothing because you are nothing to anyone.
            else
            {
            }
        }
コード例 #3
0
ファイル: Cash.cs プロジェクト: TheRealEli310/Cosix
        public static void Call(string cmdfull)
        {
            string[] cmdsplit = cmdfull.Split(" ");
            string   cmd      = cmdsplit[0];

            Kernel.RunInit();
            switch (cmd)
            {
            case "":
                break;

            case "help":
                Commands.Help.Main();
                break;

            case "ver":
                Commands.Ver.Main();
                break;

            case "crash":
                Kernel.Crash(new Exception("Manual crash!"));
                break;

            case "mode":
                try
                {
                    switch (cmdsplit[1])
                    {
                    case "0":
                        VGADriverII.SetMode(VGAMode.Text80x25);
                        Terminal.Clear();
                        break;

                    case "1":
                        VGADriverII.SetMode(VGAMode.Text80x50);
                        Terminal.Clear();
                        break;

                    case "2":
                        VGADriverII.SetMode(VGAMode.Text90x60);
                        Terminal.Clear();
                        break;

                    case "3":
                        Modules.CGM.Init(true);
                        VGADriverII.Clear(247);
                        break;

                    default:
                        break;
                    }
                }
                catch { }
                break;

            case "mill":
                Windmill.Windmill runner = new Windmill.Windmill(4096);
                for (; !runner.program[runner.index].Equals(0);)
                {
                    runner.RunNext();
                }
                break;

            case "miv":
                if (1 < cmdsplit.Length)
                {
                    Kernel.file = cmdsplit[1];
                    if (File.Exists(cmdsplit[1]))
                    {
                        File.WriteAllText(@"0:\" + Kernel.file, MIV.miv(File.ReadAllText(cmdsplit[1])));
                    }
                    else
                    {
                        File.WriteAllText(@"0:\" + Kernel.file, MIV.miv(null));
                    }
                }
                else
                {
                    MIV.StartMIV();
                }
                break;

            case "dir":
                string[] filePaths = Directory.GetFiles(@"0:\");
                var      drive     = new DriveInfo("0");
                Terminal.WriteLine("Volume in drive 0 is " + $"{drive.VolumeLabel}");
                Terminal.WriteLine("Directory of " + @"0:\");
                Terminal.WriteLine("\n");
                for (int i = 0; i < filePaths.Length; ++i)
                {
                    string path = filePaths[i];
                    Terminal.WriteLine(System.IO.Path.GetFileName(path));
                }
                foreach (var d in System.IO.Directory.GetDirectories(@"0:\"))
                {
                    var dir     = new DirectoryInfo(d);
                    var dirName = dir.Name;

                    Terminal.WriteLine(dirName + " <DIR>");
                }
                Terminal.WriteLine("\n");
                Terminal.WriteLine("        " + $"{drive.TotalSize}" + " bytes");
                Terminal.WriteLine("        " + $"{drive.AvailableFreeSpace}" + " bytes free");
                break;

            case "power":
                Commands.Power.Main(cmdsplit);
                break;

            case "elev":
                Modules.UC.Elevate();
                break;

            case "login":
                Modules.UC.username = cmdsplit[1];
                break;

            case "clear":
                Terminal.Clear();
                break;

            default:
                Terminal.WriteLine("cash: Command not found");
                break;
            }
            Kernel.ProgramStop();
        }