Exemple #1
0
        public InstructionBase(ICpu cpu)
        {
            this.cpu = cpu;

            compare = new CompareHelper(cpu);
            flags   = new FlagHelper(cpu);
            branch  = new BranchHelper(cpu);
            bcd     = new BCDHelper(cpu);
        }
Exemple #2
0
        public ActionResult EditDetails(string id)
        {
            ViewBag.BranchDetails      = new BranchMasterEntity();
            ViewBag.CountryList        = CountryHelper.GetCountryData();
            ViewBag.StateByCountryList = StateByCountryHelper.GetStateByCountryData("0");
            List <BranchMasterEntity> _branchEntity = BranchHelper.GetBranchData(id);

            return(View("Index", _branchEntity.FirstOrDefault()));
        }
Exemple #3
0
        public InstructionLogicResult ExecuteWithByte(CPU cpu, Memory mem, byte value, AddrModeCalcResult addrModeCalcResult)
        {
            bool branchSucceeded = false;
            bool addressCalculationCrossedPageBoundary = false;
            if(!cpu.ProcessorStatus.Carry)
            {
                // The instruction value is signed byte with the relative address (positive or negative)
                cpu.PC = BranchHelper.CalculateNewAbsoluteBranchAddress(cpu.PC, (sbyte)value, out ulong _, out addressCalculationCrossedPageBoundary);
                branchSucceeded = true;
            }

            return InstructionLogicResult.WithExtraCycles(
                InstructionExtraCyclesCalculator.CalculateExtraCyclesForBranchInstructions(
                        branchSucceeded,
                        addressCalculationCrossedPageBoundary)
                );
        }
Exemple #4
0
        public void StartCreateBranchDialog()
        {
            var    revision = GetFocusedRevisionPointer();
            string startingRevision;
            string defaultBranchName;

            if (revision != null)
            {
                startingRevision  = revision.Pointer;
                defaultBranchName = BranchHelper.TryFormatDefaultLocalBranchName(revision);
            }
            else
            {
                startingRevision  = GitConstants.HEAD;
                defaultBranchName = string.Empty;
            }
            StartCreateBranchDialog(startingRevision, defaultBranchName);
        }
Exemple #5
0
        public ActionResult EditDetails(BranchMasterEntity branchEntity)
        {
            ViewBag.BranchDetails = new BranchMasterEntity();

            ViewBag.CountryList        = CountryHelper.GetCountryData();
            ViewBag.StateByCountryList = StateByCountryHelper.GetStateByCountryData("0");

            if (ModelState.IsValid)
            {
                //Use Namespace called :  System.IO
                //string FileName = Path.GetFileNameWithoutExtension(branchEntity.ImageFile.FileName);

                ////To Get File Extension
                //string FileExtension = Path.GetExtension(branchEntity.ImageFile.FileName);

                ////Add Current Date To Attached File Name
                //FileName = DateTime.Now.ToString("yyyyMMdd") + "-" + FileName.Trim() + FileExtension;

                ////Get Upload path from Web.Config file AppSettings.
                ////string UploadPath = ConfigurationManager.AppSettings["UserImagePath"].ToString();

                ////Its Create complete path to store in server.
                //branchEntity.ImagePath = Path.Combine(Server.MapPath("~/Content/BranchLogo"),
                //                           Path.GetFileName(FileName)); // UploadPath + FileName;

                ////To copy and save file into server.
                //branchEntity.ImageFile.SaveAs(branchEntity.ImagePath);


                bool saveStatus = false;
                saveStatus         = BranchHelper.EditBranchData(branchEntity, saveStatus);
                ViewBag.SaveStatus = saveStatus;
            }

            return(View(branchEntity));
        }
Exemple #6
0
        public ActionResult BranchList()
        {
            List <BranchMasterEntity> _branchEntity = BranchHelper.GetBranchData();

            return(View("BranchDetails", _branchEntity));
        }
Exemple #7
0
        static void Main(string[] args)
        {
            CompanyHelper    companyHelper    = new CompanyHelper();
            BranchHelper     branchHelper     = new BranchHelper();
            DepartmentHelper departmentHelper = new DepartmentHelper();


            try {
                if (companyHelper.GetAll().Count > 0)
                {
                    companyHelper.GetAll().ToList().ForEach(c => {
                        WriteLine("\n------------- Company ------------------");
                        WriteLine($"---    {c.Name} has {c.Branches.Count} branch(es)");
                        WriteLine("----------------------------------------");

                        if (c.Branches.Count > 0)
                        {
                            c.Branches.ToList().ForEach(b => {
                                WriteLine("\n  -------------Branch(es)----------------");
                                WriteLine($"  > {b.Name} has {departmentHelper.GetDepartmentsByBranchId(b.Id).Count} Department(s)");
                                if (departmentHelper.GetDepartmentsByBranchId(b.Id).Count > 0)
                                {
                                    WriteLine("\n  ---------Department(s)------------");
                                    departmentHelper.GetDepartmentsByBranchId(b.Id).ForEach(d => {
                                        WriteLine($"  > {d.Name}");
                                    });
                                }
                            });
                        }
                        WriteLine("----------------------------------------");
                    });
                }
                else
                {
                    WriteLine("no company added to db yet");
                    WriteLine("would you like to Add a test Company ?");
                    var ans = Console.ReadLine();
                    if (ans.Equals("y", StringComparison.OrdinalIgnoreCase))
                    {
                        Company c = new Company {
                            Name     = "MrLee Ltd",
                            Branches = new List <Branch> {
                                new Branch {
                                    Name        = "Head Office",
                                    Departments = new List <Department> {
                                        new Department {
                                            Name = "Development Department"
                                        },
                                        new Department {
                                            Name = "Human Resources Department"
                                        },
                                        new Department {
                                            Name = "Networking Department"
                                        },
                                    }
                                },
                                new Branch {
                                    Name        = "China Office",
                                    Departments = new List <Department> {
                                        new Department {
                                            Name = "Development Department"
                                        },
                                        new Department {
                                            Name = "PMP Department"
                                        },
                                        new Department {
                                            Name = "Security Analysis Department"
                                        },
                                    }
                                }
                            }
                        };
                        companyHelper.Add(c);
                        Console.WriteLine("Done!! please restart the program to view changes");
                    }
                }
            }
            catch (Exception ex) {
                WriteLine($"Error  > {ex.Message}");
            }

            ReadKey();
        }
Exemple #8
0
        protected void btnInvoke_Click(object sender, EventArgs e)
        {
            BranchHelper helper = new BranchHelper();

            helper.InvokeBuild();
        }