private void Search() { _projectDataContext = new ProjectDataContext(); _programFunctionMasterRepository = new ProgramFunctionMasterRepository(_projectDataContext); dgvDuLieu.DataSource = _programFunctionMasterRepository.GetAll().OrderBy(_ => _.ProgramName); Control(); }
private void Search() { _projectDataContext = new ProjectDataContext(); _moldRepository = new MoldRepository(_projectDataContext); dgvDuLieu.DataSource = _moldRepository.GetAll().OrderBy(_ => _.MoldNo); Control(); }
private void Search() { _projectDataContext = new ProjectDataContext(); _customerRepository = new CustomerRepository(_projectDataContext); dgvDuLieu.DataSource = _customerRepository.GetAll().OrderBy(_ => _.CustomerName); Control(); }
private void Search() { _projectDataContext = new ProjectDataContext(); _productRepository = new ProductRepository(_projectDataContext); dgvDuLieu.DataSource = _productRepository.GetList().OrderBy(_ => _.CategoryName).ThenBy(_ => _.ItemName); Control(); }
private void Search() { _projectDataContext = new ProjectDataContext(); _languageLibraryRepository = new LanguageLibraryRepository(_projectDataContext); dgvDuLieu.DataSource = _languageLibraryRepository.GetAll().OrderBy(_ => _.Vietnamese); Control(); }
private void Search() { _projectDataContext = new ProjectDataContext(); _partNumberRepository = new PartNumberRepository(_projectDataContext); dgvDuLieu.DataSource = _partNumberRepository.GetAll().OrderBy(_ => _.PartNo); Control(); }
// GET: Home public ActionResult Index() { var db = new ProjectDataContext(); var result = db.sp_Student_All(); return(View(result.ToList())); }
private void Search() { _projectDataContext = new ProjectDataContext(); _authorityGroupRepository = new AuthorityGroupRepository(_projectDataContext); dgvDuLieu.DataSource = _authorityGroupRepository.GetAll().OrderBy(_ => _.AuthorityGroupName); Control(); }
private void Search() { _projectDataContext = new ProjectDataContext(); _agencyRepository = new AgencyRepository(_projectDataContext); dgvDuLieu.DataSource = _agencyRepository.GetAll().OrderBy(_ => _.AgencyName); Control(); }
private void ResponseAskProject() { var dc = new ProjectDataContext(this.UserCD); var l = new List <IButton>(); foreach (var rProject in dc.CreateProjectList_Get()) { var bt = new PostbackButton(); bt.Title = rProject.DisplayName; var cm = new PayloadCommand(); cm.CommandName = BotCommandName.TaskAdd; cm.MethodName = "SelectProject"; cm.Value = rProject.ProjectCD.ToString(); bt.SetPayload(cm); l.Add(bt); } var cl = new FacebookBotClient(); foreach (var item in ButtonTemplateMessage.Create(this.RecipientID , this.TextManager.Text(BotTextKey.PleaseSelectProject), l)) { cl.SendMessage(item); } }
private void Search() { _projectDataContext = new ProjectDataContext(); _shiftRepository = new ShiftRepository(_projectDataContext); dgvDuLieu.DataSource = _shiftRepository.GetAll().OrderBy(_ => _.ShiftNo); Control(); }
private void frmScanBarcode_Load(object sender, EventArgs e) { _projectDataContext = new ProjectDataContext(); _scanBarcodeRepository = new ScanBarcodeRepository(_projectDataContext); _registBarcodeRepository = new RegistBarcodeRepository(_projectDataContext); _partNumberRepository = new PartNumberRepository(_projectDataContext); _machineRepository = new MachineRepository(_projectDataContext); _moldRepository = new MoldRepository(_projectDataContext); _shiftRepository = new ShiftRepository(_projectDataContext); LanguageTranslate.ChangeLanguageForm(this); LoadCount(); LoadPartNumberData(); LoadMachineData(); LoadMoldData(); _serialPort = new SerialPort(); _serialPort.DataReceived += new SerialDataReceivedEventHandler(this.serialPort_DataReceived); Control.CheckForIllegalCrossThreadCalls = false; ClosePortCOM(GlobalConstants.portCOM); OpenPortCOM(GlobalConstants.portCOM, 9600); timer.Enabled = true; txtBarcode.Focus(); }
private void Search() { _projectDataContext = new ProjectDataContext(); _userRepository = new UserRepository(_projectDataContext); dgvDuLieu.DataSource = _userRepository.GetAll().OrderBy(_ => _.Username); Control(); }
private void Search() { _projectDataContext = new ProjectDataContext(); _warehouseRepository = new WarehouseRepository(_projectDataContext); dgvDuLieu.DataSource = _warehouseRepository.GetAll().OrderBy(_ => _.WarehouseName); Control(); }
private void frmLanguageLibrary_Load(object sender, EventArgs e) { _projectDataContext = new ProjectDataContext(); LanguageTranslate.ChangeLanguageForm(this); LanguageTranslate.ChangeLanguageGridView(viewDuLieu); Search(); }
private void frmSetting_Load(object sender, EventArgs e) { _projectDataContext = new ProjectDataContext(); _settingMasterRepository = new SettingMasterRepository(_projectDataContext); LanguageTranslate.ChangeLanguageForm(this); GetData(); }
private void Save(bool submit) { try { if (!CheckData()) { return; } _projectDataContext = new ProjectDataContext(); _orderRepository = new OrderRepository(_projectDataContext); _orderDetailRepository = new OrderDetailRepository(_projectDataContext); _productRepository = new ProductRepository(_projectDataContext); //Table Order Order order = new Order(); order.OrderDate = dtpOrderDate.Value; order.CarNumberOrder = txtCarNumberOrder.Text.Trim(); order.UseCarStatus = (chkCompany.Checked ? GlobalConstants.UseCarStatusValue.Company : GlobalConstants.UseCarStatusValue.Agency); order.Total = float.Parse(txtTongTienChuaBaoGomVAT.Text); order.VAT = (float)txtVAT.Value; order.VATMoney = float.Parse(txtTienVAT.Text); order.ProcessingCarStatus = GlobalConstants.ProcessingCarStatusValue.None; order.ProcessingStatus = (submit ? GlobalConstants.ProcessingStatusValue.WaitApprove : GlobalConstants.ProcessingStatusValue.None); _orderRepository.Save(order); txtOrderNo.Text = _orderRepository.id; for (int i = 0; i < viewDuLieu.RowCount; i++) { //Table OrderDetail OrderDetail orderDetail = new OrderDetail(); orderDetail.OrderId = txtOrderNo.Text; orderDetail.ItemId = viewDuLieu.GetRowCellValue(i, "ProductId").ToString(); orderDetail.Quantity = float.Parse(viewDuLieu.GetRowCellValue(i, "Quantity").ToString()); orderDetail.Price = float.Parse(viewDuLieu.GetRowCellValue(i, "Price").ToString()); orderDetail.Discount = 0; orderDetail.DiscountMoney = 0; _orderDetailRepository.Save(orderDetail); //Table Product _productRepository.CaculateRemainVirtual(viewDuLieu.GetRowCellValue(i, "ProductId").ToString(), float.Parse(viewDuLieu.GetRowCellValue(i, "Quantity").ToString())); } UnitOfWork productOfWork = new UnitOfWork(_projectDataContext); int result = productOfWork.Complete(); if (result > 0) { XtraMessageBox.Show(LanguageTranslate.ChangeLanguageText("Lưu thành công"), LanguageTranslate.ChangeLanguageText("Thông báo")); Clear(); } else { XtraMessageBox.Show(LanguageTranslate.ChangeLanguageText("Lưu thất bại"), LanguageTranslate.ChangeLanguageText("Thông báo"), MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } catch (Exception ex) { XtraMessageBox.Show(LanguageTranslate.ChangeLanguageText("Lưu thất bại"), LanguageTranslate.ChangeLanguageText("Thông báo"), MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } }
// GET: Home/Delete/5 public ActionResult Delete(int id) { var db = new ProjectDataContext(); SqlParameter par = new SqlParameter("@StudentId", id); var data = db.Database.SqlQuery <Student>("exec sp_Student_id @StudentId", par).SingleOrDefault(); return(View(data)); }
public static IMeasurementService GetMeasurementInstance() { IDbContext dbContext = new ProjectDataContext("Project.Data.ProjectDataContext"); IRepository <Measurement> measurementService = new EfRepository <Measurement>(dbContext); IMeasurementService measurementService1 = new MeasurementService(measurementService, new MemoryCacheManager()); return(measurementService1); }
public void ShouldInsertCategory() { IDbContext dbContext = new ProjectDataContext("Project.Data.ProjectDataContext"); IRepository <Category> categoryRepo = new EfRepository <Category>(dbContext); IRepository <ProductCategory> productcategoryRepo = new EfRepository <ProductCategory>(dbContext); ICategoryService categoryService = new CategoryService(categoryRepo, new MemoryCacheManager(), productcategoryRepo); var existingProductCategoryMapping = categoryService.GetProductCategoriesByProductId(1, true); Assert.IsTrue(existingProductCategoryMapping.Count == 1); }
private void Search() { _projectDataContext = new ProjectDataContext(); _registBarcodeRepository = new RegistBarcodeRepository(_projectDataContext); DateTime fromDate = DateTime.Parse(dtpFromDate.Value.ToString("yyyy-MM-dd 00:00:00")); DateTime toDate = DateTime.Parse(dtpToDate.Value.ToString("yyyy-MM-dd 23:59:59")); dgvDuLieu.DataSource = _registBarcodeRepository.GetReportSyntheticRegistBarcode(fromDate, toDate).OrderBy(_ => _.RegistDate).ThenBy(_ => _.PartNo); Control(); }
public void ShouldGetData() { IDbContext dbContext = new ProjectDataContext("Project.Data.ProjectDataContext"); IRepository <Category> categoryRepo = new EfRepository <Category>(dbContext); IRepository <Product> productRepository = new EfRepository <Product>(dbContext); IProductService productService = new ProductService(productRepository, new MemoryCacheManager()); var data = productService.GetProductById(2); Assert.IsTrue(data != null); }
private void Search() { _projectDataContext = new ProjectDataContext(); _scanBarcodeRepository = new ScanBarcodeRepository(_projectDataContext); List <Expression <Func <ScanBarcode, bool> > > expressions = new List <Expression <Func <ScanBarcode, bool> > >(); DateTime fromDate = DateTime.Parse(dtpFromDate.Value.ToString("yyyy-MM-dd 00:00:00")); DateTime toDate = DateTime.Parse(dtpToDate.Value.ToString("yyyy-MM-dd 23:59:59")); expressions.Add(_ => _.ScanDate >= fromDate && _.ScanDate <= toDate); dgvDuLieu.DataSource = _scanBarcodeRepository.Find(expressions).OrderBy(_ => _.ScanDate); Control(); }
private void Search() { _projectDataContext = new ProjectDataContext(); _productionPlanRepository = new ProductionPlanRepository(_projectDataContext); List <Expression <Func <ProductionPlan, bool> > > expressions = new List <Expression <Func <ProductionPlan, bool> > >(); DateTime fromDate = DateTime.Parse(dtpFromDate.Value.ToString("yyyy-MM-dd 00:00:00")); DateTime toDate = DateTime.Parse(dtpToDate.Value.ToString("yyyy-MM-dd 23:59:59")); expressions.Add(_ => _.ExpectedDeliveryDate >= fromDate && _.ExpectedDeliveryDate <= toDate); dgvDuLieu.DataSource = _productionPlanRepository.Find(expressions).OrderBy(_ => _.WorkOrder); Control(); }
private void ResponseAskUser() { var dc = new ProjectDataContext(this.UserCD); var l = new List <IButton>(); { var rUser = WebApp.Current.DatabaseCache.User.SelectByPrimaryKey(this.UserCD); var bt = new PostbackButton(); bt.Title = this.Text(TextKey.ByMyself); var cm = new PayloadCommand(); cm.CommandName = BotCommandName.TaskAdd; cm.MethodName = "SelectUser"; cm.Value = this.UserCD.ToString(); bt.SetPayload(cm); l.Add(bt); } { var bt = new PostbackButton(); bt.Title = this.Text(TextKey.NotAssigned); var cm = new PayloadCommand(); cm.CommandName = BotCommandName.TaskAdd; cm.MethodName = "SelectUser"; cm.Value = ""; bt.SetPayload(cm); l.Add(bt); } foreach (var item in dc.Project_User_List_Data_Get(this.Data.ProjectCD.Value)) { if (item.UserCD == this.UserCD) { continue; } var rUser = item.User; var bt = new PostbackButton(); bt.Title = rUser.DisplayName; var cm = new PayloadCommand(); cm.CommandName = BotCommandName.TaskAdd; cm.MethodName = "SelectUser"; cm.Value = rUser.UserCD.ToString(); bt.SetPayload(cm); l.Add(bt); } var cl = new FacebookBotClient(); foreach (var item in ButtonTemplateMessage.Create(this.RecipientID , this.TextManager.Text(BotTextKey.PleaseSelectTaskUser), l)) { cl.SendMessage(item); } }
public void TestMethod1() { using (ProjectDataContext pdc = new ProjectDataContext()) { var customerTable = pdc.Set <Customer>(); customerTable.Add(new Customer() { Name = "dinesh", City = "pune", State = "maharashtra", Email = "*****@*****.**" }); pdc.SaveChanges(); Assert.IsTrue(customerTable != null); Assert.IsTrue(customerTable.Count() == 1); } }
private void frmSignIn_Load(object sender, EventArgs e) { _projectDataContext = new ProjectDataContext(); _userRepository = new UserRepository(_projectDataContext); LoadLanguage(GlobalConstants.language); LanguageTranslate.ChangeLanguageForm(this); lblTieuDe.Text = GlobalConstants.Company; chkKeepMeSignedIn.Checked = Properties.Settings.Default.KeepMeSignedIn; if (chkKeepMeSignedIn.Checked) { txtUsername.Text = Properties.Settings.Default.Username; txtPassword.Text = Properties.Settings.Default.Password; } }
public ActionResult Delete(int id, FormCollection collection) { try { var db = new ProjectDataContext(); SqlParameter par = new SqlParameter("@StudentId", id); var data = db.Database.SqlQuery <Student>("exec sp_Student_Delete @StudentId", par).SingleOrDefault(); return(RedirectToAction("Index")); } catch { return(View()); } }
private void frmLanguageLibraryAddEdit_Load(object sender, EventArgs e) { _projectDataContext = new ProjectDataContext(); _languageLibraryRepository = new LanguageLibraryRepository(_projectDataContext); LanguageTranslate.ChangeLanguageForm(this); if (String.IsNullOrEmpty(_id)) { Clear(); } else { GetData(); } }
public void ShouldUpdateData() { IDbContext dbContext = new ProjectDataContext("Project.Data.ProjectDataContext"); IRepository <Customer> categoryRepo = new EfRepository <Customer>(dbContext); IRepository <ProductCategory> productcategoryRepo = new EfRepository <ProductCategory>(dbContext); ICustomerService customerService = new CustomerService(categoryRepo, new MemoryCacheManager()); EngineContext.Current.Initialize(); Customer customer = customerService.GetCustomerById(1); CustomerModel customerModel = customer.ToModel(); GetInstance().Edit(customerModel); }
/// <summary> /// Import procedure. /// </summary> /// <param name="parameters">Process parameters.</param> private void _Import(ProcessParams parameters) { Debug.Assert(null != _informer); // inited Debug.Assert(null != parameters); // created ImportProfile profile = parameters.Profile; ICancellationChecker cancelChecker = parameters.CancelChecker; // do import operation from source var projectData = new ProjectDataContext(App.Current.Project); _importer.Import(profile, parameters.DataProvider, parameters.DefaultDate, projectData, cancelChecker); cancelChecker.ThrowIfCancellationRequested(); IList<AppData.DataObject> importedObjects = _importer.ImportedObjects; // do geocode imported objects if ((null != _geocoder) && (0 < importedObjects.Count)) { Geocoder.GeocodeType type = _GetGeocodeType(profile.Settings); _geocoder.Geocode(importedObjects, type, cancelChecker); } _AddObjectsToFeatureServiceIfNeeded(importedObjects); cancelChecker.ThrowIfCancellationRequested(); // commit additions of related objects _informer.ParentPage.Dispatcher.BeginInvoke(new Action(() => { projectData.Commit(); projectData.Dispose(); }), System.Windows.Threading.DispatcherPriority.Send); cancelChecker.ThrowIfCancellationRequested(); }