private void frmDecleration_Load(object sender, EventArgs e) { try { this.FormClosed += new FormClosedEventHandler(frmDecleration_FormClosed); this.Text = "Danh sách tờ khai" + ConstantInfo.MESSAGE_TITLE; // Show form to the center this.Location = new Point((this.ParentForm.Width - this.Width) / 2, (this.ParentForm.Height - this.Height) / 2); _declarationBOL = new DeclarationFactory(); this._listDeclarationinfo = DeclarationFactory.SelectAllFromView(); BindData(); txtDeclaraceNumber.Focus(); InitialPermission(); //Start a timer // The secret here :) this.aTimer = new System.Timers.Timer(); this.aTimer.Elapsed += new ElapsedEventHandler(OnTimerMonitor); this.aTimer.Interval = Convert.ToInt32(System.Configuration.ConfigurationSettings.AppSettings["TimeDelay"]) * 1000; this.aTimer.Enabled = true; } catch (Exception ex) { logger.Error(ex.ToString()); if (GlobalInfo.IsDebug) MessageBox.Show(ex.ToString()); } }
private void frmExport_Load(object sender, EventArgs e) { txtExportTotalVehicles.Focus(); this.Text = "Khai báo xuất nhập cảnh" + ConstantInfo.MESSAGE_TITLE; // Show form to the center this.Location = new Point((this.ParentForm.Width - this.Width) / 2, (this.ParentForm.Height - this.Height) / 2); _declarationBOL = new DeclarationFactory(); _vehicleBOL = new VehicleFactory(); // Init form. Init(); InitialPermission(); }
private void btnSaveAll_Click(object sender, EventArgs e) { try { DeclarationFactory _declarationBOL = new DeclarationFactory(); var declarationInfo = GetDeclarationInfo(); declarationInfo.ModifiedDate = DateTime.Now; declarationInfo.ModifiedByID = _userInfo.UserID; if (VehicleInfosTemp.Count == 0) throw new Exception("Phương tiện không được để trống"); List<tblVehicle> listVehicle = new List<tblVehicle>(); foreach (VehicleInfo info in VehicleInfosTemp) { tblVehicle vehicleInfo = new tblVehicle(); vehicleInfo.DriverName = info.DriverName; vehicleInfo.PlateNumber = info.PlateNumber; vehicleInfo.NumberOfContainer = info.NumberOfContainer; vehicleInfo.ExportDate = info.ExportDate; vehicleInfo.ConfirmExportBy = info.ConfirmExportBy; vehicleInfo.ImportDate = info.ImportDate; vehicleInfo.ConfirmImportBy = info.ConfirmImportBy; vehicleInfo.Status = vehicleInfo.Status; vehicleInfo.Note = vehicleInfo.Note; vehicleInfo.VehicleID = info.VehicleID; vehicleInfo.IsExport = info.IsExport; vehicleInfo.IsImport = info.IsImport; vehicleInfo.IsCompleted = info.IsCompleted; listVehicle.Add(vehicleInfo); } _declarationBOL.AddDeclaration(declarationInfo, listVehicle, _userInfo.UserID); MessageBox.Show(ConstantInfo.MESSAGE_INSERT_SUCESSFULLY); // Reset form ResetForm(); } catch (Exception ex) { logger.Error(ex.ToString()); if (GlobalInfo.IsDebug) MessageBox.Show(ex.ToString()); } }