//그리드뷰에 DB에서 가져온 List 바인딩 private void GetFactoryInfo() { FactoryService service = new FactoryService(); dgvFactoryList.DataSource = null; dgvFactoryList.DataSource = service.GetFactoryInfo(); }
private void frmOriginalImg_Load(object sender, EventArgs e) { //this.pic_Loading.ImageLocation = "Skin\\SysImg\\loading.gif"; if (_thumbnailID != 0) { pic_Loading.Visible = true; //dlService.GetOriginalImageByThumbnailAsync(_thumbnailID); //dlService.GetOriginalImageByThumbnailCompleted += new Entity.CarWebService.GetOriginalImageByThumbnailCompletedEventHandler(dlService_GetOriginalImageByThumbnailCompleted); IUploadService us = FactoryService.CreateInstance(); byte[] imgByte = us.GetOriginalImage(_thumbnailID); if (imgByte != null) { Stream s = new MemoryStream(imgByte); Image _pic = Image.FromStream(s); pictureBox1.Image = _pic; this.Width = _pic.Width; this.Height = _pic.Height; if (_pic.Width > 800 && _pic.Height > 600) { this.Width = 800; this.Height = 600; } pic_Loading.Visible = false; } } }
private void BtnNewProjet_Click(object sender, EventArgs e) { // On verifieque tous les champs on été saisis if (TBNomProjet.Text == "" || TBTrigrammeProjet.Text == "" || CBResponsableProjet.SelectedItem == null) { message = "Vous devez remplir tous les champs."; caption = "Oups !"; MessageBoxButtons buttons = MessageBoxButtons.OK; MessageBox.Show(message, caption, buttons); } else { // On verifie que le trigramme est bien composé de 3 lettres if (TBTrigrammeProjet.Text.Count() != 3) { message = "Votre trigramme doit obligatoirement se composer de trois lettres."; caption = "Oups !"; MessageBoxButtons buttons = MessageBoxButtons.OK; MessageBox.Show(message, caption, buttons); } else { // On verifie que DateDebut est bien antèrieure à DateFinPrevue if (DTDateDebut.Value.Date.CompareTo(DTDateFinPrevue.Value.Date) == 1) { message = "Votre date de début doit être antérieur à la date de fin prévue."; caption = "Oups !"; MessageBoxButtons buttons = MessageBoxButtons.OK; MessageBox.Show(message, caption, buttons); } else { // On realise l'insertion du nouveau projet int resultInsert = FactoryService.CreateServiceProjet().NewProjet(TBNomProjet.Text, TBTrigrammeProjet.Text, (CBResponsableProjet.SelectedItem as dynamic).Value, DTDateDebut.Value, DTDateFinPrevue.Value); // On affiche le resultat de l'insertion if (resultInsert == 1) { message = "L'insertion a bien été effectuée."; caption = "Félicitation !"; MessageBoxButtons buttons = MessageBoxButtons.OK; MessageBox.Show(message, caption, buttons); } else { message = "Une erreur est survenue. L'insertion n'a pas pu être effectuée."; caption = "Oups !"; MessageBoxButtons buttons = MessageBoxButtons.OK; MessageBox.Show(message, caption, buttons); } // On refresh le form Main de l'app if (Application.OpenForms["Main"] != null) { (Application.OpenForms["Main"] as Main).Refresh(); } // On ferme la form d'ajout this.Close(); } } } }
public IActionResult Create() { FactoryService fs = new FactoryService(_con); ViewBag.Business = fs.GetallBusinessType(); return(View()); }
public IActionResult Edit(int Id) { FactoryService fs = new FactoryService(_con); var Factory = fs.GetFactoryById(Id); return(View(Factory)); }
public async Task <IActionResult> Delete(int Id) { FactoryService fs = new FactoryService(_con); bool x = await fs.DeleteFactoryAsync(Id); return(RedirectToAction(nameof(Index))); }
public IActionResult Details() { FactoryService fs = new FactoryService(_con); ViewBag.factories = fs.GetAllFactoriesSimple(); return(View()); }
public async Task <IActionResult> Edit(FactoryDataModel obj) { FactoryService fs = new FactoryService(_con); bool FactoryEdit = await fs.EditFactoryAsync(obj); return(RedirectToAction(nameof(Index))); }
public IActionResult Create() { FactoryService fs = new FactoryService(_Context); ViewBag.factories = fs.GetAllFactoriesSimple(); return(View()); }
public async Task <ID> DeployAsync(ID id) { FactoryService factory = new FactoryService(Web3, AccountService.PrivateKey, _factoryAddress); //Use the provided Factory address to create an ID + IDController Event idCreationEvent = factory.GetEventReturnIDController(); HexBigInteger filterAddressFrom = await idCreationEvent.CreateFilterAsync(AccountService.GetAccountAddress()); await factory.CreateIDAsync(); List <EventLog <ReturnIDControllerEventDTO> > log = await idCreationEvent.GetFilterChanges <ReturnIDControllerEventDTO>(filterAddressFrom); string controllerAddress = log[0].Event._controllerAddress; IDControllerService idcService = new IDControllerService(Web3, AccountService.PrivateKey, controllerAddress); id.ControllerAddress = controllerAddress; id.Address = await idcService.GetIDAsyncCall(); id.Owner = await idcService.OwnerAsyncCall(); //Add each attribute from the ID model to the ID smart contract foreach (string key in id.Attributes.Keys) { Attribute attribute = id.GetAttribute(key); await AddAttributeAsync(id, attribute); } return(id); }
/* [HttpGet] * public IActionResult PeakPerDay() * { * FactoryService fs = new FactoryService(_Context); * ViewBag.factories = fs.GetAllFactoriesSimple(); * PrimarySourceSerivce ps = new PrimarySourceSerivce(_Context); * ViewBag.Primary = ps.GetAllPrimarySources(); * LoadsServices ls = new LoadsServices(_Context); * ViewBag.Loads = ls.GetAllLoads(); * return View(); * } * [HttpPost]*/ public IActionResult PeakPerDay(DateTime date, int type = -1, int primId = -1, int loadId = -1) { FactoryService fs = new FactoryService(_Context); ViewBag.factories = fs.GetAllFactoriesSimple(); PrimarySourceSerivce ps = new PrimarySourceSerivce(_Context); ViewBag.Primary = ps.GetAllPrimarySources(); LoadsServices ls = new LoadsServices(_Context); ViewBag.Loads = ls.GetAllLoads(); ReportService rs = new ReportService(_Context); PowerPeakViewModel res = new PowerPeakViewModel(); if (type == 1) { res = rs.PowerPeakPerDay(date, type, primId); } else { res = rs.PowerPeakPerDay(date, type, loadId); } return(View(res)); }
public async Task <ID> RecoverIDAsync() { FactoryService factory = new FactoryService(Web3, AccountService.PrivateKey, _factoryAddress); RegistryService registry = new RegistryService(Web3, AccountService.PrivateKey, await factory.RegistryAsyncCall()); string idAddress = await registry.IdsAsyncCall(AccountService.GetAccountAddress()); return(await GetIDAsync(idAddress)); }
protected override void OnConfiguring(DbContextOptionsBuilder options) { if (!options.IsConfigured) { var _config = FactoryService.getInstance <ConfigurationService>(); options.UseSqlite(_config.getConnectionSQLite()); } }
public IActionResult homeCreate(int Id) { FactoryService fs = new FactoryService(_Context); SecoundrySourceService ss = new SecoundrySourceService(_Context); ViewBag.factories = fs.GetAllFactoriesSimple(); ViewBag.secondaries = ss.GetAllSecoundrySources(); return(View()); }
private void btn_Download_Click(object sender, EventArgs e) { try { folderBrowserDialog1.ShowDialog(); if (Directory.Exists(folderBrowserDialog1.SelectedPath)) { IUploadService us = FactoryService.CreateInstance(); List <int> imgList = new List <int>(); foreach (Control cmain in panel1.Controls) { if (cmain is Panel) { bool needOutPut = false; foreach (Control c in cmain.Controls) { if (c is CheckBox && ((CheckBox)c).Checked) { needOutPut = true; break; } } if (needOutPut) { foreach (Control c in cmain.Controls) { if (c is PictureBox) { PictureBox pic = (PictureBox)c; if (pic.Image != null) { int picID = Convert.ToInt32(pic.Tag); byte[] BytImg = us.GetOriginalImage(picID); //byte[] BytImg = dlService.GetOriginalImageByThumbnail(picID); if (BytImg != null) { Stream s = new MemoryStream(BytImg); Image img = Image.FromStream(s); img.Save(folderBrowserDialog1.SelectedPath + "\\" + _carID + "_" + picID + ".jpg"); } } } } } } } } MessageBox.Show("导出完成"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public IActionResult HarmonicStat() { FactoryService fs = new FactoryService(_Context); LoadsServices ls = new LoadsServices(_Context); ViewBag.factories = fs.GetAllFactoriesSimple(); ViewBag.loads = ls.GetAllLoads(); ViewBag.functions = ls.GetAllFunctions(); return(View()); }
public IActionResult homeCreate(int Id) { FactoryService fs = new FactoryService(_Context); LoadsServices ls = new LoadsServices(_Context); ViewBag.factories = fs.GetAllFactoriesSimple(); ViewBag.Functions = ls.GetAllFunctions(); return(View()); }
public IActionResult Instantaneous() { FactoryService fs = new FactoryService(_Context); LoadsServices ls = new LoadsServices(_Context); ViewBag.factories = fs.GetAllFactoriesSimple(); ViewBag.loads = ls.GetAllLoads(); return(View()); }
public override void Refresh() { CBResponsableProjet.Items.Clear(); CBResponsableProjet.DisplayMember = "Text"; CBResponsableProjet.ValueMember = "Value"; foreach (Trigramme tri in FactoryService.CreateServiceTrigramme().GetAllTrigrammes()) { CBResponsableProjet.Items.Add(new { Text = tri.Nom, Value = tri.Id }); } }
public IActionResult LoadDashBoard() { FactoryService fs = new FactoryService(_Context); ViewBag.factories = fs.GetAllFactoriesSimple(); DashboardViewModel res = new DashboardViewModel(); res.datetime = DateTime.Now; return(View(res)); }
public void TestMethod6() { Triangle triangle = FactoryEntity.GetTriangle(); triangle.PointOne = new Point(60, 60); triangle.PointTwo = new Point(100, 300); triangle.PointThree = new Point(30, 200); ITriangleOperation triangleOperation = FactoryService.GetTriangleOperationObject(); triangleOperation.DrawingTriangle(triangle); }
public void TestMethod5() { Circle circle = FactoryCircleObject.GetCircle(); circle.CentreX = 100.0; circle.CentreY = 100.0; circle.Radius = 100.0; IPolygonOperation polygonOperation = FactoryService.GetPolygon(); polygonOperation.DrawingPolygon(circle); }
public QuickSearch(bool isQuickSearch) { InitializeComponent(); this.DataContext = new SearchViewModel(isQuickSearch); Window parentWindow = Window.GetWindow(this); if (parentWindow != null) { FactoryService.Register(this.DataContext as ViewModelBase, parentWindow); } }
public Connect() { InitializeComponent(); this.DataContext = new ConnectViewModel(); Window parentWindow = Window.GetWindow(this); if (parentWindow != null) { FactoryService.Register(this.DataContext as ViewModelBase, parentWindow); } }
protected override void Awake() { base.Awake(); AssetService.LoadAsset <Ball>(AssetCategoryRoot.Prefabs, Constants.Prefabs.Ball) .Run(ball => { _ballPrefab = ball; //Initialize pooler, and set the pool to one element _pooler = FactoryService.CreatePool <Ball>(_ballPrefab, 1); }); }
public void Refresh() { // On charge les différents projets dans le combobox CBListeProjets.Items.Clear(); CBListeProjets.DisplayMember = "Text"; CBListeProjets.ValueMember = "Value"; foreach (Projet projet in FactoryService.CreateServiceProjet().GetAllProjets()) { CBListeProjets.Items.Add(new { Text = projet.Trigramme + " - " + projet.Nom, Value = projet.Id }); } CBListeProjets.SelectedItem = null; }
public NewExigence() { InitializeComponent(); CBTypeExigences.Items.Clear(); CBTypeExigences.DisplayMember = "Text"; CBTypeExigences.ValueMember = "Value"; foreach (TypeExigence type in FactoryService.CreateServiceTypeExigence().GetAllTypeExigences()) { CBTypeExigences.Items.Add(new { Text = type.Label, Value = type.Id }); } CBTypeExigences.SelectedIndex = 0; }
public async Task SetupAsync() { await InitAutonomousTestAsync(); string transactionHash = await FactoryService.DeployContractAsync( Web3, AddressFrom, new HexBigInteger(3905820)); TransactionReceipt receipt = await Web3.Eth.Transactions.GetTransactionReceipt. SendRequestAsync(transactionHash); _factory = new FactoryService(Web3, receipt.ContractAddress); }
private void btn_Delete_Click(object sender, EventArgs e) { List <int> imgList = new List <int>(); foreach (Control cmain in panel1.Controls) { if (cmain is Panel) { bool isChecked = false; foreach (Control c in cmain.Controls) { if (c is CheckBox && ((CheckBox)c).Checked) { isChecked = true; break; } } if (isChecked) { foreach (Control c in cmain.Controls) { if (c is PictureBox) { PictureBox pic = (PictureBox)c; if (pic.Image != null) { int id = Convert.ToInt32(pic.Tag); imgList.Add(id); } } } } } } if (imgList.Count > 0) { IUploadService us = FactoryService.CreateInstance(); int _failCount = us.DeleteImage(imgList.ToArray()); //int _failCount = dlService.RemoveImgsByThumbnail(imgList.ToArray()); if (_failCount > 0) { MessageBox.Show("删除完成,失败'" + _failCount + "'张"); } else { MessageBox.Show("删除完成"); } LoadService(); } }
public IActionResult Index(int Id = -1) { ProductionService ps = new ProductionService(_Context); FactoryService fs = new FactoryService(_Context); ViewBag.factories = fs.GetAllFactoriesSimple(); List <ProductionViewModel> res = new List <ProductionViewModel>(); if (Id != -1) { res = ps.GetallProduction(Id); } return(View(res)); }