private void btnApprove_Click(object sender, EventArgs e) { if (Popup.ShowPopup("Are you sure you want to approve this request?", frmPopup.PopupType.OK_Cancel) == frmPopup.PopupResult.OK) { DialogResult = DialogResult.OK; } }
public static void ShowMessage(string msg) { if (_frmPopup == null) { _frmPopup = new frmPopup(GuiCommon.HMDevXManager); } _frmPopup.ShowPopup(msg); }
private void AlertForItemPrice() { String ItemName = null; // DateTime CurrentDate; CPriceMasterBO oPriceMasterBO = new CPriceMasterBO(); CResult oResultPriceMaster = new CResult(); CPriceMaster oPriceMaster = new CPriceMaster(); oResultPriceMaster = oPriceMasterBO.ReadAllForAlert(); if (oResultPriceMaster.IsSuccess) { DataTable dt = oResultPriceMaster.Data as DataTable; foreach (DataRow dr in dt.Rows) { oPriceMaster.Price_ToDate = DateTime.Parse(dr["Price_ToDate"].ToString()); //ToString("dd-MM-yy"); oPriceMaster.Price_ItemOId = dr["Price_ItemOId"].ToString(); oPriceMaster.Price_ItemName = dr["ItemName"].ToString(); // if (oPriceMaster.Price_ToDate < CurrentDate) ItemName = ItemName + oPriceMaster.Price_ItemName.ToString() + "\n"; } } if (ItemName != null) { frmPopup ofrmPopUp = new frmPopup(PopupSkins.AlertSkin); ofrmPopUp.ShowPopup("Price Update!!", "Price Should Be Updated Following Items-" + ItemName + "", 500, 10000, 500); } }
private void CommandReceived(object sender, CommandEventArgs e) { var msg = string.Empty; switch (e.Command.CommandType) { case CommandType.UserAlreadyExists: msg = "The User name is already exists !"; break; case CommandType.InvalidCredentials: msg = "Inavlid User name and/or Password !"; break; case CommandType.UserAlreadyConnected: msg = "The User name is already connected !"; break; case CommandType.ValidCredentials: _canClose = true; Close(); break; } if (e.Command.CommandType != CommandType.ValidCredentials) { frmPopup popup = new frmPopup(PopupSkins.SmallInfoSkin); popup.ShowPopup("Error", msg, 300, 2000, 2000); _client.Disconnect(); SetEnablity(true); } }
void CommandReceived(object sender, Project.CommandClient.CommandEventArgs e) { if (e.Command.CommandType == Project.CommandClient.CommandType.IsNameExists) { if (e.Command.MetaData.ToLower() == "true") { frmPopup popup = new frmPopup(PopupSkins.SmallInfoSkin); popup.ShowPopup("Error", "The Username is already exists !", 300, 2000, 2000); this.client.Disconnect(); this.SetEnablity(true); } else { this.canClose = true; this.Close(); } } if (e.Command.CommandType == Project.CommandClient.CommandType.LoginSuccessful) { this.IsLoginSuccessful = true; this.MessageRecievedFromServer = e.Command.MetaData; } if (e.Command.CommandType == Project.CommandClient.CommandType.LoginUnsuccessful) { this.IsLoginSuccessful = false; this.MessageRecievedFromServer = e.Command.MetaData; } }
public void Init(HMCon con, TUC_HMDevXManager.TUC_HMDevXManager hmDevMgr, GridView gv, List <IMapLayer> layers, List <PosGenerator> posGens) { _hmCon = con; _hmDevMgr = hmDevMgr; _gv = gv; _layers = layers; _posGens = posGens; linkGen.Enabled = _posGens != null; _pop = new frmPopup(_hmDevMgr); if (!ArcGISRuntimeEnvironment.IsInitialized) { try { //ArcGISRuntimeEnvironment.InstallPath = Application.StartupPath; ArcGISRuntimeEnvironment.ClientId = "EdzP18VEt80l7prT"; ArcGISRuntimeEnvironment.Initialize(); } catch (Exception ex) { _pop.ShowPopup($"Unable to initialize the ArcGIS Runtime with the client ID provided: {ex.Message}"); } } _hmDevMgr.FormInit(this); }
private void linkShowMap_OpenLink(object sender, DevExpress.XtraEditors.Controls.OpenLinkEventArgs e) { var list = GetDataList(); Form frm = new Form(); CL_Dialog.PleaseWait.Show("Loading...\r\nPlease Wait", null); ucMapViewer map = new ucMapViewer(_hmDevMgr); foreach (var layer in _layers) { List <IGeoInfo> data = null; try { data = MapData.GetDataList(_hmCon, list, layer); } catch (Exception ex) { _pop.ShowPopup($"Fail in loading {layer.LinkTable}: {ex.Message}"); } map.AddLayer(data, layer); } map.NoMoreLayer(); frm.WindowState = FormWindowState.Maximized; frm.StartPosition = FormStartPosition.CenterScreen; frm.Icon = this.ParentForm.Icon; frm.Text = "Map"; map.Parent = frm; map.Dock = DockStyle.Fill; CL_Dialog.PleaseWait.Hide(); frm.Show(); }
private void client_ConnectingFailed(object sender, EventArgs e) { frmPopup popup = new frmPopup(PopupSkins.SmallInfoSkin); popup.ShowPopup("Error", "Server Is Not Accessible !", 200, 2000, 2000); this.SetEnablity(true); }
private void btnFile_Click(object sender, EventArgs e) { using (OpenFileDialog frm = new OpenFileDialog()) { frm.DefaultExt = "geojson"; frm.Filter = "geojson files (*.geojson)|*.geojson"; frm.InitialDirectory = " C:\\"; frm.RestoreDirectory = true; frm.Title = "Import data from a GeoJson file"; frm.CheckFileExists = true; if (frm.ShowDialog() == DialogResult.OK) { txtFile.Text = frm.FileName; try { var content = File.ReadAllText(txtFile.Text); FeatureCollection fs = JsonConvert.DeserializeObject <FeatureCollection>(content); _table.Select().ToList().ForEach(row => { row[ColumnNames.NewData] = string.Empty; row[ColumnNames.Action] = ImportAction.Ignore; }); foreach (Feature f in fs.Features) { string code = f.Properties[MatchAttr].ToString(); var row = _table.Rows.Find($"{code}"); if (row != null) { if (IsValidType(f.Geometry)) { row[ColumnNames.NewData] = strYes; row[ColumnNames.Action] = ($"{row[ColumnNames.OldData]}" == strYes) ? ImportAction.Overwrite : ImportAction.Add; } } } } catch (Exception ex) { _pop.ShowPopup("Cannot read the file, please ensure that you've provided a valid GeoJson import file format. " + ex.Message); } } } }
private void riceAlertEnabled_EditValueChanged(object sender, EventArgs e) { DataRow dr = gvAlert.GetDataRow(gvAlert.FocusedRowHandle); if (dr != null) { CheckEdit CE = sender as CheckEdit; object oAlert_ID = dr["ID"]; if (oAlert_ID != null && oAlert_ID != DBNull.Value) { if (Convert.ToInt32(oAlert_ID) == 71 && CE.Checked) { Popup.ShowPopup("Only newly breached notifications will be sent."); Connection.SQLExecutor.ExecuteNonQuery("exec PC_BudgetNotificationsTurnedOn", Connection.TRConnection); } } string sUpdate = "update AlertPointRequired set required='" + CE.EditValue + "' where id=" + dr["ID1"]; Connection.SQLExecutor.ExecuteNonQuery(sUpdate, Connection.TRConnection); } }
public void AddLayer(List <IGeoInfo> list, IMapLayer layerInfo) { if (list == null || list.Count == 0) { return; } Layer layer = new Layer(); layer.GraphicsLayer = new GraphicsLayer(); layer.Info = layerInfo; _layerList.Add(layer); mapView.Map.Layers.Add(layer.GraphicsLayer); try { if (layerInfo is MapPointLayer) { AddPoinLayer(list, layer); } else if (layerInfo is MapShapeLayer) { AddShapeLayer(list, layer); } else if (layerInfo is MapLineLayer) { AddLineLayer(list, layer); } else if (layerInfo is MapEventLayer) { AddEventLayer(list, layer); } } catch (Exception ex) { _pop.ShowPopup("Unable to create map: " + ex.Message, "Error"); } }
private void LoginToServer() { if (this.txtUsetName.Text.Trim() == "") { frmPopup popup = new frmPopup(PopupSkins.SmallInfoSkin); popup.ShowPopup("Error", "Username is empty !", 1000, 2000, 2000); this.SetEnablity(true); } else { this.client.NetworkName = this.txtUsetName.Text.Trim(); this.client.ConnectToServer(); } }
private void CommandReceived(object sender, CommandEventArgs e) { if (e.Command.CommandType == CommandType.RoomAlreadyExists) { frmPopup popup = new frmPopup(PopupSkins.SmallInfoSkin); popup.ShowPopup("Error", "The Room name is already exists !", 300, 2000, 2000); SetEnablity(true); } else if (e.Command.CommandType == CommandType.RoomCreated) { _created = true; _canClose = true; Close(); } }
private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { if (listViewMessage.SelectedItems.Count > 0) { var index = listViewMessage.Items.IndexOf(listViewMessage.SelectedItems[0]); if (_client.UserName.Equals(_messages[index].User)) { // Delete only your own messages ! _client.SendCommand(new CommandContainer(CommandType.RemoveMessage, new MessageContainer(_messages[index]))); } else { frmPopup popup = new frmPopup(PopupSkins.SmallInfoSkin); popup.ShowPopup("Info", "You can only remove your own messages !", 200, 2000, 2000); } } }
private void btnSearch_Click(object sender, EventArgs e) { if (dtFrom.EditValue != DBNull.Value && dtFrom.EditValue != null && dtTo.EditValue != DBNull.Value && dtTo.EditValue != null) { if (dtFrom.DateTime.CompareTo(dtTo.DateTime) == 1) { Popup.ShowPopup("Received from date cannot be greater than the received to date."); return; } } dsAlert1.Clear(); if (CriteriaSelected()) { string sAAP_ID = "-1"; if (lueAlertType.EditValue != null) { sAAP_ID = lueAlertType.EditValue.ToString(); } string sFrom = "null"; if (dtFrom.EditValue != null) { sFrom = "'" + dtFrom.DateTime.ToShortDateString() + " 11:59:59 PM'"; } string sTo = "null"; if (dtTo.EditValue != null) { sTo = "'" + dtTo.DateTime.ToShortDateString() + " 11:59:59 PM'"; } string sSQL = "exec sp_FillAlertSearch '" + Connection.MLUser + "'," + sAAP_ID + ",'" + txtSubject.Text.Trim().Replace("'", "''") + "', " + sFrom + ", " + sTo + " "; Connection.SQLExecutor.ExecuteNonQuery(sSQL, Connection.TRConnection); daAlert.SelectCommand.CommandText = AlertSearchSelect; } else { daAlert.SelectCommand.CommandText = AlertSelect; } daAlert.Fill(dsAlert1); gvAlerts.ExpandAllGroups(); }
void CommandReceived(object sender, CommandEventArgs e) { if (e.Command.CommandType == CommandType.IsNameExists) { if (e.Command.MetaData.ToLower() == "true") { var popup = new frmPopup(PopupSkins.SmallInfoSkin); popup.ShowPopup("Error", "The Username is already exists !", 300, 2000, 2000); Client.Disconnect(); SetEnablity(true); } else { _canClose = true; Close(); } } }
void CommandReceived(object sender, Proshot.CommandClient.CommandEventArgs e) { if (e.Command.CommandType == Proshot.CommandClient.CommandType.IsNameExists) { if (e.Command.MetaData.ToLower() == "true") { frmPopup popup = new frmPopup(PopupSkins.SmallInfoSkin); popup.ShowPopup("Error", "The Username is already exists !", 300, 2000, 2000); this.client.Disconnect(); this.SetEnablity(true); } else { this.canClose = true; this.Close(); } } }
private void AlertForItemShortage() { CReorderLevelBO oReorderLevelBO = new CReorderLevelBO(); CResult oResultReorderLevel = new CResult(); CReorderLevel oReorderLevel = new CReorderLevel(); String ItemName = null; oResultReorderLevel = oReorderLevelBO.ReadAllReorderLevelData(oReorderLevel); if (oResultReorderLevel.IsSuccess) { foreach (CReorderLevel obj in oResultReorderLevel.Data as ArrayList) { oReorderLevel.Quantity = obj.Quantity; CInventoryBO oInventoryBO = new CInventoryBO(); CResult oResultInventory = new CResult(); CInventory oInventory = new CInventory(); oInventory.Invt_BranchOID = obj.Branch_ID; oInventory.Invt_LocOID = obj.Location_ID; oInventory.Invt_ItemOID = obj.Item_ID; oResultInventory = oInventoryBO.ReadForROL(oInventory); if (oResultInventory.IsSuccess) { foreach (CInventory oInv in oResultInventory.Data as ArrayList) { if (int.Parse(oInv.Invt_QTY.ToString()) < int.Parse(oReorderLevel.Quantity.ToString())) { ItemName = ItemName + oInv.Invt_ItemName.ToString() + "\n"; // MessageBox.Show("Item", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } } //MessageBox.Show("Shortage Of Following Items "+ItemName+"", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); if (ItemName != null) { frmPopup ofrmPopUp = new frmPopup(PopupSkins.AlertSkin); ofrmPopUp.ShowPopup("Item Shortage!!", "Shortage Of Following Items-" + ItemName + "", 500, 2000, 500); } } }
private void LoginToServer() { if (txtUserName.Text.Trim() == "") { frmPopup popup = new frmPopup(PopupSkins.SmallInfoSkin); popup.ShowPopup("Error", "Username is empty !", 1000, 2000, 2000); SetEnablity(true); } else if (txtPassword.Text.Trim() == "") { frmPopup popup = new frmPopup(PopupSkins.SmallInfoSkin); popup.ShowPopup("Error", "Password is empty !", 1000, 2000, 2000); SetEnablity(true); } else { _client.UserName = txtUserName.Text.Trim(); _client.Password = txtPassword.Text.Trim(); _client.ConnectToServer(); } }
private void SendRoomInfoToServer() { if (txtRoomName.Text.Trim() == "") { frmPopup popup = new frmPopup(PopupSkins.SmallInfoSkin); popup.ShowPopup("Error", "Room name is empty !", 1000, 2000, 2000); SetEnablity(true); } else if (txtRoomDescription.Text.Trim() == "") { frmPopup popup = new frmPopup(PopupSkins.SmallInfoSkin); popup.ShowPopup("Error", "Room description is empty !", 1000, 2000, 2000); SetEnablity(true); } else { _roomName = txtRoomName.Text.Trim(); _roomDescription = txtRoomDescription.Text.Trim(); var cmd = new CommandContainer(CommandType.CreateRoom, new RoomContainer(_roomName, _roomDescription)); _client.SendCommand(cmd); } }
private void mniSignup_Click(object sender, EventArgs e) { LoginFrm dlg = new LoginFrm(_serverIpv4, _serverPort, false); dlg.ShowDialog(); if (_client != null) { if (_client.Connected) { frmPopup popup = new frmPopup(PopupSkins.SmallInfoSkin); popup.ShowPopup("Warning", string.Format("Disconnected user {0} !", _client.UserName), 300, 2000, 2000); _client.SendCommand(new CommandContainer(CommandType.ClientLogOff, new ProfileContainer(_client.UserName, _client.Password))); } Text = "Offline"; _client.Disconnect(); lstViwUsers.Items.Clear(); ClearRoomItems(); CloseRooms(); } _client = dlg.Client; if (_client.Connected) { _client.CommandReceived += new CommandReceivedEventHandler(client_CommandReceived); _client.SendCommand(new CommandContainer(CommandType.RequestClientList, null)); _client.SendCommand(new CommandContainer(CommandType.RequestRoomList, null)); Text = "Online : " + _client.UserName; mniEnter.Text = "Log Off"; mniCreateRoom.Enabled = true; mniConnectMyProfile.Enabled = true; } else { _client = null; } }
public void Init(HMCon con, TUC_HMDevXManager.TUC_HMDevXManager hmDevMgr, List <DataRow> rowList, List <IMapLayer> layers) { _hmCon = con; _hmDevMgr = hmDevMgr; _layers = layers; _pop = new frmPopup(_hmDevMgr); _map = new WpfMapDrawBase(_hmDevMgr); host.Child = _map; _data = new Dictionary <int, List <IGeoInfo> >(); DrawTabFactory factory = new DrawTabFactory(); for (int i = 0; i < layers.Count; i++) { try { _map.RegisterLayer(i, layers[i]); ucDrawBase ucDraw = factory.CreateInstance(con, hmDevMgr, _map, layers[i], i); if (ucDraw != null) { ucDraw.DrawingStatusChanged += SetDrawingMode; if (ucDraw is ucDrawEvents) { ucDraw.ConvertTo <ucDrawEvents>().EventTypeChanged += FrmMapDraw_EventTypeChanged; ucDraw.ConvertTo <ucDrawEvents>().MarkerChanged += _map.EventMarkerChanged; _map.PointTapped += ucDraw.ConvertTo <ucDrawEvents>().SetPoint; } else if (ucDraw is ucDrawShape) { _map.ItemTapped += ucDraw.ConvertTo <ucDrawShape>().SetItem; } else if (ucDraw is ucDrawLine) { _map.ItemTapped += ucDraw.ConvertTo <ucDrawLine>().SetItem; } var page = tabControl.TabPages.Add(layers[i] is MapEventLayer ? "Event" : layers[i].LayerName); ucDraw.Parent = page; ucDraw.Dock = DockStyle.Fill; } _data.Add(i, MapData.GetDataList(con, rowList, layers[i])); } catch (ConstraintException ex) { _pop.ShowPopup($"Error in loading {layers[i].LinkTable}: {ex.Message}"); } } DataTable dataTable = new DataTable(); dataTable.Columns.Add(new DataColumn("#")); foreach (var layer in layers) { layer.Attributes.ToList().ForEach(attr => { if (dataTable.Columns.IndexOf(attr.LinkField) == -1) { DataColumn col = new DataColumn(attr.LinkField); col.Caption = attr.DisplayName; dataTable.Columns.Add(col); } }); } foreach (var srcRow in rowList) { var row = dataTable.NewRow(); foreach (var layer in layers) { row["#"] = srcRow[layer.LinkColumn]; layer.Attributes.ToList().ForEach(attr => row[attr.LinkField] = attr.LinkDictionary?[$"{srcRow[attr.LinkField]}"] ?? srcRow[attr.LinkField]); } dataTable.Rows.Add(row); } gc.DataSource = dataTable; InDrawingStatus(false); }
private void LoginToServer() { if (txtUsetName.Text.Trim() == "") { var popup = new frmPopup(PopupSkins.SmallInfoSkin); popup.ShowPopup("Error", "Username is empty !", 1000, 2000, 2000); SetEnablity(true); } else { Client.NetworkName = txtUsetName.Text.Trim(); Client.ConnectToServer(); } }
private void frmGerarXmlNfe_Load(object sender, EventArgs e) { try { foreach (Control ctl in this.Controls) { if ((ctl) is MdiClient) { ctl.BackColor = Color.White; break; } } if (ApplicationDeployment.IsNetworkDeployed) { ApplicationDeployment ad = ApplicationDeployment.CurrentDeployment; lblVersao.Text = "Versão Atual: " + ad.CurrentVersion.ToString(); belStatic.sVersaoAtual = ad.CurrentVersion.ToString(); belVersionamento objbelVersion = new belVersionamento(); if (objbelVersion.VerificaPublicacaoDisponivel()) { frmPopup popup = new frmPopup(PopupSkins.InfoSkin); popup.ShowPopup("Atualização", "Uma nova versão do Sistema já está Disponível!", 200, 4000, 2000); tsAtualizacao.Visible = true; } else { tsAtualizacao.Visible = false; } versãoHlpToolStripMenuItem.Visible = false; } //Carrega os arquivos de configuração if (!Util.VerificaConfiguracaoPastasXml()) { frmLocalXml objfrm = new frmLocalXml(""); objfrm.ShowDialog(); } else { DirectoryInfo dinfo = new DirectoryInfo(belStatic.Pasta_xmls_Configs); if (!dinfo.Exists) { KryptonMessageBox.Show(null, "O caminho configurado abaixo não foi encontrado!! " + Environment.NewLine + Environment.NewLine + belStatic.Pasta_xmls_Configs, "A V I S O", MessageBoxButtons.OK, MessageBoxIcon.Information); frmLocalXml objfrm = new frmLocalXml(belStatic.Pasta_xmls_Configs); objfrm.ShowDialog(); } } int iCountFiles = 0; DirectoryInfo dPastaData = new DirectoryInfo(belStatic.Pasta_xmls_Configs); if (!dPastaData.Exists) { dPastaData.Create(); } else { FileInfo[] finfo = dPastaData.GetFiles("*.xml"); foreach (FileInfo item in finfo) { iCountFiles++; } } belStatic.IPrimeiroLoad = 1; if (iCountFiles != 0) { frmSelecionaConfigs objFrmSeleciona = new frmSelecionaConfigs(); objFrmSeleciona.ShowDialog(); if (objFrmSeleciona.bFecharApp) { throw new Exception("Fechar"); } if (!objFrmSeleciona.bESCRITA) { objFrmSeleciona.Hide(); belStatic.IPrimeiroLoad = 1; frmLogin objfrm = new frmLogin(); objfrm.ShowDialog(); CarregaDadosEmpresa(); VerificaAcessoUserEmprersa(sender, e); belStatic.IPrimeiroLoad = 0; lblUsuario.Text = "Usuário: " + belStatic.SUsuario; lblEmpresa.Text = belStatic.sNomeEmpresa; gerarAquivosXmlsToolStripMenuItem.Visible = true; tsNfe.Enabled = true; tsNfes.Enabled = true; headerMenuLateral.Visible = true; cx = new belConnection(); } else { gerarAquivosXmlsToolStripMenuItem.Visible = false; tsNfe.Enabled = false; tsNfes.Enabled = false; headerMenuLateral.Visible = false; } } else { if (KryptonMessageBox.Show(null, "Não existe nenhum arquivo de configuração na pasta Selecionada." + Environment.NewLine + Environment.NewLine + "Deseja selecionar uma outra Pasta ?", "A V I S O", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { frmLocalXml objfrm = new frmLocalXml(belStatic.Pasta_xmls_Configs); objfrm.ShowDialog(); Application.Restart(); this.Close(); } belStatic.BSemArquivo = true; frmLoginConfig objFrm = new frmLoginConfig(); objFrm.ShowDialog(); lblUsuario.Text = " Usuário : " + belStatic.SUsuario; } CarregaStatuModoSistema(); //carrega Logotipo Globais LeRegWin = new Globais(); LeRegWin.CarregaInfStaticas(); // INICIALIZA AS CONFIGURAÇÕES PADRÕES Byte[] bimagem = belUtil.carregaImagem(LeRegWin.LeRegConfig("Logotipo")); if (bimagem != null) { pictureBox1.BackgroundImage = belUtil.byteArrayToImage(bimagem); } HLP.Dao.daoEmailContador objdaoemailCont = new HLP.Dao.daoEmailContador(); if (objdaoemailCont.VerificaDiaParaEnviarEmail()) { try { KryptonMessageBox.Show("Hoje é dia de enviar Email para o Contador, Verifique suas Pendências!!", "A V I S O", MessageBoxButtons.OK, MessageBoxIcon.Information); NfeGerarXml.NFe.frmEmailContadorNfe objfrm = new NfeGerarXml.NFe.frmEmailContadorNfe(); objfrm.MdiParent = this; objfrm.Show(); } catch (Exception ex) { KryptonMessageBox.Show(null, ex.Message, "A V I S O", MessageBoxButtons.OK, MessageBoxIcon.Information); } } if (belStatic.RAMO == "TRANSPORTE") { btnNfe.Enabled = false; tsNfe.Enabled = false; btnNfes.Enabled = false; tsNfes.Enabled = false; btnCte.Enabled = true; tsCte.Enabled = true; btnCce.Enabled = false; tsCce.Enabled = false; //btnEmail.Enabled = false; //tsEmail.Enabled = false; tsOrganizarPasta.Enabled = false; tsProtocolos.Enabled = false; tsImportarXmlEscritor.Enabled = false; } else { btnNfe.Enabled = true; tsNfe.Enabled = true; btnNfes.Enabled = true; tsNfes.Enabled = true; btnCte.Enabled = false; tsCte.Enabled = false; btnCce.Enabled = true; tsCce.Enabled = true; btnEmail.Enabled = true; tsEmail.Enabled = true; tsOrganizarPasta.Enabled = true; tsProtocolos.Enabled = true; tsImportarXmlEscritor.Enabled = true; } } catch (FbException fbx) { KryptonMessageBox.Show(null, "Ocorreu uma falha ao montar a string de Conexão!" + Environment.NewLine + "Verifique se o arquivo está configurado corretamente!" + Environment.NewLine, "A V I S O", MessageBoxButtons.OK, MessageBoxIcon.Information); frmLocalXml objfrm = new frmLocalXml(belStatic.Pasta_xmls_Configs); frmLoginConfig objFrm = new frmLoginConfig(); objFrm.ShowDialog(); lblUsuario.Text = " Usuário : " + belStatic.SUsuario; Application.Restart(); } catch (Exception ex) { if (ex.Message.Equals("Fechar")) { this.Close(); } else { KryptonMessageBox.Show(ex.Message); } } }
public void Init(HMCon con, TUC_HMDevXManager.TUC_HMDevXManager hmDevMgr, List <DataRow> rowList, IMapLayer layer) { _hmCon = con; _hmDevMgr = hmDevMgr; _layer = layer; _pop = new frmPopup(_hmDevMgr); labelTableName.Text = _layer.LinkTable; labelFieldName.Text = layer.LinkColumn; labelFeatureName.Text = layer.LayerName; _table = new DataTable(); _table.Columns.Add(new DataColumn(ColumnNames.Key)); _table.PrimaryKey = new DataColumn[] { _table.Columns[ColumnNames.Key] }; layer.Attributes.ToList().ForEach(attr => _table.Columns.Add(new DataColumn(attr.DisplayName))); _table.Columns.Add(new DataColumn(ColumnNames.OldData)); _table.Columns.Add(new DataColumn(ColumnNames.NewData)); _table.Columns.Add(new DataColumn(ColumnNames.Action)); foreach (var srcRow in rowList) { var row = _table.NewRow(); row[ColumnNames.Key] = srcRow[layer.LinkColumn]; layer.Attributes.ToList().ForEach(attr => row[attr.DisplayName] = attr.LinkDictionary?[$"{srcRow[attr.LinkField]}"] ?? srcRow[attr.LinkField]); _table.Rows.Add(row); } try { if (rowList.Count > 0) { string linkCodeList = MapData.GetContentListString(rowList, layer.LinkColumn); string sql = ""; if (layer is MapEventLayer) { sql = $"select * from Geo_Event where EventTypeId={layer.ConvertTo<MapEventLayer>().TypeId} and LinkCode in ({linkCodeList})"; } else { sql = $"select * from Geo_Link where LinkTableName='{layer.LinkTable}' and Feature='{layer.LayerName}' and LinkCode in ({linkCodeList})"; } var linkTable = _hmCon.SQLExecutor.ExecuteDataAdapter(sql, _hmCon.TRConnection); _table.Select().ToList().ForEach(row => row[ColumnNames.OldData] = linkTable.Select($"LinkCode='{row[ColumnNames.Key]}'").Length > 0 ? strYes : string.Empty); _table.Select().ToList().ForEach(row => row[ColumnNames.Action] = ImportAction.Ignore); } } catch (Exception ex) { _pop.ShowPopup($"Error in loading: {ex.Message}"); } gc.DataSource = _table; _luAllAction = new RepositoryItemLookUpEdit(); _luAllAction.DataSource = new string[] { ImportAction.Ignore, ImportAction.Add, ImportAction.Overwrite, ImportAction.Delete }; gc.RepositoryItems.Add(_luAllAction); gv.Columns["Action"].ColumnEdit = _luAllAction; gv.Columns.ToList().ForEach(col => col.OptionsColumn.AllowEdit = col.FieldName == ColumnNames.Action); _luAction = new RepositoryItemLookUpEdit(); }
private void gvDetail_InvalidRowException(object sender, DevExpress.XtraGrid.Views.Base.InvalidRowExceptionEventArgs e) { Popup.ShowPopup(e.ErrorText); e.ExceptionMode = DevExpress.XtraEditors.Controls.ExceptionMode.NoAction; }
private void riApproveDecline_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { DataRow dr = gvRequest.GetDataRow(gvRequest.FocusedRowHandle); if (dr != null) { object oSUB_TYPE_C = dr["SUB_TYPE_C"]; if (oSUB_TYPE_C != null && oSUB_TYPE_C != DBNull.Value) { if (oSUB_TYPE_C.Equals("I")) { object oWS_INV_ID = dr["WS_INV_ID"]; object oSTATUS = dr["AP_ROUTING_STATUS"]; if (oWS_INV_ID != null && oWS_INV_ID != DBNull.Value) { if (oSTATUS.Equals("P")) { frmAppDec fAD = new frmAppDec(Connection, DevXMgr); if (fAD.ShowDialog() == DialogResult.OK) { string sSQL = @"select isnull(IsSubCon,0) from ws_inv_header where ws_inv_id = " + oWS_INV_ID; object oIsSubCon = Connection.SQLExecutor.ExecuteScalar(sSQL, Connection.TRConnection); if (oIsSubCon == null || oIsSubCon == DBNull.Value) { oIsSubCon = 0; } bool bValid = false; if (Convert.ToBoolean(oIsSubCon)) { if (WebInvDet.ValidateRequest()) { bValid = true; } } else { if (APInvDet.ValidateRequest()) { bValid = true; } } if (bValid) { //approved sSQL = "declare @message varchar(max) " + "begin tran " + "exec AP_ApprovePaymentReq '" + Connection.MLUser + "', " + oWS_INV_ID + ", '" + fAD.Notes + "', @message output " + "if( @message = 'OK') " + "begin " + " commit tran " + "end " + "else " + "begin " + " rollback tran " + "end " + "select @message"; string sMessage = "Error approving request."; object oResult = Connection.SQLExecutor.ExecuteScalar(sSQL, Connection.TRConnection); if (oResult != null && oResult != DBNull.Value) { sMessage = oResult.ToString(); } if (sMessage.Equals("OK")) { RefreshMe(true); } else { Popup.ShowPopup(sMessage); } } } else if (fAD.DialogResult == DialogResult.Ignore) { //declined string sSQL = "exec AP_DeclinePaymentReq '" + Connection.MLUser + "', " + oWS_INV_ID + ", '" + fAD.Notes + "'"; Connection.SQLExecutor.ExecuteNonQuery(sSQL, Connection.TRConnection); RefreshMe(true); } } else { Popup.ShowPopup("Payment request has already been delt with."); } } } else if (oSUB_TYPE_C.Equals("H")) { object oWS_HB_ID = dr["WS_HB_ID"]; object oSTATUS = dr["AP_ROUTING_STATUS"]; if (oWS_HB_ID != null && oWS_HB_ID != DBNull.Value) { if (oSTATUS.Equals("P")) { string sApprovalStatus = ""; frmAppDec fAD = new frmAppDec(Connection, DevXMgr); if (fAD.ShowDialog() == DialogResult.OK) { sApprovalStatus = "A";//approved } else if (fAD.DialogResult == DialogResult.Ignore) { sApprovalStatus = "D";//declined } if (!sApprovalStatus.Equals("")) { string sSQL = "exec AP_HBPayReqAppDec '" + Connection.MLUser + "', " + oWS_HB_ID + ", '" + fAD.Notes + "', '" + sApprovalStatus + "'"; Connection.SQLExecutor.ExecuteNonQuery(sSQL, Connection.TRConnection); RefreshMe(true); } } else { Popup.ShowPopup("Holdback payment request has already been delt with."); } } } } } }
public bool ValidateRequest() { bool bValid = true; string sMessage = ""; btnSave_Click(null, null); if (txtInvNo.Text.Trim().Equals("")) { bValid = false; xtraTabControl1.SelectedTabPageIndex = 0; txtInvNo.Focus(); sMessage = "Invoice number is required."; goto Error; } string sSelect = ""; if (_Origin.Equals("W")) { sSelect = @"declare @inv_no varchar(15), @supplier varchar(10) select @inv_no=con_inv_no, @supplier=supplier from ws_inv_header where ws_inv_id=" + _DetailID + @" select count(*) from ap_inv_header where inv_no=@inv_no and supplier=@supplier"; if (Convert.ToInt32(Connection.SQLExecutor.ExecuteScalar(sSelect, Connection.TRConnection)) > 0) { bValid = false; xtraTabControl1.SelectedTabPageIndex = 0; txtInvNo.Focus(); sMessage = "The selected invoice number already exists, a different number is required before this request can be approved."; goto Error; } } if (lueWHSE.EditValue == null || lueWHSE.EditValue == DBNull.Value) { bValid = false; xtraTabControl1.SelectedTabPageIndex = 0; lueWHSE.Focus(); sMessage = "A warehouse is required before this request can be approved."; goto Error; } if (lueGST.EditValue == null || lueGST.EditValue == DBNull.Value) { bValid = false; xtraTabControl1.SelectedTabPageIndex = 0; lueGST.Focus(); sMessage = "A " + lueGST.Text + " code is required before this request can be approved."; goto Error; } sSelect = "select COUNT(*) from WS_INV_DET where WS_INV_ID = " + _DetailID + " and GL_ACCOUNT is null"; if (Convert.ToInt32(Connection.SQLExecutor.ExecuteScalar(sSelect, Connection.TRConnection)) > 0) { bValid = false; xtraTabControl1.SelectedTabPageIndex = 1; sMessage = "All detail records require a GL Account before this request can be approved."; goto Error; } Error: if (!bValid) { Popup.ShowPopup(sMessage); } return(bValid); }
private void client_ConnectingFailed(object sender, EventArgs e) { var popup = new frmPopup(PopupSkins.SmallInfoSkin); popup.ShowPopup("Error", "Server Is Not Accessible !", 200, 2000, 2000); SetEnablity(true); }