public InstructionBase(ICpu cpu) { this.cpu = cpu; compare = new CompareHelper(cpu); flags = new FlagHelper(cpu); branch = new BranchHelper(cpu); bcd = new BCDHelper(cpu); }
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())); }
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) ); }
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); }
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)); }
public ActionResult BranchList() { List <BranchMasterEntity> _branchEntity = BranchHelper.GetBranchData(); return(View("BranchDetails", _branchEntity)); }
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(); }
protected void btnInvoke_Click(object sender, EventArgs e) { BranchHelper helper = new BranchHelper(); helper.InvokeBuild(); }