private void Process() { try { List <ClientResponseDetail> lstClientResponseDetails = new List <ClientResponseDetail>(); int iret = GetDataForm(); if (iret > 0) { iret = new SMSProcess().LayTinNhanDen(DatabaseConstant.Action.LOAD_DATA, ref lstModems, ref objTinNhanDen, ref lstClientResponseDetails); CommonFunction.ThongBaoKetQua(lstClientResponseDetails); grdTinNhanDenDS.ItemsSource = objTinNhanDen.DSaReceivers; grdTinNhanDenDS.Rebind(); } else { LMessage.ShowMessage("M.DungChung.LoiKhongXacDinh", LMessage.MessageBoxType.Error); } } catch (Exception ex) { LMessage.ShowMessage("M.DungChung.LoiKhongXacDinh", LMessage.MessageBoxType.Error); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
private void LoadData() { List <MODEM> lstModems = new List <MODEM>(); List <ClientResponseDetail> lstClientResponseDetails = new List <ClientResponseDetail>(); int iret = new SMSProcess().Modem(DatabaseConstant.Action.LOAD, ref lstModems, ref lstClientResponseDetails); if (iret > 0) { grdTinNhanDenDS.ItemsSource = lstModems; grdTinNhanDenDS.Rebind(); } }
private void KhoiTaoCombobox() { AutoCompleteEntry auto = null; lstSourceTimeOut = new List <AutoCompleteEntry>(); lstSourceBaurate = new List <AutoCompleteEntry>(); lstSourcePortName = new List <AutoCompleteEntry>(); lstModems = new List <MODEM>(); List <ClientResponseDetail> lstClientResponseDetails = new List <ClientResponseDetail>(); int iret = new SMSProcess().Modem(DatabaseConstant.Action.LOAD_DATA, ref lstModems, ref lstClientResponseDetails); if (iret > 0) { foreach (MODEM modem in lstModems) { auto = new AutoCompleteEntry(modem.PORTNAME, modem.PORT.ToString(), modem.PORT.ToString(), modem.PORTNAME); lstSourcePortName.Add(auto); } } auto = new AutoCompleteEntry(300.ToString(), 300.ToString(), 300.ToString(), 300.ToString()); lstSourceBaurate.Add(auto); auto = new AutoCompleteEntry(1200.ToString(), 1200.ToString(), 1200.ToString(), 1200.ToString()); lstSourceBaurate.Add(auto); auto = new AutoCompleteEntry(2400.ToString(), 2400.ToString(), 2400.ToString(), 2400.ToString()); lstSourceBaurate.Add(auto); auto = new AutoCompleteEntry(4800.ToString(), 4800.ToString(), 4800.ToString(), 4800.ToString()); lstSourceBaurate.Add(auto); auto = new AutoCompleteEntry(9600.ToString(), 9600.ToString(), 9600.ToString(), 9600.ToString()); lstSourceBaurate.Add(auto); auto = new AutoCompleteEntry(14400.ToString(), 14400.ToString(), 14400.ToString(), 14400.ToString()); lstSourceBaurate.Add(auto); auto = new AutoCompleteEntry(19200.ToString(), 19200.ToString(), 19200.ToString(), 19200.ToString()); lstSourceBaurate.Add(auto); auto = new AutoCompleteEntry(28800.ToString(), 28800.ToString(), 28800.ToString(), 28800.ToString()); lstSourceBaurate.Add(auto); auto = new AutoCompleteEntry(38400.ToString(), 38400.ToString(), 38400.ToString(), 38400.ToString()); lstSourceBaurate.Add(auto); auto = new AutoCompleteEntry(57600.ToString(), 57600.ToString(), 57600.ToString(), 57600.ToString()); lstSourceBaurate.Add(auto); auto = new AutoCompleteEntry(115200.ToString(), 115200.ToString(), 115200.ToString(), 115200.ToString()); lstSourceBaurate.Add(auto); auto = new AutoCompleteEntry(230400.ToString(), 230400.ToString(), 230400.ToString(), 230400.ToString()); lstSourceBaurate.Add(auto); for (int i = 100; i <= 1000; i = i + 100) { auto = new AutoCompleteEntry(i.ToString(), i.ToString(), i.ToString(), i.ToString()); lstSourceTimeOut.Add(auto); } new AutoComboBox().GenAutoComboBox(ref lstSourcePortName, ref cmbPort, null); new AutoComboBox().GenAutoComboBox(ref lstSourceTimeOut, ref cmbTimeOut, null, null, "300"); new AutoComboBox().GenAutoComboBox(ref lstSourceBaurate, ref cmbBaurate, null, null, "19200"); }
private void Process() { try { List <ClientResponseDetail> lstClientResponseDetails = new List <ClientResponseDetail>(); int iret = GetDataForm(); if (iret > 0) { if (tthai.Equals(BusinessConstant.CoKhong.CO.layGiaTri())) { iret = new SMSProcess().Modem(DatabaseConstant.Action.HUY_KET_NOI, ref lstModems, ref lstClientResponseDetails); } else { iret = new SMSProcess().Modem(DatabaseConstant.Action.KET_NOI, ref lstModems, ref lstClientResponseDetails); } CommonFunction.ThongBaoKetQua(lstClientResponseDetails); if (iret > 0) { if (tthai.Equals(BusinessConstant.CoKhong.CO.layGiaTri())) { tthai = BusinessConstant.CoKhong.KHONG.layGiaTri(); lblTrangThai.Content = LLanguage.SearchResourceByKey("U.DMUC_GTRI.CO_KHONG.KHONG"); } else { tthai = BusinessConstant.CoKhong.CO.layGiaTri(); lblTrangThai.Content = LLanguage.SearchResourceByKey("U.DMUC_GTRI.CO_KHONG.CO"); } } } else { LMessage.ShowMessage("M.DungChung.LoiKhongXacDinh", LMessage.MessageBoxType.Error); } } catch (Exception ex) { LMessage.ShowMessage("M.DungChung.LoiKhongXacDinh", LMessage.MessageBoxType.Error); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
private void HuyKetNoi() { if (!tlbDisconnect.IsEnabled) { return; } List <MODEM> lstModems = new List <MODEM>(); List <ClientResponseDetail> lstClientResponseDetails = new List <ClientResponseDetail>(); foreach (MODEM modem in grdTinNhanDenDS.SelectedItems) { lstModems.Add(modem); } int iret = new SMSProcess().Modem(DatabaseConstant.Action.HUY_KET_NOI, ref lstModems, ref lstClientResponseDetails); CommonFunction.ThongBaoKetQua(lstClientResponseDetails); LoadData(); }
private void KhoiTaoCombobox() { AutoCompleteEntry auto = null; lstSourceTimeOut = new List <AutoCompleteEntry>(); lstSourceBaurate = new List <AutoCompleteEntry>(); lstSourcePortName = new List <AutoCompleteEntry>(); lstModems = new List <MODEM>(); List <ClientResponseDetail> lstClientResponseDetails = new List <ClientResponseDetail>(); int iret = new SMSProcess().Modem(DatabaseConstant.Action.LOAD, ref lstModems, ref lstClientResponseDetails); if (iret > 0) { foreach (MODEM modem in lstModems.Where(f => f.sTatus.Equals(BusinessConstant.CoKhong.CO.layGiaTri()))) { auto = new AutoCompleteEntry(modem.PORTNAME, modem.PORT.ToString(), modem.PORT.ToString(), modem.PORTNAME); lstSourcePortName.Add(auto); } } new AutoComboBox().GenAutoComboBox(ref lstSourcePortName, ref cmbPort, null); }
private void Save() { try { List <ClientResponseDetail> lstClientResponseDetails = new List <ClientResponseDetail>(); objTinNhanDen = new TIN_NHAN_DEN(); List <RECEIVER> lstReceivers = new List <RECEIVER>(); foreach (RECEIVER objTinNhan in grdTinNhanDenDS.SelectedItems) { lstReceivers.Add(objTinNhan); } objTinNhanDen.DSaReceivers = lstReceivers.ToArray(); int iret = new SMSProcess().TinNhanDen(DatabaseConstant.Action.THEM, ref objTinNhanDen, ref lstClientResponseDetails); CommonFunction.ThongBaoKetQua(lstClientResponseDetails); } catch (Exception ex) { LMessage.ShowMessage("M.DungChung.LoiKhongXacDinh", LMessage.MessageBoxType.Error); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
private void Save() { try { List <ClientResponseDetail> lstClientResponseDetails = new List <ClientResponseDetail>(); int iret = GetDataForm(); if (iret > 0) { iret = new SMSProcess().TinNhanDi(DatabaseConstant.Action.THEM, ref objTinNhanDi, ref lstClientResponseDetails); CommonFunction.ThongBaoKetQua(lstClientResponseDetails); } else { LMessage.ShowMessage("M.DungChung.LoiKhongXacDinh", LMessage.MessageBoxType.Error); } } catch (Exception ex) { LMessage.ShowMessage("M.DungChung.LoiKhongXacDinh", LMessage.MessageBoxType.Error); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
private void Them() { try { if (cmbPort.IsEnabled) { List <ClientResponseDetail> lstClientResponseDetails = new List <ClientResponseDetail>(); int iret = GetDataForm(); if (iret > 0) { iret = new SMSProcess().Modem(DatabaseConstant.Action.THEM, ref lstModems, ref lstClientResponseDetails); CommonFunction.ThongBaoKetQua(lstClientResponseDetails); if (iret > 0) { cmbPort.IsEnabled = false; tthai = BusinessConstant.CoKhong.CO.layGiaTri(); lblTrangThai.Content = LLanguage.SearchResourceByKey("U.DMUC_GTRI.CO_KHONG.CO"); tlbExecute.IsEnabled = true; } } else { LMessage.ShowMessage("M.DungChung.LoiKhongXacDinh", LMessage.MessageBoxType.Error); } } else { ClearForm(); } } catch (Exception ex) { LMessage.ShowMessage("M.DungChung.LoiKhongXacDinh", LMessage.MessageBoxType.Error); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }