// private void SetViewDelegate(View view,object clsobj) // { // InvoiceDtls item = (InvoiceDtls)clsobj; // string sqty =item.qty==0?"": item.qty.ToString (); // string sprice =item.price==0?"": item.price.ToString ("n2"); // // view.FindViewById<TextView> (Resource.Id.invitemcode).Text = item.icode; // view.FindViewById<TextView> (Resource.Id.invitemdesc).Text = item.description; // view.FindViewById<TextView> (Resource.Id.invitemqty).Text = sqty; // view.FindViewById<TextView> (Resource.Id.invitemtaxgrp).Text = item.taxgrp; // if (item.icode == "TAX" || item.icode == "AMOUNT") { // view.FindViewById<TextView> (Resource.Id.invitemtax).Text = ""; // }else view.FindViewById<TextView> (Resource.Id.invitemtax).Text = item.tax.ToString ("n2"); // view.FindViewById<TextView> (Resource.Id.invitemprice).Text = sprice; // view.FindViewById<TextView> (Resource.Id.invitemamt).Text = item.netamount.ToString ("n2"); // // // } protected override void OnResume() { base.OnResume(); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; COMPCODE = ((GlobalvarsApp)this.Application).COMPANY_CODE; rights = Utility.GetAccessRights(pathToDatabase); TRXTYPE = Intent.GetStringExtra("trxtype") ?? "CASH"; invno = Intent.GetStringExtra("invoiceno") ?? "AUTO"; CUSTCODE = Intent.GetStringExtra("custcode") ?? "AUTO"; isNotAllowEditAfterPrinted = DataHelper.GetInvoicePrintStatus(pathToDatabase, invno, rights); Button butNew = FindViewById <Button> (Resource.Id.butnewItem); if (isNotAllowEditAfterPrinted) { butNew.Enabled = false; } listData = new List <InvoiceDtls> (); GetData(); populate(listData); listView = FindViewById <ListView> (Resource.Id.invitemList); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <InvoiceDtls> (this, listData, Resource.Layout.InvDtlItemViewCS, viewdlg); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } // Create your application here SetTitle(Resource.String.title_so); SetContentView(Resource.Layout.ListView); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; rights = Utility.GetAccessRights(pathToDatabase); populate(listData); apara = DataHelper.GetAdPara(pathToDatabase); listView = FindViewById <ListView> (Resource.Id.feedList); // TableLayout tlay = FindViewById<TableLayout> (Resource.Id.tableLayout1); // tlay.Visibility = ViewStates.Invisible; Button butNew = FindViewById <Button> (Resource.Id.butnewInv); butNew.Visibility = ViewStates.Invisible; Button butInvBack = FindViewById <Button> (Resource.Id.butInvBack); butInvBack.Click += (object sender, EventArgs e) => { StartActivity(typeof(TransListActivity)); }; listView.ItemClick += OnListItemClick; listView.ItemLongClick += OnListItemLongClick; //listView.Adapter = new CusotmListAdapter(this, listData); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <SaleOrder> (this, listData, Resource.Layout.ListItemRow, viewdlg); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } EventManagerFacade.Instance.GetEventManager().AddListener(this); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; rights = Utility.GetAccessRights(pathToDatabase); SetContentView(Resource.Layout.CashEntry); _layoutParamsPortrait = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent); _layoutParamsLandscape = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent); GetControls(); LoadMasterTable(); SpinnerHandling(); ControlHandling(); listData = new List <InvoiceDtls> (); CreateCashBill(); populate(listData); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <InvoiceDtls> (this, listData, Resource.Layout.InvDtlItemViewCS, viewdlg); listView.ItemClick += OnListItemClick; }
public PrintPCLDocumentBase() { prtcompHeader = new PrintPCLHeader(); prtDetail = new PrintPCLDetails(); prtFooter = new PrintPCLFooter(); prtTaxSumm = new PrintPCLTaxSummary(); rights = Utility.GetAccessRights(); }
private bool IsGPSTrackingEnbale() { if (rights == null) { rights = Utility.GetAccessRights(DATABASE_PATH); } Console.WriteLine("rights.IsGPSTracking {0}", rights.IsGPSTracking); return(rights.IsGPSTracking); }
public PrintDocumentBase() { prtcompHeader = new PrintCompanyHeader(); prtCustHeader = new PrintCustomerHeader(); prtHeader = new PrintReportHeader(); prtDetail = new PrintItemDetail(); prtFooter = new PrintReportFooter(); prtTaxSummary = new PrintTaxSummary(); prtTotal = new PrintTotalAmount(); rights = Utility.GetAccessRights(); }
protected override void OnResume() { base.OnResume(); listData = new List <SaleOrder> (); populate(listData); apara = DataHelper.GetAdPara(pathToDatabase); rights = Utility.GetAccessRights(pathToDatabase); listView = FindViewById <ListView> (Resource.Id.feedList); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <SaleOrder> (this, listData, Resource.Layout.ListItemRow, viewdlg); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } SetTitle(Resource.String.title_doitems); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; rights = Utility.GetAccessRights(pathToDatabase); SetContentView(Resource.Layout.InvDtlView); dono = Intent.GetStringExtra("invoiceno") ?? "AUTO"; CUSTCODE = Intent.GetStringExtra("custcode") ?? "AUTO"; EDITMODE = Intent.GetStringExtra("editmode") ?? "AUTO"; isNotAllowEditAfterPrinted = DataHelper.GetDelOderPrintStatus(pathToDatabase, dono, rights); Button butNew = FindViewById <Button> (Resource.Id.butnewItem); LinearLayout lly = FindViewById <LinearLayout> (Resource.Id.linearLayoutTitle); if (lly != null) { lly.Visibility = ViewStates.Gone; } butNew.Click += (object sender, EventArgs e) => { NewItem(dono); }; if (isNotAllowEditAfterPrinted) { butNew.Enabled = false; } Button butInvBack = FindViewById <Button> (Resource.Id.butInvItmBack); butInvBack.Click += (object sender, EventArgs e) => { if (EDITMODE.ToLower() == "new") { DeleteDOWithEmptyDOitem(); } //StartActivity(typeof(DelOrderActivity)); var intent = ActivityManager.GetActivity <DelOrderActivity>(this.ApplicationContext); StartActivity(intent); }; populate(listData); listView = FindViewById <ListView> (Resource.Id.invitemList); listView.ItemClick += OnListItemClick; //listView.Adapter = new CusotmItemListAdapter(this, listData); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <DelOrderDtls> (this, listData, Resource.Layout.InvDtlItemView, viewdlg); }
protected override void OnResume() { base.OnResume(); listData = new List <Invoice> (); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; COMPCODE = ((GlobalvarsApp)this.Application).COMPANY_CODE; rights = Utility.GetAccessRights(pathToDatabase); populate(listData); apara = DataHelper.GetAdPara(pathToDatabase); listView = FindViewById <ListView> (Resource.Id.feedList); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <Invoice> (this, listData, Resource.Layout.ListItemRow, viewdlg); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } //this.RequestWindowFeature(WindowFeatures.NoTitle); TRXTYPE = Intent.GetStringExtra("trxtype") ?? "CASH"; INVOICENO = Intent.GetStringExtra("invoiceno") ?? "AUTO"; ITEMUID = Intent.GetStringExtra("itemuid") ?? "AUTO"; EDITMODE = Intent.GetStringExtra("editmode") ?? "AUTO"; CUSTOMER = Intent.GetStringExtra("customer") ?? "AUTO"; CUSTCODE = Intent.GetStringExtra("custcode") ?? "AUTO"; if (TRXTYPE == "CASH") { SetTitle(Resource.String.title_cashitementry); } else { SetTitle(Resource.String.title_invitementry); } EventManagerFacade.Instance.GetEventManager().AddListener(this); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; rights = Utility.GetAccessRights(pathToDatabase); SetContentView(Resource.Layout.EntryEx2); _layoutParamsPortrait = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent); _layoutParamsLandscape = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent); GetControls(); LoadMasterTable(); SpinnerHandling(); ControlHandling(); listData = new List <CNNoteDtls> (); LoadCashBill(); populate(listData); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <CNNoteDtls> (this, listData, Resource.Layout.InvDtlItemViewCS, viewdlg); listView.ItemClick += OnListItemClick; if (EDITMODE == "EDIT") { int id = Convert.ToInt32(ITEMUID); EditItem(INVOICENO, id); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetTitle(Resource.String.mainmenu_upload); SetContentView(Resource.Layout.Upload); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; rights = Utility.GetAccessRights(pathToDatabase); butupload = FindViewById <Button> (Resource.Id.butupload); butupload.Click += butUploadBills; butuploadso = FindViewById <Button> (Resource.Id.butuploadso); butuploadso.Click += butUploadSO; butuploadcn = FindViewById <Button> (Resource.Id.butuploadcn); butuploadcn.Click += butUploadCN; butuploaddo = FindViewById <Button> (Resource.Id.butuploaddo); butuploaddo.Click += butUploadDO; butuploadall = FindViewById <Button> (Resource.Id.butuploadAll); butuploadall.Click += butUploadAll; Button butback = FindViewById <Button> (Resource.Id.butMain); butback.Click += (object sender, EventArgs e) => { base.OnBackPressed(); }; if (!rights.IsSOModule) { butuploadso.Visibility = ViewStates.Gone; } if (!rights.IsCNModule) { butuploadcn.Visibility = ViewStates.Gone; } if (!rights.IsDOModule) { butuploaddo.Visibility = ViewStates.Gone; } GetUnLoadNumber(); }
private bool isLastConnectExpire(AdUser user) { bool isExpiry = false; rights = Utility.GetAccessRights(pathToDatabase); int Expiry = DataHelper.GetExpiryDay(pathToDatabase); if (rights.IsLoginControl) { if (user.LastConnect.Year < 2000) { user.LastConnect = DateTime.Now; } double day = (DateTime.Now - user.LastConnect).TotalDays; isExpiry = (day > Expiry); } return(isExpiry); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } SetContentView(Resource.Layout.InvDtlView); invno = Intent.GetStringExtra("invoiceno") ?? "AUTO"; CUSTCODE = Intent.GetStringExtra("custcode") ?? "AUTO"; SetTitle(Resource.String.title_cashitems); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; COMPCODE = ((GlobalvarsApp)this.Application).COMPANY_CODE; rights = Utility.GetAccessRights(pathToDatabase); isNotAllowEditAfterPrinted = DataHelper.GetInvoicePrintStatus(pathToDatabase, invno, rights); txtbarcode = FindViewById <EditText> (Resource.Id.txtbarcode); txtbarcode.Visibility = ViewStates.Gone; Button butNew = FindViewById <Button> (Resource.Id.butnewItem); butNew.Visibility = ViewStates.Gone; Button butInvBack = FindViewById <Button> (Resource.Id.butInvItmBack); butInvBack.Click += (object sender, EventArgs e) => { Intent intent = ActivityManager.GetActivity <CashBillListing> (this.ApplicationContext); StartActivity(intent); }; GetData(); populate(listData); listView = FindViewById <ListView> (Resource.Id.invitemList); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <InvoiceDtls> (this, listData, Resource.Layout.InvDtlItemViewCS, viewdlg); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } SetTitle(Resource.String.submenu_invlist); EventManagerFacade.Instance.GetEventManager().AddListener(this); // Create your application here SetContentView(Resource.Layout.ListCustView); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; rights = Utility.GetAccessRights(pathToDatabase); TRXTYPE = Intent.GetStringExtra("trxtype") ?? "CASH"; Utility.GetDateRange(ref sdate, ref edate); populate(listData); apara = DataHelper.GetAdPara(pathToDatabase); //listView = FindViewById<ListView> (Resource.Id.feedList); //CustList listView = FindViewById <ListView> (Resource.Id.CustList); //CustList // TableLayout tlay = FindViewById<TableLayout> (Resource.Id.tableLayout1); // tlay.Visibility = ViewStates.Invisible; //Button butNew= FindViewById<Button> (Resource.Id.butnewInv); //butNew.Visibility = ViewStates.Invisible; txtSearch = FindViewById <EditText> (Resource.Id.txtSearch); //Button butInvBack= FindViewById<Button> (Resource.Id.butInvBack); Button butInvBack = FindViewById <Button> (Resource.Id.butCustBack); butInvBack.Click += (object sender, EventArgs e) => { StartActivity(typeof(TransListActivity)); }; listView.ItemClick += OnListItemClick; listView.ItemLongClick += OnListItemLongClick; //listView.Adapter = new CusotmListAdapter(this, listData); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <Invoice> (this, listData, Resource.Layout.ListItemRow, viewdlg); txtSearch.TextChanged += TxtSearch_TextChanged; }
void SystemUpdate(string version) { PackageInfo pInfo = PackageManager.GetPackageInfo(PackageName, 0); double webver = Convert.ToDouble(version); double locver = Convert.ToDouble(pInfo.VersionName); double predefineVer = 0; rights = Utility.GetAccessRights(pathToDatabase); if (rights != null) { if (rights.IsVersionControl) { predefineVer = DataHelper.GetPreDefineVersion(pathToDatabase, "VER:"); if (predefineVer == webver) { //download form google play } else { if (predefineVer > locver) { DownlooadAPK(predefineVer.ToString().Trim()); } return; // is version contral. no need to check latest version control on google play } } } if (webver > locver) { var builderd = new AlertDialog.Builder(this); builderd.SetMessage("New Version " + version + " is available, ready to update?"); //builderd.SetMessage("Confirm to download database from server ? All local data will be overwritten by the downloaded data."); builderd.SetPositiveButton("OK", (s, e) => { UpdateSysem();; }); builderd.SetNegativeButton("Cancel", (s, e) => { /* do something on Cancel click */ }); builderd.Create().Show(); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } SetTitle(Resource.String.title_invoice); // Create your application here SetContentView(Resource.Layout.ListView); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; COMPCODE = ((GlobalvarsApp)this.Application).COMPANY_CODE; rights = Utility.GetAccessRights(pathToDatabase); populate(listData); apara = DataHelper.GetAdPara(pathToDatabase); listView = FindViewById <ListView> (Resource.Id.feedList); Button butNew = FindViewById <Button> (Resource.Id.butnewInv); butNew.Visibility = ViewStates.Gone; //butNew.Click += butCreateNewInv; Button butInvBack = FindViewById <Button> (Resource.Id.butInvBack); butInvBack.Click += (object sender, EventArgs e) => { StartActivity(typeof(InvoiceActivityEx)); }; //if (!rights.InvAllowAdd) // butNew.Enabled = false; listView.ItemClick += OnListItemLongClick; //OnListItemClick; listView.ItemLongClick += ListView_ItemLongClick; //listView.Adapter = new CusotmListAdapter(this, listData); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <Invoice> (this, listData, Resource.Layout.ListItemRow, viewdlg); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } SetTitle(Resource.String.mainmenu_settings); SetContentView(Resource.Layout.AdPara); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; rights = Utility.GetAccessRights(pathToDatabase); spinPrType = FindViewById <Spinner> (Resource.Id.txtprintertype); spinner = FindViewById <Spinner> (Resource.Id.txtSize); spinBt = FindViewById <Spinner> (Resource.Id.txtprinters); Button butSave = FindViewById <Button> (Resource.Id.ad_bSave); Button butCancel = FindViewById <Button> (Resource.Id.ad_Cancel); FindControls(); butSave.Click += butSaveClick; butCancel.Click += butCancelClick; findBTPrinter(); //RunOnUiThread(()=>{ findBTPrinter ();}); adapterPT = ArrayAdapter.CreateFromResource(this, Resource.Array.printer_array, Android.Resource.Layout.SimpleSpinnerItem); adapterPT.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); adapter = ArrayAdapter.CreateFromResource(this, Resource.Array.papersize_array, Android.Resource.Layout.SimpleSpinnerItem); adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spinPrType.Adapter = adapterPT; spinner.Adapter = adapter; spinner.ItemSelected += Spinner_ItemSelected; spinBt.ItemSelected += Spinner_ItemSelected; LoadData(); // Create your application here }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetTitle(Resource.String.mainmenu_settings); SetContentView(Resource.Layout.Settings); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; rights = Utility.GetAccessRights(pathToDatabase); Button butSett = FindViewById <Button> (Resource.Id.butsetting); butSett.Click += butSetting; Button butAbt = FindViewById <Button> (Resource.Id.butAbout); butAbt.Click += ButAbt_Click; Button buttestprint = FindViewById <Button> (Resource.Id.buttestprint); buttestprint.Click += Buttestprint_Click; Button butback = FindViewById <Button> (Resource.Id.butMain); butback.Click += (object sender, EventArgs e) => { base.OnBackPressed(); }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } SetTitle(Resource.String.submenu_inv); // this.RequestWindowFeature(WindowFeatures.NoTitle); INVOICENO = Intent.GetStringExtra("invoiceno") ?? ""; INVACTION = Intent.GetStringExtra("action") ?? ""; _date = DateTime.Today; EventManagerFacade.Instance.GetEventManager().AddListener(this); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; rights = Utility.GetAccessRights(pathToDatabase); isNotAllowEditAfterPrinted = DataHelper.GetInvoicePrintStatus(pathToDatabase, invno, rights); SetContentView(Resource.Layout.InvoiceEntry); _layoutParamsPortrait = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent); _layoutParamsLandscape = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent); GetControls(); LoadMasterTable(); SpinnerHandling(); ControlHandling(); listData = new List <InvoiceDtls> (); //CreateCashBill (); LoadInvoice(); populate(listData); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapterEx <InvoiceDtls> (this, listData, Resource.Layout.InvDtlItemViewCS, viewdlg); listView.ItemClick += OnListItemClick; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } SetContentView(Resource.Layout.InvDtlView); TRXTYPE = Intent.GetStringExtra("trxtype") ?? "CASH"; invno = Intent.GetStringExtra("invoiceno") ?? "AUTO"; CUSTCODE = Intent.GetStringExtra("custcode") ?? "AUTO"; EDITMODE = Intent.GetStringExtra("editmode") ?? "AUTO"; if (TRXTYPE == "CASH") { SetTitle(Resource.String.title_cashitems); } else { SetTitle(Resource.String.title_invoiceitems); } pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; COMPCODE = ((GlobalvarsApp)this.Application).COMPANY_CODE; rights = Utility.GetAccessRights(pathToDatabase); isNotAllowEditAfterPrinted = DataHelper.GetInvoicePrintStatus(pathToDatabase, invno, rights); txtbarcode = FindViewById <EditText> (Resource.Id.txtbarcode); txtbarcode.Visibility = ViewStates.Visible; Button butNew = FindViewById <Button> (Resource.Id.butnewItem); butNew.Click += (object sender, EventArgs e) => { NewItem(invno); }; if (isNotAllowEditAfterPrinted) { butNew.Enabled = false; } if (!rights.InvAllowAdd) { butNew.Enabled = false; } Button butInvBack = FindViewById <Button> (Resource.Id.butInvItmBack); butInvBack.Click += (object sender, EventArgs e) => { Invoice temp = new Invoice(); UpdateInvoiceAmount(invno, ref temp); if (EDITMODE.ToLower() == "new") { DeleteInvWithEmptyInovItem(); } Intent intent = null; if (temp.trxtype == "CASH") { intent = ActivityManager.GetActivity <CashActivity>(this.ApplicationContext); } else { intent = ActivityManager.GetActivity <InvoiceActivity>(this.ApplicationContext); } StartActivity(intent); }; txtbarcode.SetOnKeyListener(this); txtbarcode.InputType = 0; GetData(); populate(listData); listView = FindViewById <ListView> (Resource.Id.invitemList); listView.ItemClick += OnListItemClick; //listView.Adapter = new CusotmItemListAdapter(this, listData); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <InvoiceDtls> (this, listData, Resource.Layout.InvDtlItemViewCS, viewdlg); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } TRXTYPE = Intent.GetStringExtra("trxtype") ?? "CASH"; INVOICENO = Intent.GetStringExtra("invoiceno") ?? "AUTO"; ITEMUID = Intent.GetStringExtra("itemuid") ?? "AUTO"; EDITMODE = Intent.GetStringExtra("editmode") ?? "AUTO"; CUSTOMER = Intent.GetStringExtra("customer") ?? "AUTO"; CUSTCODE = Intent.GetStringExtra("custcode") ?? "AUTO"; if (TRXTYPE == "CASH") { SetTitle(Resource.String.title_cashitementry); } else { SetTitle(Resource.String.title_invitementry); } EventManagerFacade.Instance.GetEventManager().AddListener(this); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; rights = Utility.GetAccessRights(pathToDatabase); trd = DataHelper.GetTrader(pathToDatabase, CUSTCODE); // Create your application here SetContentView(Resource.Layout.Entry); spinner = FindViewById <Spinner> (Resource.Id.txtcode); EditText qty = FindViewById <EditText> (Resource.Id.txtqty); EditText price = FindViewById <EditText> (Resource.Id.txtprice); TextView txtInvNo = FindViewById <TextView> (Resource.Id.txtInvnp); TextView txtcust = FindViewById <TextView> (Resource.Id.txtInvcust); Button butFind = FindViewById <Button> (Resource.Id.newinv_bfind); EditText txtbarcode = FindViewById <EditText> (Resource.Id.txtbarcode); txtInvNo.Text = INVOICENO; txtcust.Text = CUSTOMER; Button but = FindViewById <Button> (Resource.Id.Save); Button but2 = FindViewById <Button> (Resource.Id.Cancel); spinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs> (spinner_ItemSelected); but.Click += butSaveClick; but2.Click += butCancelClick; butFind.Click += (object sender, EventArgs e) => { ShowItemLookUp(); }; qty.EditorAction += HandleEditorAction; qty.AfterTextChanged += Qty_AfterTextChanged; price.Enabled = rights.InvEditUPrice; txtbarcode.SetOnKeyListener(this); //SqliteConnection.CreateFile(pathToDatabase); using (var db = new SQLite.SQLiteConnection(pathToDatabase)) { items = db.Table <Item> ().ToList <Item> (); } List <string> icodes = new List <string> (); foreach (Item item in items) { //icodes.Add (item.ICode+" | "+item.IDesc); if (item.IDesc.Length > 40) { icodes.Add(item.ICode + " | " + item.IDesc.Substring(0, 40) + "..."); } else { icodes.Add(item.ICode + " | " + item.IDesc); } } dataAdapter = new ArrayAdapter <String>(this, Resource.Layout.spinner_item, icodes); // Drop down layout style - list view with radio button //dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); dataAdapter.SetDropDownViewResource(Resource.Layout.SimpleSpinnerDropDownItemEx); // attaching data adapter to spinner spinner.Adapter = dataAdapter; if (EDITMODE == "EDIT") { FIRSTLOAD = "1"; LoadData(INVOICENO, ITEMUID); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } SetTitle(Resource.String.title_donew); SetContentView(Resource.Layout.CreateDO); EventManagerFacade.Instance.GetEventManager().AddListener(this); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; compcode = ((GlobalvarsApp)this.Application).COMPANY_CODE; apara = DataHelper.GetAdPara(pathToDatabase); rights = Utility.GetAccessRights(pathToDatabase); // Create your application here _date = DateTime.Today; spinner = FindViewById <Spinner> (Resource.Id.newinv_custcode); Spinner spinnerType = FindViewById <Spinner> (Resource.Id.newinv_type); Button butSave = FindViewById <Button> (Resource.Id.newinv_bsave); Button butNew = FindViewById <Button> (Resource.Id.newinv_cancel); Button butFind = FindViewById <Button> (Resource.Id.newinv_bfind); EditText remark = FindViewById <EditText> (Resource.Id.newinv_custname); spinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs> (spinner_ItemSelected); butSave.Click += butSaveClick; butNew.Click += butCancelClick; TextView invno = FindViewById <TextView> (Resource.Id.newinv_no); invno.Text = "AUTO"; EditText trxdate = FindViewById <EditText> (Resource.Id.newinv_date); trxdate.Text = _date.ToString("dd-MM-yyyy"); // trxdate.Click += delegate(object sender, EventArgs e) { // ShowDialog (0); // }; if (rights.DOEditTrxDate) { trxdate.Click += delegate(object sender, EventArgs e) { ShowDialog(0); }; } else { trxdate.Enabled = false; } butFind.Click += (object sender, EventArgs e) => { ShowCustLookUp(); }; //SqliteConnection.CreateFile(pathToDatabase); using (var db = new SQLite.SQLiteConnection(pathToDatabase)) { items = db.Table <Trader> ().ToList <Trader> (); } List <string> icodes = new List <string> (); foreach (Trader item in items) { icodes.Add(item.CustCode + " | " + item.CustName); } dataAdapter2 = ArrayAdapter.CreateFromResource( this, Resource.Array.term, Resource.Layout.spinner_item); dataAdapter = new ArrayAdapter <String> (this, Resource.Layout.spinner_item, icodes); dataAdapter.SetDropDownViewResource(Resource.Layout.SimpleSpinnerDropDownItemEx); dataAdapter2.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spinner.Adapter = dataAdapter; spinnerType.Adapter = dataAdapter2; remark.RequestFocus(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } SetTitle(Resource.String.mainmenu_trxlist); SetContentView(Resource.Layout.Translist); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; rights = Utility.GetAccessRights(pathToDatabase); Button butCashlist = FindViewById <Button> (Resource.Id.butCashlist); butCashlist.Click += ButCashlist_Click; Button butInvlist = FindViewById <Button> (Resource.Id.butInvlist); butInvlist.Click += ButInvlist_Click; Button butCNNoteList = FindViewById <Button> (Resource.Id.butCNlist); butCNNoteList.Click += ButCNNoteList_Click; Button butSOList = FindViewById <Button> (Resource.Id.butSOlist); butSOList.Click += ButSOList_Click; Button butDOList = FindViewById <Button> (Resource.Id.butDOlist); butDOList.Click += ButDOList_Click; Button butsumm = FindViewById <Button> (Resource.Id.butInvsumm); butsumm.Click += (object sender, EventArgs e) => { StartActivity(typeof(PrintSumm)); }; Button butStksumm = FindViewById <Button> (Resource.Id.butStksumm); butStksumm.Click += (object sender, EventArgs e) => { StartActivity(typeof(ItemStockActivity)); }; Button butMap = FindViewById <Button> (Resource.Id.butMap); butMap.Click += (object sender, EventArgs e) => { StartActivity(typeof(ShowMapActivity)); }; Button butback = FindViewById <Button> (Resource.Id.butMain); butback.Click += (object sender, EventArgs e) => { StartActivity(typeof(MainActivity)); }; if (!rights.IsSOModule) { butSOList.Visibility = ViewStates.Gone; } if (!rights.IsCNModule) { butCNNoteList.Visibility = ViewStates.Gone; } if (!rights.IsDOModule) { butDOList.Visibility = ViewStates.Gone; } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); return; } Xamarin.Insights.Initialize("68d05db99c4aabb291a593343f0f7cfea961ea3a", this); //Insight key //68d05db99c4aabb291a593343f0f7cfea961ea3a // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); GetDBPath(); rights = Utility.GetAccessRights(pathToDatabase); AndroidEnvironment.UnhandledExceptionRaiser += AndroidEnvironment_UnhandledExceptionRaiser; butPOS = FindViewById <Button> (Resource.Id.butPOS); butPOS.Click += ButPOS_Click; butInv = FindViewById <Button> (Resource.Id.butSecond); butInv.Click += butClick; // butCash = FindViewById<Button> (Resource.Id.butCash); // butCash.Click += butCashClick; butCNNote = FindViewById <Button> (Resource.Id.butcnnote); butCNNote.Click += ButCNNote_Click; butSO = FindViewById <Button> (Resource.Id.butso); butSO.Click += ButSO_Click; butDO = FindViewById <Button> (Resource.Id.butdo); butDO.Click += ButDO_Click; Button butTrxList = FindViewById <Button> (Resource.Id.butInvlist); butTrxList.Click += ButInvlist_Click; Button butdown = FindViewById <Button> (Resource.Id.butDown); butdown.Click += butDownloadItems; Button butup = FindViewById <Button> (Resource.Id.butupload); butup.Click += butUploadItems; Button butMItem = FindViewById <Button> (Resource.Id.butMaster); butMItem.Click += butMasterClick; Button butSett = FindViewById <Button> (Resource.Id.butsetting); butSett.Click += butSetting; Button butlogOff = FindViewById <Button> (Resource.Id.butOut); butlogOff.Click += ButlogOff_Click; //Button butAbt = FindViewById<Button> (Resource.Id.butAbout); //butAbt.Click+= ButAbt_Click; if (!rights.IsSOModule) { butSO.Visibility = ViewStates.Gone; } if (!rights.IsCNModule) { butCNNote.Visibility = ViewStates.Gone; } if (!rights.IsDOModule) { butDO.Visibility = ViewStates.Gone; } GetTotalNumber(); }
//AccessRights rights; protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } SetTitle(Resource.String.title_sonew); SetContentView(Resource.Layout.CreateSO); EventManagerFacade.Instance.GetEventManager().AddListener(this); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; compcode = ((GlobalvarsApp)this.Application).COMPANY_CODE; apara = DataHelper.GetAdPara(pathToDatabase); rights = Utility.GetAccessRights(pathToDatabase); // Create your application here _date = DateTime.Today; spinner = FindViewById <Spinner> (Resource.Id.newinv_custcode); spinnerBill = FindViewById <Spinner> (Resource.Id.newinv_billto); Button butSave = FindViewById <Button> (Resource.Id.newinv_bsave); Button butNew = FindViewById <Button> (Resource.Id.newinv_cancel); Button butFind = FindViewById <Button> (Resource.Id.newinv_bfind); Button butBillFind = FindViewById <Button> (Resource.Id.newinv_billfind); butSave.Click += butSaveClick; butNew.Click += butCancelClick; TextView invno = FindViewById <TextView> (Resource.Id.newinv_no); invno.Text = "AUTO"; EditText trxdate = FindViewById <EditText> (Resource.Id.newinv_date); trxdate.Text = _date.ToString("dd-MM-yyyy"); // trxdate.Click += delegate(object sender, EventArgs e) { // ShowDialog (0); // }; if (rights.SOEditTrxDate) { trxdate.Click += delegate(object sender, EventArgs e) { ShowDialog(0); }; } else { trxdate.Enabled = false; } butFind.Click += (object sender, EventArgs e) => { ShowCustLookUp(); }; butBillFind.Click += (object sender, EventArgs e) => { ShowBillToLookUp(); }; //SqliteConnection.CreateFile(pathToDatabase); using (var db = new SQLite.SQLiteConnection(pathToDatabase)) { items = db.Table <Trader> ().ToList <Trader> (); } var icodes = GetCustCode(IsValidCustTo); var icodes2 = GetCustCode(IsValidBillTo); dataAdapter = new ArrayAdapter <String> (this, Resource.Layout.spinner_item, icodes); dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spinner.Adapter = dataAdapter; dataAdapter2 = new ArrayAdapter <String> (this, Resource.Layout.spinner_item, icodes2); dataAdapter2.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spinnerBill.Adapter = dataAdapter2; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } INVOICENO = Intent.GetStringExtra("invoiceno") ?? "AUTO"; TRXTYPE = Intent.GetStringExtra("trxtype") ?? "CASH"; if (TRXTYPE == "CASH") { SetTitle(Resource.String.title_cashedit); } else { SetTitle(Resource.String.title_invoiceedit); } SetContentView(Resource.Layout.CreateInvoice); EventManagerFacade.Instance.GetEventManager().AddListener(this); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; rights = Utility.GetAccessRights(pathToDatabase); invInfo = DataHelper.GetInvoice(pathToDatabase, INVOICENO); if (invInfo == null) { base.OnBackPressed(); } // Create your application here spinner = FindViewById <Spinner> (Resource.Id.newinv_custcode); spinnerType = FindViewById <Spinner> (Resource.Id.newinv_type); Button butSave = FindViewById <Button> (Resource.Id.newinv_bsave); butSave.Text = Resources.GetString(Resource.String.but_save); // "SAVE"; Button butCancel = FindViewById <Button> (Resource.Id.newinv_cancel); Button butFind = FindViewById <Button> (Resource.Id.newinv_bfind); spinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs> (spinner_ItemSelected); butSave.Click += butSaveClick; butCancel.Click += butCancelClick; spinnerType.Enabled = false; EditText trxdate = FindViewById <EditText> (Resource.Id.newinv_date); // trxdate.Click += delegate(object sender, EventArgs e) { // ShowDialog (0); // }; //19-Nov-2015 //disable the date, for edit mode, date should not be editable //cuase running number issue. trxdate.Enabled = false; butFind.Click += (object sender, EventArgs e) => { ShowCustLookUp(); }; apara = DataHelper.GetAdPara(pathToDatabase); LoadTrader(); List <string> icodes = new List <string> (); int counter = 0; foreach (Trader item in custs) { icodes.Add(item.CustCode + " | " + item.CustName.Trim()); if (item.CustCode.Trim() == "COD" || item.CustCode.Trim() == "CASH") { CashPos = counter; } counter += 1; } dataAdapter = new ArrayAdapter <String> (this, Resource.Layout.spinner_item, icodes); dataAdapter2 = ArrayAdapter.CreateFromResource( this, Resource.Array.trxtype, Resource.Layout.spinner_item); //dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); dataAdapter.SetDropDownViewResource(Resource.Layout.SimpleSpinnerDropDownItemEx); dataAdapter2.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); // attaching data adapter to spinner spinner.Adapter = dataAdapter; spinnerType.Adapter = dataAdapter2; LoadData(); }