string getRecDesc(DataRow pRow) { string tab_ = null; string trcode_ = string.Empty; switch (pRow[TableDUMMY.TYPE].ToString()) { case TableINVOICE.TABLE: tab_ = WordCollection.T_INVOICE; trcode_ = XmlFormating.helper.format(pRow[TableINVOICE.TRCODE]); break; case TableORFICHE.TABLE: tab_ = WordCollection.T_ORDER; trcode_ = XmlFormating.helper.format(pRow[TableORFICHE.TRCODE]); break; case TableKSLINES.TABLE: tab_ = WordCollection.T_CASH; trcode_ = XmlFormating.helper.format(pRow[TableKSLINES.TRCODE]); break; default: tab_ = "UNDEF"; break; } string date_ = ToolString.left(XmlFormating.helper.format(pRow[TableDUMMY.DATE_]), 10 + 1 + 8); return(environment.translate(tab_) + "/" + trcode_ + "/" + date_); }
protected override void OnResume() { base.OnResume(); if (inited) { var firmName_ = environment.getSysSettings().getString(SettingsSysMob.MOB_SYS_FIRMNAME) ?? ""; var agentId_ = environment.getSysSettings().getString(SettingsSysMob.MOB_SYS_AGENT_ID) ?? ""; firmName_ = ToolString.left(firmName_, 15); var newLabel_ = string.Format( "{0} - {1} ({2})", ToolMobile.Name, string.IsNullOrEmpty(firmName_) ? "*" : firmName_, string.IsNullOrEmpty(agentId_) ? "000" : agentId_ ); var oldLabel_ = this.Title; if (oldLabel_ != newLabel_) { this.Title = newLabel_; } } /////////////////////////////////////////////////////////////////////////////////////////// //var _nfcAdapter = Android.Nfc.NfcAdapter.DefaultAdapter; //// Create an intent filter for when an NFC tag is discovered. When //// the NFC tag is discovered, Android will u //var tagDetected = new IntentFilter(Android.Nfc.NfcAdapter.ActionTagDiscovered); //var filters = new[] { tagDetected }; //// When an NFC tag is detected, Android will use the PendingIntent to come back to this activity. //// The OnNewIntent method will invoked by Android. //var intent = new Intent(this, GetType()).AddFlags(ActivityFlags.SingleTop); //var pendingIntent = PendingIntent.GetActivity(this, 0, intent, 0); //_nfcAdapter.EnableForegroundDispatch(this, pendingIntent, filters, null); if (errMessageOnResume != null) { var err = errMessageOnResume; errMessageOnResume = null; ToolMsg.show(this, err, null); } }
public virtual void set(string text) { try { if (!ToolMobile.existsDir(_dir)) { ToolMobile.createDir(_dir); } var indx = XmlFormating.helper.format(DateTime.Now); text = "[EVENT::" + indx + "]\n" + text + "\n"; string logFile = string.Format("LOG-{0}.txt", ToolString.left(indx, 10)); ToolMobile.appendFileText(_dir, logFile, text); } catch (Exception exc) { } }
public ICharSequence FilterFormatted(ICharSequence source, int start, int end, ISpanned dest, int dstart, int dend) { if (maxLen > 0) { string s_ = subString(source, start, end); string left_ = subString(dest, 0, dstart); string right_ = subString(dest, dend, dest.Length()); string full_ = left_ + s_ + right_; if (full_.Length > maxLen) { int tail_ = full_.Length - maxLen; s_ = ToolString.left(s_, s_.Length - tail_); return(new Java.Lang.String(s_)); } } return(null); }