void PrintInv(Invoice inv, int noofcopy) { //Toast.MakeText (this, "print....", ToastLength.Long).Show (); InvoiceDtls[] list; using (var db = new SQLite.SQLiteConnection(pathToDatabase)){ var ls = db.Table <InvoiceDtls> ().Where(x => x.invno == inv.invno).ToList <InvoiceDtls>(); list = new InvoiceDtls[ls.Count]; ls.CopyTo(list); } //mmDevice = null; //findBTPrinter (); IPrintDocument prtInv = PrintDocManager.GetPrintDocument <PrintInvoice>(); prtInv.SetDocument(inv); prtInv.SetDocumentDtls(list); prtInv.SetNoOfCopy(noofcopy); prtInv.SetCallingActivity(this); if (prtInv.StartPrint()) { updatePrintedStatus(inv); var found = listData.Where(x => x.invno == inv.invno).ToList(); if (found.Count > 0) { found [0].isPrinted = true; SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <Invoice> (this, listData, Resource.Layout.ListItemRow, viewdlg); } } else { Toast.MakeText(this, prtInv.GetErrMsg(), ToastLength.Long).Show(); } }
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; }
void PrintInv(CNNote inv, int noofcopy) { //Toast.MakeText (this, "print....", ToastLength.Long).Show (); CNNoteDtls[] list; using (var db = new SQLite.SQLiteConnection(pathToDatabase)){ var ls = db.Table <CNNoteDtls> ().Where(x => x.cnno == inv.cnno).ToList <CNNoteDtls>(); list = new CNNoteDtls[ls.Count]; ls.CopyTo(list); } IPrintDocument prtInv = PrintDocManager.GetPrintCNDocument <PrintCreditNote>(); prtInv.SetDocument(inv); prtInv.SetDocumentDtls(list); prtInv.SetNoOfCopy(noofcopy); prtInv.SetCallingActivity(this); if (prtInv.StartPrint()) { updatePrintedStatus(inv); var found = listData.Where(x => x.cnno == inv.cnno).ToList(); if (found.Count > 0) { found [0].isPrinted = true; SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <CNNote> (this, listData, Resource.Layout.ListItemRowCN, viewdlg); } } }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish (); } pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; compCode = ((GlobalvarsApp)this.Application).COMPANY_CODE; branchCode = ((GlobalvarsApp)this.Application).BRANCH_CODE; SetContentView (Resource.Layout.ItemCodeList); populate (listData); listView = FindViewById<ListView> (Resource.Id.ICodeList); txtSearch= FindViewById<EditText > (Resource.Id.txtSearch); Button butInvBack= FindViewById<Button> (Resource.Id.butICodeBack); butInvBack.Click += (object sender, EventArgs e) => { base.OnBackPressed(); }; viewdlg = SetViewDelegate; //PerformFilteringDlg filterDlg=PerformFiltering; //listView.Adapter = new CusotmMasterItemListAdapter(this, listData); adapter = new GenericListAdapter<Item> (this, listData, Resource.Layout.ItemCodeDtlList, viewdlg); listView.Adapter = adapter; listView.ItemClick+= ListView_Click; txtSearch.TextChanged+= TxtSearch_TextChanged; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } SetTitle(Resource.String.submenu_cust); SetContentView(Resource.Layout.ListCustView); // Create your application here pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; populate(listData); listView = FindViewById <ListView> (Resource.Id.CustList); Button butInvBack = FindViewById <Button> (Resource.Id.butCustBack); txtSearch = FindViewById <EditText> (Resource.Id.txtSearch); butInvBack.Click += (object sender, EventArgs e) => { base.OnBackPressed(); }; listView.ItemClick += ListView_ItemClick;; //istView.Adapter = new CusotmCustomerListAdapter(this, listData); viewdlg = SetViewDelegate; adapter = new GenericListAdapter <Trader> (this, listData, Resource.Layout.ListCustDtlView, viewdlg); listView.Adapter = adapter; txtSearch.TextChanged += TxtSearch_TextChanged; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } SetTitle(Resource.String.STOCKSUMMARY); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; SetContentView(Resource.Layout.ItemStockList); imm = (InputMethodManager)GetSystemService(Context.InputMethodService); dateSearch = DateTime.Today; date = DateTime.Today; populate(listData); listView = FindViewById <ListView> (Resource.Id.ICodeList); txtSearch = FindViewById <EditText> (Resource.Id.txtSearch); Button butInvBack = FindViewById <Button> (Resource.Id.butICodeBack); Button butDate = FindViewById <Button> (Resource.Id.butDate); butDate.Click += delegate(object sender, EventArgs e) { //imm.HideSoftInputFromWindow(frd.WindowToken, 0); ShowDialog(DATE_DIALOG_ID1); }; butInvBack.Click += (object sender, EventArgs e) => { base.OnBackPressed(); }; viewdlg = SetViewDelegate; adapter = new GenericListAdapter <ItemStock> (this, listData, Resource.Layout.ItemStockDtls, viewdlg); listView.Adapter = adapter; listView.ItemClick += ListView_Click; txtSearch.TextChanged += TxtSearch_TextChanged; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } SetTitle(Resource.String.title_soitems); SetContentView(Resource.Layout.InvDtlView); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; invno = Intent.GetStringExtra("invoiceno") ?? "AUTO"; CUSTCODE = Intent.GetStringExtra("custcode") ?? "AUTO"; // TableLayout tlay = FindViewById<TableLayout> (Resource.Id.tableLayout1); // tlay.Visibility = ViewStates.Invisible; Button butNew = FindViewById <Button> (Resource.Id.butnewItem); butNew.Visibility = ViewStates.Invisible; Button butInvBack = FindViewById <Button> (Resource.Id.butInvItmBack); butInvBack.Click += (object sender, EventArgs e) => { base.OnBackPressed(); }; populate(listData); listView = FindViewById <ListView> (Resource.Id.invitemList); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <SaleOrderDtls> (this, listData, Resource.Layout.InvDtlItemViewCS, viewdlg); }
void FindItemByText() { SetViewDlg viewdlg = SetViewDelegate; List <Invoice> found = PerformSearch(txtSearch.Text); listView.Adapter = new GenericListAdapter <Invoice> (this, found, Resource.Layout.ListItemRow, 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); }
public override Dialog OnCreateDialog(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Begin building a new dialog. var builder = new AlertDialog.Builder(Activity); //Get the layout inflater var inflater = Activity.LayoutInflater; populate(listData); viewdlg = SetViewDelegate; var view = inflater.Inflate(Resource.Layout.ListCustView, null); listView = view.FindViewById <ListView> (Resource.Id.CustList); if (listView != null) { adapter = new GenericListAdapter <Trader> (this.Activity, listData, Resource.Layout.ListCustDtlView, viewdlg); listView.Adapter = adapter; listView.ItemClick += ListView_Click; txtSearch = view.FindViewById <EditText> (Resource.Id.txtSearch); butSearch = view.FindViewById <Button> (Resource.Id.butCustBack); butSearch.Text = Resources.GetString(Resource.String.button_search); butSearch.SetCompoundDrawables(null, null, null, null); butSearch.Click += ButSearch_Click; //txtSearch.TextChanged += TxtSearch_TextChanged; builder.SetView(view); builder.SetPositiveButton(Resources.GetString(Resource.String.button_cancel), HandlePositiveButtonClick); } var dialog = builder.Create(); //Now return the constructed dialog to the calling activity return(dialog); }
public override Dialog OnCreateDialog(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Begin building a new dialog. var builder = new AlertDialog.Builder(Activity); //Get the layout inflater var inflater = Activity.LayoutInflater; populate (listData); viewdlg = SetViewDelegate; var view = inflater.Inflate(Resource.Layout.ListCustView, null); listView = view.FindViewById<ListView> (Resource.Id.CustList); if (listView != null) { adapter = new GenericListAdapter<Trader> (this.Activity, listData,Resource.Layout.ListCustDtlView, viewdlg); listView.Adapter = adapter; listView.ItemClick += ListView_Click; txtSearch= view.FindViewById<EditText > (Resource.Id.txtSearch); butSearch= view.FindViewById<Button> (Resource.Id.butCustBack); butSearch.Text = "SEARCH"; butSearch.SetCompoundDrawables (null, null, null, null); butSearch.Click+= ButSearch_Click; //txtSearch.TextChanged += TxtSearch_TextChanged; builder.SetView (view); builder.SetPositiveButton ("CANCEL", HandlePositiveButtonClick); } var dialog = builder.Create(); //Now return the constructed dialog to the calling activity return dialog; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish(); } SetTitle(Resource.String.submenu_item); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; SetContentView(Resource.Layout.ItemCodeList); populate(listData); listView = FindViewById <ListView> (Resource.Id.ICodeList); txtSearch = FindViewById <EditText> (Resource.Id.txtSearch); Button butInvBack = FindViewById <Button> (Resource.Id.butICodeBack); butInvBack.Click += (object sender, EventArgs e) => { base.OnBackPressed(); }; SetupClassSpinner(); viewdlg = SetViewDelegate; //PerformFilteringDlg filterDlg=PerformFiltering; //listView.Adapter = new CusotmMasterItemListAdapter(this, listData); adapter = new GenericListAdapter <Item> (this, listData, Resource.Layout.ItemCodeDtlList, viewdlg); listView.Adapter = adapter; listView.ItemClick += ListView_Click; txtSearch.TextChanged += TxtSearch_TextChanged; }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish (); } SetContentView (Resource.Layout.ListCustViewEx); // Create your application here pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; compCode =((GlobalvarsApp)Application).COMPANY_CODE; branchCode =((GlobalvarsApp)Application).BRANCH_CODE; compinfo = DataHelper.GetCompany (pathToDatabase,compCode,branchCode); populate (listData); listView = FindViewById<ListView> (Resource.Id.CustList); Button butInvBack= FindViewById<Button> (Resource.Id.butCustBack); Button butInvAdd= FindViewById<Button> (Resource.Id.butCustAdd); txtSearch= FindViewById<EditText > (Resource.Id.txtSearch); butInvBack.Click += (object sender, EventArgs e) => { base.OnBackPressed(); }; butInvAdd.Click+= (object sender, EventArgs e) => { NewLocalCust(); }; listView.ItemClick+= ListView_ItemClick; ; listView.ItemLongClick+= ListView_ItemLongClick; //istView.Adapter = new CusotmCustomerListAdapter(this, listData); viewdlg = SetViewDelegate; adapter = new GenericListAdapter<Trader> (this, listData, Resource.Layout.ListCustDtlView, viewdlg); listView.Adapter = adapter; txtSearch.TextChanged+= TxtSearch_TextChanged; }
void PrintSO(SaleOrder so, int noofcopy) { //Toast.MakeText (this, "print....", ToastLength.Long).Show (); SaleOrderDtls[] list; using (var db = new SQLite.SQLiteConnection(pathToDatabase)){ var ls = db.Table <SaleOrderDtls> ().Where(x => x.sono == so.sono).ToList <SaleOrderDtls>(); list = new SaleOrderDtls[ls.Count]; ls.CopyTo(list); } IPrintDocument prtSO = PrintDocManager.GetPrintDocument <PrintSalesOrder>(); prtSO.SetDocument(so); prtSO.SetDocumentDtls(list); prtSO.SetNoOfCopy(noofcopy); prtSO.SetCallingActivity(this); if (prtSO.StartPrint()) { updatePrintedStatus(so); var found = listData.Where(x => x.sono == so.sono).ToList(); if (found.Count > 0) { found [0].isPrinted = true; SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <SaleOrder> (this, listData, Resource.Layout.ListItemRow, viewdlg); } } else { Toast.MakeText(this, prtSO.GetErrMsg(), ToastLength.Long).Show(); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish (); } SetTitle (Resource.String.STOCKSUMMARY); pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; SetContentView (Resource.Layout.ItemStockList); imm = (InputMethodManager)GetSystemService(Context.InputMethodService); dateSearch = DateTime.Today; date = DateTime.Today; populate (listData); listView = FindViewById<ListView> (Resource.Id.ICodeList); txtSearch= FindViewById<EditText > (Resource.Id.txtSearch); Button butInvBack= FindViewById<Button> (Resource.Id.butICodeBack); Button butDate= FindViewById<Button> (Resource.Id.butDate); butDate.Click += delegate(object sender, EventArgs e) { //imm.HideSoftInputFromWindow(frd.WindowToken, 0); ShowDialog (DATE_DIALOG_ID1); }; butInvBack.Click += (object sender, EventArgs e) => { base.OnBackPressed(); }; viewdlg = SetViewDelegate; adapter = new GenericListAdapter<ItemStock> (this, listData, Resource.Layout.ItemStockDtls, viewdlg); listView.Adapter = adapter; listView.ItemClick+= ListView_Click; txtSearch.TextChanged+= TxtSearch_TextChanged; }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); if (!((GlobalvarsApp)this.Application).ISLOGON) { Finish (); } SetTitle (Resource.String.submenu_cust); SetContentView (Resource.Layout.ListCustView); // Create your application here pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; populate (listData); listView = FindViewById<ListView> (Resource.Id.CustList); Button butInvBack= FindViewById<Button> (Resource.Id.butCustBack); txtSearch= FindViewById<EditText > (Resource.Id.txtSearch); butInvBack.Click += (object sender, EventArgs e) => { base.OnBackPressed(); }; listView.ItemClick+= ListView_ItemClick; ; //istView.Adapter = new CusotmCustomerListAdapter(this, listData); viewdlg = SetViewDelegate; adapter = new GenericListAdapter<Trader> (this, listData, Resource.Layout.ListCustDtlView, viewdlg); listView.Adapter = adapter; txtSearch.TextChanged+= TxtSearch_TextChanged; }
// 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); }
void RefreshItemList() { populate(listData); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <CNNoteDtls> (this, listData, Resource.Layout.InvDtlItemViewCS, viewdlg); listView.SetSelection(0); }
public GenericListAdapter(Activity _context, List <T> _list, int viewID, SetViewDlg viewdlg) : base() { this.context = _context; this.list = _list; this.Filterlist = _list; _viewID = viewID; _dlg = viewdlg; }
void RefreshView() { pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; listData = new List <ItemStock> (); populate(listData); listView = FindViewById <ListView> (Resource.Id.ICodeList); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <ItemStock> (this, listData, Resource.Layout.ItemStockDtls, viewdlg); }
protected override void OnResume() { base.OnResume(); listData = new List <CNNote> (); populate(listData); apara = DataHelper.GetAdPara(pathToDatabase); listView = FindViewById <ListView> (Resource.Id.feedList); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <CNNote> (this, listData, Resource.Layout.ListItemRowCN, 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(); invno = Intent.GetStringExtra("invoiceno") ?? "AUTO"; CUSTCODE = Intent.GetStringExtra("custcode") ?? "AUTO"; listData = new List <SaleOrderDtls> (); populate(listData); listView = FindViewById <ListView> (Resource.Id.invitemList); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <SaleOrderDtls> (this, listData, Resource.Layout.InvDtlItemViewCS, 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 OnResume() { base.OnResume(); if (txtSearch.Text != "") { FindItemByText(); return; } listData = new List <Trader> (); populate(listData); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <Trader> (this, listData, Resource.Layout.ListCustDtlView, 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 OnResume() { base.OnResume(); if (txtSearch.Text != "") { FindItemByText(); return; } listData = new List <Invoice> (); populate(listData); apara = DataHelper.GetAdPara(pathToDatabase); listView = FindViewById <ListView> (Resource.Id.CustList); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <Invoice> (this, listData, Resource.Layout.ListItemRow, viewdlg); }
protected override void OnResume() { base.OnResume(); if (txtSearch.Text != "") { FindItemByText(""); return; } pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH; listData = new List <Item> (); populate(listData); listView = FindViewById <ListView> (Resource.Id.ICodeList); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <Item> (this, listData, Resource.Layout.ItemCodeDtlList, viewdlg); }
void DeleteItem(Invoice inv) { using (var db = new SQLite.SQLiteConnection(pathToDatabase)) { var list = db.Table <Invoice>().Where(x => x.invno == inv.invno).ToList <Invoice>(); if (list.Count > 0) { db.Delete(list [0]); var arrlist = listData.Where(x => x.invno == inv.invno).ToList <Invoice>(); if (arrlist.Count > 0) { listData.Remove(arrlist [0]); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <Invoice> (this, listData, Resource.Layout.ListItemRow, viewdlg); } } } }
void DeleteItem(CNNoteDtls invdtls) { using (var db = new SQLite.SQLiteConnection(pathToDatabase)) { var list = db.Table <CNNoteDtls>().Where(x => x.cnno == invdtls.cnno && x.ID == invdtls.ID).ToList <CNNoteDtls>(); if (list.Count > 0) { db.Delete(list [0]); var arrlist = listData.Where(x => x.cnno == invdtls.cnno && x.ID == invdtls.ID).ToList <CNNoteDtls>(); if (arrlist.Count > 0) { listData.Remove(arrlist [0]); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <CNNoteDtls> (this, listData, Resource.Layout.InvDtlItemViewCS, viewdlg); } } } }
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; }
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.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; }
private void AddBarCodeItem(Item prd) { double stqQty = 1; double uprice = Utility.GetUnitPrice(trd, prd); double taxval = prd.tax; double amount = Math.Round((stqQty * uprice), 2); double netamount = amount; bool taxinclusice = prd.isincludesive; double taxamt = 0; if (taxinclusice) { double percent = (taxval / 100) + 1; double amt2 = Math.Round(amount / percent, 2, MidpointRounding.AwayFromZero); taxamt = amount - amt2; netamount = amount - taxamt; } else { taxamt = Math.Round(amount * (taxval / 100), 2, MidpointRounding.AwayFromZero); } InvoiceDtls inv = new InvoiceDtls(); inv.invno = invno; inv.amount = amount; inv.icode = prd.ICode; inv.price = uprice; inv.qty = stqQty; inv.tax = taxamt; inv.taxgrp = prd.taxgrp; inv.netamount = netamount; inv.description = prd.IDesc; //int id = Convert.ToInt32 (ITEMUID); //inv..title = spinner.SelectedItem.ToString (); using (var db = new SQLite.SQLiteConnection(pathToDatabase)) { var list = db.Table <InvoiceDtls> ().Where(x => x.invno == invno && x.icode == prd.ICode).ToList(); if (list.Count > 0) { list [0].qty = list [0].qty + 1; stqQty = list [0].qty; amount = Math.Round((stqQty * uprice), 2); netamount = amount; if (taxinclusice) { double percent = (taxval / 100) + 1; double amt2 = Math.Round(amount / percent, 2, MidpointRounding.AwayFromZero); taxamt = amount - amt2; netamount = amount - taxamt; } else { taxamt = Math.Round(amount * (taxval / 100), 2, MidpointRounding.AwayFromZero); } list [0].tax = taxamt; list [0].amount = amount; list [0].netamount = netamount; db.Update(list [0]); } else { db.Insert(inv); } } listData = new List <InvoiceDtls> (); populate(listData); listView = FindViewById <ListView> (Resource.Id.invitemList); SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <InvoiceDtls> (this, listData, Resource.Layout.InvDtlItemViewCS, viewdlg); listView.SetSelection(listView.Count - 1); }