public AccountingTransactionManager(string testDb) : base(testDb) { _accountManagement = new AccountManager(testDb); _currencyManager = new CurrencyManager(testDb); _branchManager = new BranchManager(testDb); }
public AccountingTransactionManager(User pUser) : base(pUser) { _accountManagement = new AccountManager(pUser); _currencyManager = new CurrencyManager(pUser); _branchManager = new BranchManager(pUser); }
public HttpResponseMessage ReduceNumberOfStudents([FromBody] int branchId) { try { int rowsAffected = BranchManager.ReduceNumberOfStudents(branchId); return(Request.CreateResponse(HttpStatusCode.Created, rowsAffected)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, $"failed to get branch {branchId},{ex.Message}")); } }
public HttpResponseMessage Delete([FromBody] Branch[] branches) { try { int rowsAffected = BranchManager.Delete(branches); return(Request.CreateResponse(HttpStatusCode.Created, rowsAffected)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, $"failed to delete branch {ex.Message}")); } }
public ActionResult Create(BranchModel branch) { try { BranchManager.AddBranch(Utility.convertSrcToTarget <BranchModel, Branch>(branch), "nirshan"); return(RedirectToAction("Index")); } catch { return(View()); } }
public CascadingDropDownNameValue[] GetBranchs(string knownCategoryValues, string category) { IList <Branch> branchs = BranchManager.GetAllBranch(); List <CascadingDropDownNameValue> branchList = new List <CascadingDropDownNameValue>(); foreach (Branch bc in branchs) { branchList.Add(new CascadingDropDownNameValue(bc.BranchName, bc.BranchId.ToString())); } return(branchList.ToArray()); }
public SetUpController(UserManager <ApplicationUser> userManager, RoleManager <IdentityRole> roleManager, BranchManager <IdentityBranch> branchManager, BankManager <IdentityBank> bankManager, AccountNumberManager <IdentityAccountNumber> accountManager) { UserManager = userManager; RoleManager = roleManager; BranchManager = branchManager; BankManager = bankManager; AccountNumberManager = accountManager; }
public HttpResponseMessage MakeBranchActive([FromBody] int id) { try { int rowsAffected = BranchManager.MakeBranchActive(id); return(Request.CreateResponse(HttpStatusCode.Created, rowsAffected)); } catch (Exception) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, $"failed to update branch to not active {id}")); } }
private void EmitConditional(YaleIlGenerator ilg, ExpressionContext context, BranchManager branchManager) { var falseLabel = branchManager.FindLabel("falseLabel"); var endLabel = branchManager.FindLabel("endLabel"); // Emit the condition condition.Emit(ilg, context); // On false go to the false operand if (ilg.IsTemp) { branchManager.AddBranch(ilg, falseLabel); ilg.Emit(OpCodes.Brfalse_S, falseLabel); } else if (branchManager.IsLongBranch(ilg, falseLabel) == false) { ilg.Emit(OpCodes.Brfalse_S, falseLabel); } else { ilg.Emit(OpCodes.Brfalse, falseLabel); } // Emit the true operand whenTrue.Emit(ilg, context); ImplicitConverter.EmitImplicitConvert(whenTrue.ResultType, resultType, ilg); // Jump to end if (ilg.IsTemp) { branchManager.AddBranch(ilg, endLabel); ilg.Emit(OpCodes.Br_S, endLabel); } else if (branchManager.IsLongBranch(ilg, endLabel) == false) { ilg.Emit(OpCodes.Br_S, endLabel); } else { ilg.Emit(OpCodes.Br, endLabel); } branchManager.MarkLabel(ilg, falseLabel); ilg.MarkLabel(falseLabel); // Emit the false operand whenFalse.Emit(ilg, context); ImplicitConverter.EmitImplicitConvert(whenFalse.ResultType, resultType, ilg); // Fall through to end branchManager.MarkLabel(ilg, endLabel); ilg.MarkLabel(endLabel); }
private void EmitConditional(FleeILGenerator ilg, IServiceProvider services, BranchManager bm) { Label falseLabel = bm.FindLabel("falseLabel"); Label endLabel = bm.FindLabel("endLabel"); // Emit the condition _myCondition.Emit(ilg, services); // On false go to the false operand if (ilg.IsTemp == true) { bm.AddBranch(ilg, falseLabel); ilg.Emit(OpCodes.Brfalse_S, falseLabel); } else if (bm.IsLongBranch(ilg, falseLabel) == false) { ilg.Emit(OpCodes.Brfalse_S, falseLabel); } else { ilg.Emit(OpCodes.Brfalse, falseLabel); } // Emit the true operand _myWhenTrue.Emit(ilg, services); ImplicitConverter.EmitImplicitConvert(_myWhenTrue.ResultType, _myResultType, ilg); // Jump to end if (ilg.IsTemp == true) { bm.AddBranch(ilg, endLabel); ilg.Emit(OpCodes.Br_S, endLabel); } else if (bm.IsLongBranch(ilg, endLabel) == false) { ilg.Emit(OpCodes.Br_S, endLabel); } else { ilg.Emit(OpCodes.Br, endLabel); } bm.MarkLabel(ilg, falseLabel); ilg.MarkLabel(falseLabel); // Emit the false operand _myWhenFalse.Emit(ilg, services); ImplicitConverter.EmitImplicitConvert(_myWhenFalse.ResultType, _myResultType, ilg); // Fall through to end bm.MarkLabel(ilg, endLabel); ilg.MarkLabel(endLabel); }
/// <summary> /// /// </summary> void Start() { m_instance = this; // initialise singleton Blackboard[] blackboards = Resources.FindObjectsOfTypeAll <Blackboard>(); m_blackboards = new List <Blackboard>(); for (int i = 0; i < blackboards.Length; i++) { Blackboard blackboard = ScriptableObject.CreateInstance <Blackboard>(); blackboard.Copy(blackboards[i]); m_blackboards.Add(blackboard); } // retrieve manager from each component if (m_audioComponent != null) { m_audioManager = m_audioComponent.GetAudioManager(); } if (m_backgroundComponent != null) { m_backgroundManager = m_backgroundComponent.GetBackgroundManager(); } if (m_branchComponent != null) { m_branchManager = m_branchComponent.GetBranchManager(); } if (m_characterComponent != null) { m_characterManager = m_characterComponent.GetCharacterManager(); } if (m_dialogueComponent != null) { m_dialogueManager = m_dialogueComponent.GetDialogueManager(); } if (m_logComponent != null) { m_logManager = m_logComponent.GetLogManager(); } if (m_saveComponent != null) { m_saveManager = new SaveManager(this, m_saveComponent); } m_utilityManager = new UtilityManager(); m_variableManager = new VariableManager(); m_nodeEvaluator = new NodeEvaluator(this); // delete this later NewScene(m_startScene); }
public HttpResponseMessage GetBranches([FromUri] int typeId) { try { Branches branchs = BranchManager.GetBranchesBasicDetails(typeId, Branch.Includes.Address | Branch.Includes.BranchType | Branch.Includes.UserExtraDetails | Branch.Includes.ActivityHours | Branch.Includes.Rules | Branch.Includes.Institution | Branch.Includes.Scolarship); List <BranchDto> branchsDto = Converters.Convert(branchs); return(Request.CreateResponse(HttpStatusCode.OK, branchsDto)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, $"failed to get branchs {ex.Message}")); } }
public ActionResult Profile(int employeeId) { var employee = _employeeManager.GetById(employeeId); EmployeeVM employeeVm = Mapper.Map <EmployeeVM>(employee); employeeVm.Employees = _employeeManager.GetAll(); BranchManager branchManager = new BranchManager(); employeeVm.BranchList = branchManager.GetBranchList(); return(View(employeeVm)); }
public IHttpActionResult Post(BranchManager branchManager) { if (lrepo.Get(branchManager.Manager_Name) == null) { this.bmrepo.Insert(branchManager); string uri = Url.Link("GetBMById", new { id = branchManager.Manager_Id }); return(Created("GetBMById", branchManager)); } else { return(StatusCode(HttpStatusCode.Forbidden)); } }
public IHttpActionResult Create(BranchManager branch_Manager) { if (ModelState.IsValid) { BranchManagerRepository.Insert(branch_Manager); string url = Url.Link("BranchManagerPath", new { id = branch_Manager.BranchManagerId }); return(Created(url, branch_Manager)); } else { return(StatusCode(HttpStatusCode.ExpectationFailed)); } }
public static void Print() { BranchManager branchManager = new BranchManager(new EfBranchDal()); var result = branchManager.GetAll(); foreach (var branch in result.Data) { Console.WriteLine($"Id: {branch.Id}"); Console.WriteLine($"City Id: {branch.CityId}"); Console.WriteLine($"Address: {branch.Address}"); } }
public HttpResponseMessage GetBranch([FromUri] int branchId) { try { Branch branch = BranchManager.GetBranch(branchId, Branch.Includes.Address | Branch.Includes.BranchType | Branch.Includes.ActivityHours | Branch.Includes.Rules | Branch.Includes.Institution); BranchDto branchDto = Converters.Convert(branch); return(Request.CreateResponse(HttpStatusCode.OK, branchDto)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, $"failed to get branch {branchId},{ex.Message}")); } }
public HttpResponseMessage Contains([FromUri] string str = "") { try { Branches bra = BranchManager.Contains(Branch.Includes.Address, str); List <BranchDto> branchesDto = Converters.Convert(bra); return(Request.CreateResponse(HttpStatusCode.OK, branchesDto)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, $"Failed to search branch, {ex.Message}")); } }
public int Insert(BranchManager branchMangaer) { Logininfo li = new Logininfo(); li.Login_acc_no = context.BranchManagers.Count() + 1; li.Login_Name = branchMangaer.Manager_Name; li.Login_Password = branchMangaer.Manager_password; li.Login_type = "Manager"; context.Logininfos.Add(li); context.BranchManagers.Count(); context.BranchManagers.Add(branchMangaer); return(context.SaveChanges()); }
public ActionResult Create(BranchCreatModel b) { Branch branch = new Branch(); branch.BracnhName = b.BracnhName; branch.BranchCode = b.BranchCode; branch.TicketStartNumber = b.TicketStartNumber; branch.ClientId = b.ClientId; BranchManager <Branch> branchManager = new BranchManager <Branch>(new BranchStore <Branch>()); branchManager.CreateBranch(branch); return(View()); }
/// <summary> /// 添加按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAdd_Click(object sender, EventArgs e) { if (IsValid) { Branch branch = new Branch(); branch.BranchName = this.txtBranchName.Text; branch.BranchShortName = this.txtBranchShortName.Text; branch = BranchManager.AddBranch(branch); BindBranchInfo(); txtBranchShortName.Text = ""; txtBranchName.Text = ""; } }
public HttpResponseMessage Deletebranch([FromUri] int id) { using (logic = new BranchManager()) { try { bool isDelete = logic.DeleteBranch(id); return(Request.CreateResponse(HttpStatusCode.OK, isDelete)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ExceptionHelper.GetInnerMessage(ex))); } } }
public HttpResponseMessage GetOneBranch([FromUri] int BranchID) { using (logic = new BranchManager()) { try { BranchModel Branch = logic.GetOneBranch(BranchID); return(Request.CreateResponse(HttpStatusCode.OK, Branch)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ExceptionHelper.GetInnerMessage(ex))); } } }
//Get: api/CarsBranchs/5 public HttpResponseMessage Get(int bid) // will return list of car types that has the branchID = bid { List <BranchModel> branchesList = BranchManager.GetSpecificBranch(bid); if (branchesList != null) { return new HttpResponseMessage(HttpStatusCode.OK) { Content = new ObjectContent <List <BranchModel> >(branchesList, new JsonMediaTypeFormatter()) } } ; return(new HttpResponseMessage(HttpStatusCode.BadRequest)); }
[Route("all")] // access link : http://localhost:53093/api/order/orders public HttpResponseMessage GetAllBranches() { using (logic = new BranchManager()) { try { List <BranchModel> branches = logic.GetAllBranches(); return(Request.CreateResponse(HttpStatusCode.OK, branches)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ExceptionHelper.GetInnerMessage(ex))); } } }
public HttpResponseMessage Post([FromBody] BranchModel newBranchtoDb) { bool insertResult = false; if (ModelState.IsValid) { insertResult = BranchManager.InsertUpdateDeleteBranches(newBranchtoDb); } HttpStatusCode responseCode = insertResult ? HttpStatusCode.Created : HttpStatusCode.BadRequest; return(new HttpResponseMessage(responseCode) { Content = new ObjectContent <bool>(insertResult, new JsonMediaTypeFormatter()) }); }
public HttpResponseMessage Put([FromBody] BranchModel editBranch) { bool updateResult = false; if (ModelState.IsValid) { updateResult = BranchManager.InsertUpdateDeleteBranches(editBranch); } HttpStatusCode responseCode = updateResult ? HttpStatusCode.OK : HttpStatusCode.BadRequest; return(new HttpResponseMessage(responseCode) { Content = new ObjectContent <bool>(updateResult, new JsonMediaTypeFormatter()) }); }
// GET: api/Author/5 public HttpResponseMessage Get(string branchName) { BranchModel branch = BranchManager.SelectBranchByName(branchName); if (branch != null) { return new HttpResponseMessage(HttpStatusCode.OK) { Content = new ObjectContent <BranchModel>(branch, new JsonMediaTypeFormatter()) } } ; return(new HttpResponseMessage(HttpStatusCode.BadRequest)); } }
public void ManageBranch(List <string[]> optiondata) { branchManager = gameObject.AddComponent <BranchManager>(); branchManager.GetBranchData(optiondata); int optionNumber = optiondata.Count; //循环记录每个分支前面有多少行,后面有多少行 for (int i = 0; i < optionNumber; i++) { //更改按钮文本 optionText[i].text = optiondata[i][0]; //使按钮点击生效 optionText[i].GetComponent <OptionText>().IsAllowClicked = true; optionText[i].GetComponent <OptionText>().TextIndex = i; } }
public async void TestGitHistoryBranchOnly() { string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetFileNameWithoutExtension(Path.GetRandomFileName())); Directory.CreateDirectory(tempDirectory); GitProcessManager local = new GitProcessManager(tempDirectory, null); var result = await local.RunGit("init", CancellationToken.None); result.Success.Should().Be(true, "Must be able to init"); int numberCommits = 10; await this.GenerateCommits(numberCommits, tempDirectory, local, "master"); BranchManager branchManager = new BranchManager(tempDirectory, null); var commits = await branchManager.GetCommitsForBranch(new GitBranch("master", false), 0, 0, GitLogOptions.BranchOnlyAndParent, CancellationToken.None); commits.Count.Should().Be(numberCommits, $"We have done {numberCommits} commits"); using (Repository repository = new Repository(tempDirectory)) { var branch = repository.Branches.FirstOrDefault(x => x.FriendlyName == "master"); branch.Should().NotBeNull(); CheckCommits(branch.Commits.ToList(), commits); } commits.Should().BeInDescendingOrder(x => x.DateTime); await GenerateCommits(numberCommits, tempDirectory, local, "test1"); commits = await branchManager.GetCommitsForBranch(new GitBranch("test1", false), 0, 0, GitLogOptions.BranchOnlyAndParent, CancellationToken.None); commits.Count.Should().Be(numberCommits + 1, $"We have done {numberCommits + 1} commits"); using (Repository repository = new Repository(tempDirectory)) { var branch = repository.Branches.FirstOrDefault(x => x.FriendlyName == "test1"); branch.Should().NotBeNull(); CheckCommits(branch.Commits.Take(11).ToList(), commits); } }
public JsonLoaderController(GeneralCategoryManager _generalCategoryManager, CategoryManager _categoryManager, BrandManager _brandManager, AssetRegistrationManager _assetRegistrationManager, UiLoader.UiLoader _loader, AssetManager _assetManager, BranchManager _branchManager, AssetRegistrationDetailsManager _assetRegistrationDetailsManager, OrganizationManager _organizationManager, MovementManager _movementManager, UserManager _userManager, MovementPermisionManager _movementPermisionManager, LoginHistoryManager _loginHistoryManager, NewAssetManager _newAssetManager) { loader = _loader; assetRegistrationManager = _assetRegistrationManager; assetManager = _assetManager; generalCategoryManager = _generalCategoryManager; categoryManager = _categoryManager; brandManager = _brandManager; branchManager = _branchManager; assetRegistrationDetailsManager = _assetRegistrationDetailsManager; organizationManager = _organizationManager; movementManager = _movementManager; userManager = _userManager; movementPermisionManager = _movementPermisionManager; loginHistoryManager = _loginHistoryManager; newAssetManager = _newAssetManager; }
// PUT api/<controller>/5 /// <summary> /// Puts the specified identifier. /// </summary> /// <param name="id">The identifier.</param> /// <param name="value">The value.</param> /// <returns></returns> /// <exception cref="HttpResponseException"></exception> public Branch Put(string id, [FromBody] Branch value) { Branch objItem = new Branch(); try { objItem = BranchManager.UpdateItem(value); } catch (Exception ObjEx) { IfindLogManager.AddItem(new IfindLog() { LinkUrl = Request.RequestUri.AbsoluteUri, Exception = ObjEx.Message, Message = ObjEx.StackTrace }); } return(objItem); }
private void EmitConditional(FleeILGenerator ilg, IServiceProvider services, BranchManager bm) { var falseLabel = bm.FindLabel("falseLabel"); var endLabel = bm.FindLabel("endLabel"); // Emit the condition MyCondition.Emit(ilg, services); // On false go to the false operand if (ilg.IsTemp == true) { bm.AddBranch(ilg, falseLabel); ilg.Emit(OpCodes.Brfalse_S, falseLabel); } else if (bm.IsLongBranch(ilg, falseLabel) == false) { ilg.Emit(OpCodes.Brfalse_S, falseLabel); } else { ilg.Emit(OpCodes.Brfalse, falseLabel); } // Emit the true operand MyWhenTrue.Emit(ilg, services); ImplicitConverter.EmitImplicitConvert(MyWhenTrue.ResultType, MyResultType, ilg); // Jump to end if (ilg.IsTemp == true) { bm.AddBranch(ilg, endLabel); ilg.Emit(OpCodes.Br_S, endLabel); } else if (bm.IsLongBranch(ilg, endLabel) == false) { ilg.Emit(OpCodes.Br_S, endLabel); } else { ilg.Emit(OpCodes.Br, endLabel); } bm.MarkLabel(ilg, falseLabel); ilg.MarkLabel(falseLabel); // Emit the false operand MyWhenFalse.Emit(ilg, services); ImplicitConverter.EmitImplicitConvert(MyWhenFalse.ResultType, MyResultType, ilg); // Fall through to end bm.MarkLabel(ilg, endLabel); ilg.MarkLabel(endLabel); }
public override void Emit(FleeILGenerator ilg, IServiceProvider services) { var bm = new BranchManager(); bm.GetLabel("falseLabel", ilg); bm.GetLabel("endLabel", ilg); if (ilg.IsTemp == true) { // If this is a fake emit, then do a fake emit and return this.EmitConditional(ilg, services, bm); return; } var ilgTemp = this.CreateTempFleeILGenerator(ilg); Utility.SyncFleeILGeneratorLabels(ilg, ilgTemp); // Emit fake conditional to get branch target positions this.EmitConditional(ilgTemp, services, bm); bm.ComputeBranches(); // Emit real conditional now that we have the branch target locations this.EmitConditional(ilg, services, bm); }
private void TitleBranchesBtn_Click(object sender, RoutedEventArgs e) { var branchManagerWindow = new BranchManager(); branchManagerWindow.ShowDialog(); UpdateServerLists(); }
private static void EmitBranchToTrueTerminal(FleeILGenerator ilg, Label trueTerminal, BranchManager bm) { if (ilg.IsTemp == true) { bm.AddBranch(ilg, trueTerminal); ilg.Emit(OpCodes.Brtrue_S, trueTerminal); } else if (bm.IsLongBranch(ilg, trueTerminal) == false) { ilg.Emit(OpCodes.Brtrue_S, trueTerminal); } else { ilg.Emit(OpCodes.Brtrue, trueTerminal); } }
private void EmitListIn(FleeILGenerator ilg, IServiceProvider services, BranchManager bm) { var ce = new CompareElement(); var endLabel = bm.FindLabel("endLabel"); var trueTerminal = bm.FindLabel("trueTerminal"); // Cache the operand since we will be comparing against it a lot var lb = ilg.DeclareLocal(MyOperand.ResultType); int targetIndex = lb.LocalIndex; MyOperand.Emit(ilg, services); Utility.EmitStoreLocal(ilg, targetIndex); // Wrap our operand in a local shim var targetShim = new LocalBasedElement(MyOperand, targetIndex); // Emit the compares foreach (var argumentElement in MyArguments) { ce.Initialize(targetShim, argumentElement, LogicalCompareOperation.Equal); ce.Emit(ilg, services); EmitBranchToTrueTerminal(ilg, trueTerminal, bm); } ilg.Emit(OpCodes.Ldc_I4_0); ilg.Emit(OpCodes.Br_S, endLabel); bm.MarkLabel(ilg, trueTerminal); ilg.MarkLabel(trueTerminal); ilg.Emit(OpCodes.Ldc_I4_1); bm.MarkLabel(ilg, endLabel); ilg.MarkLabel(endLabel); }
public override void Emit(FleeILGenerator ilg, IServiceProvider services) { if ((MyTargetCollectionType != null)) { this.EmitCollectionIn(ilg, services); } else { var bm = new BranchManager(); bm.GetLabel("endLabel", ilg); bm.GetLabel("trueTerminal", ilg); // Do a fake emit to get branch positions var ilgTemp = this.CreateTempFleeILGenerator(ilg); Utility.SyncFleeILGeneratorLabels(ilg, ilgTemp); this.EmitListIn(ilgTemp, services, bm); bm.ComputeBranches(); // Do the real emit this.EmitListIn(ilg, services, bm); } }
protected void btnSave_Click(object sender, EventArgs e) { hideDIV(); bool trackAll = true; string branchName = null; string districtName = null; if (txtBranchName.Text != "") { branchName = txtBranchName.Text; } else { trackAll = false; infoPanel.Visible = true; InfoDIV.Visible = true; lblInformationMsg.Text = "Branch Name can't be Empty!"; } if (DropDownDistrictList.SelectedValue != "-1") { districtName = DropDownDistrictList.SelectedValue; } else { trackAll = false; infoPanel.Visible = true; InfoDIV.Visible = true; lblInformationMsg.Text = "District Name must be selected!"; } if (!trackAll) { return; } Branch branch = new Branch(); branch.branchName = branchName; branch.district = districtName; BranchManager branchManager = new BranchManager(branch); //call sote to DB method. TransactionResponse response = branchManager.addNewBranch(); //if store to DB is successful if (response.isSuccessful()) { hideDIV(); infoPanel.Visible = true; SucessDIV.Visible = true; lblSuccessMessage.Text = "Branch Successfully Registered!"; btnSave.Enabled = false; } // show error message to a user. else { hideDIV(); infoPanel.Visible = true; WarnDIV.Visible = true; //Display Exception here lblWarningMsg.Text = response.getMessage(); } }