Exemplo n.º 1
0
        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
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            if (!((GlobalvarsApp)this.Application).ISLOGON) {
                Finish ();
            }

            SetTitle (Resource.String.title_cash);

            // 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(POSSalesActivity));
            };

            //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);
        }
Exemplo n.º 3
0
        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);
            Button butNew= FindViewById<Button> (Resource.Id.butnewInv);
            butNew.Click += butCreateNewInv;
            Button butInvBack= FindViewById<Button> (Resource.Id.butInvBack);
            butInvBack.Click += (object sender, EventArgs e) => {
                StartActivity(typeof(MainActivity));
            };

            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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            if (!((GlobalvarsApp)this.Application).ISLOGON) {
                Finish ();
            }
            SetTitle (Resource.String.submenu_cnlist);
            EventManagerFacade.Instance.GetEventManager().AddListener(this);
            // Create your application here
            //SetContentView (Resource.Layout.ListView);
            SetContentView (Resource.Layout.ListCustView);
            pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH;
            rights = Utility.GetAccessRights (pathToDatabase);

            Utility.GetDateRange (ref sdate,ref edate);
            populate (listData);
            apara =  DataHelper.GetAdPara (pathToDatabase);
            listView = FindViewById<ListView> (Resource.Id.CustList);
            txtSearch= FindViewById<EditText > (Resource.Id.txtSearch);
            //			TableLayout tlay = FindViewById<TableLayout> (Resource.Id.tableLayout1);
            //			tlay.Visibility = ViewStates.Invisible;
            //Button butNew= FindViewById<Button> (Resource.Id.butCustBack);
            //butNew.Visibility = ViewStates.Invisible;
            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<CNNote> (this, listData, Resource.Layout.ListItemRowCN, viewdlg);
            txtSearch.TextChanged+= TxtSearch_TextChanged;
        }
Exemplo n.º 6
0
 public PrintPCLDocumentBase()
 {
     prtcompHeader = new PrintPCLHeader();
     prtDetail = new PrintPCLDetails();
     prtFooter = new PrintPCLFooter();
     prtTaxSumm = new PrintPCLTaxSummary ();
     rights =Utility.GetAccessRights ();
 }
Exemplo n.º 7
0
        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;
            }
        }
Exemplo n.º 8
0
 protected override void OnResume()
 {
     base.OnResume();
     listData = new List<SaleOrder> ();
     rights = Utility.GetAccessRights (pathToDatabase);
     populate (listData);
     apara =  DataHelper.GetAdPara (pathToDatabase);
     listView = FindViewById<ListView> (Resource.Id.feedList);
     SetViewDlg viewdlg = SetViewDelegate;
     listView.Adapter = new GenericListAdapter<SaleOrder> (this, listData, Resource.Layout.ListItemRow, viewdlg);
 }
Exemplo n.º 9
0
 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 ();
 }
Exemplo n.º 10
0
 public void EnableGPSTracking(AccessRights rights)
 {
     Console.WriteLine ("EnableGPSTracking rights.IsGPSTracking {0}",rights.IsGPSTracking);
     if (rights.IsGPSTracking) {
         locator = CrossGeolocator.Current;
         if (locator.IsGeolocationAvailable) {
             if (!locator.IsListening) {
                 GetMyLocation ();
             }
         }
     }
 }
Exemplo n.º 11
0
 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);
 }
Exemplo n.º 12
0
        public static bool GetCashBillPrintStatus(string pathToDatabase,string invno,AccessRights rights)
        {
            bool iSPrinted = false;
            using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {

                if (rights.CSNotEditAftPrint) {
                    var list = db.Table<Invoice> ().Where (x => x.invno == invno).ToList ();
                    if (list.Count > 0) {
                        iSPrinted = list [0].isPrinted;
                    }
                }
            }
            return iSPrinted;
        }
Exemplo n.º 13
0
 public static bool GetCNNotePrintStatus(string pathToDatabase,string cnno,AccessRights rights)
 {
     bool iSPrinted = false;
     using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
         var info = db.Table<CompanyInfo> ().FirstOrDefault ();
         if (rights.CNNotEditAftPrint) {
             var list = db.Table<CNNote> ().Where (x => x.cnno == cnno).ToList ();
             if (list.Count > 0) {
                 iSPrinted = list [0].isPrinted;
             }
         }
     }
     return iSPrinted;
 }
Exemplo n.º 14
0
        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);
        }
Exemplo n.º 15
0
        protected override void OnResume()
        {
            base.OnResume();
            pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH;
            COMPCODE = ((GlobalvarsApp)this.Application).COMPANY_CODE;
            rights = Utility.GetAccessRights (pathToDatabase);

            invno = Intent.GetStringExtra ("invoiceno") ?? "AUTO";
            CUSTCODE = Intent.GetStringExtra ("custcode") ?? "AUTO";
            isNotAllowEditAfterPrinted  = DataHelper.GetInvoicePrintStatus (pathToDatabase,invno,rights);

            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);
        }
Exemplo n.º 16
0
        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();
            };
        }
Exemplo n.º 17
0
        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 ();
        }
Exemplo n.º 18
0
        public static AccessRights GetAccessRightsByString(string rights)
        {
            AccessRights right = new AccessRights();
            Type rtype = right.GetType();

            AccessRightField rightdesc = new AccessRightField();
            Type ftype = rightdesc.GetType();
            string[] keys = rights.Split(new char[] { ',' });
            foreach (string key in keys)
            {
                FieldInfo finfo = ftype.GetField(key);
                if (finfo != null)
                {
                    string fname=  finfo.GetValue(rightdesc).ToString();
                    PropertyInfo pinfo = rtype.GetProperty(fname);
                    if (pinfo != null)
                    {
                        pinfo.SetValue(right, true);
                    }
                }
            }

            return right;
        }
Exemplo n.º 19
0
        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);
        }
Exemplo n.º 20
0
        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;
        }
Exemplo n.º 21
0
        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;
        }
Exemplo n.º 22
0
        protected override void OnResume()
        {
            base.OnResume();
            pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH;
            rights = Utility.GetAccessRights (pathToDatabase);

            dono = Intent.GetStringExtra ("invoiceno") ?? "AUTO";
            CUSTCODE = Intent.GetStringExtra ("custcode") ?? "AUTO";
            isNotAllowEditAfterPrinted  = DataHelper.GetDelOderPrintStatus (pathToDatabase,dono,rights);
            Button butNew= FindViewById<Button> (Resource.Id.butnewItem);
            if (isNotAllowEditAfterPrinted)
                butNew.Enabled = false;

            listData = new List<DelOrderDtls> ();
            populate (listData);
            listView = FindViewById<ListView> (Resource.Id.invitemList);
            SetViewDlg viewdlg = SetViewDelegate;
            listView.Adapter = new GenericListAdapter<DelOrderDtls> (this, listData, Resource.Layout.InvDtlItemView, viewdlg);
        }
Exemplo n.º 23
0
        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 ();
        }
Exemplo n.º 24
0
        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);
        }
Exemplo n.º 25
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            if (!((GlobalvarsApp)this.Application).ISLOGON)
            {
                Finish();
            }
            this.Window.SetSoftInputMode(SoftInput.StateAlwaysHidden);
            SetTitle(Resource.String.title_cashnew);
            SetContentView(Resource.Layout.CreateInvoice);
            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);

            _date = DateTime.Today;


            // Create your application here

            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);

            //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");
            if (rights.InvEditTrxDate)
            {
                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);
            }

            dataAdapter = new ArrayAdapter <String> (this, Resource.Layout.spinner_item, icodes);


            dataAdapter2 = ArrayAdapter.CreateFromResource(
                this, Resource.Array.trxtype, Resource.Layout.spinner_item);

            // Drop down layout style - list view with radio button
            //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;
            EditText remark = FindViewById <EditText> (Resource.Id.newinv_custname);

            remark.RequestFocus();
            spinnerType.SetSelection(0);
            spinnerType.Enabled = false;
        }
Exemplo n.º 26
0
 private bool IsGPSTrackingEnbale()
 {
     if (rights == null) {
         rights = Utility.GetAccessRights (DATABASE_PATH);
     }
     Console.WriteLine ("rights.IsGPSTracking {0}",rights.IsGPSTracking);
     return rights.IsGPSTracking;
 }
Exemplo n.º 27
0
        //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;
        }
Exemplo n.º 28
0
        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 ();
        }
Exemplo n.º 29
0
        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;
        }
Exemplo n.º 30
0
        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();
            }
        }
Exemplo n.º 31
0
        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);
            }
        }
Exemplo n.º 32
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            if (!((GlobalvarsApp)this.Application).ISLOGON) {
                Finish ();
            }
            SetTitle (Resource.String.title_soitementry);
            EventManagerFacade.Instance.GetEventManager().AddListener(this);
            pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH;
            rights = Utility.GetAccessRights (pathToDatabase);

            SALEORDERNO = Intent.GetStringExtra ("invoiceno") ?? "AUTO";
            ITEMUID = Intent.GetStringExtra ("itemuid") ?? "AUTO";
            EDITMODE = Intent.GetStringExtra ("editmode") ?? "AUTO";
            CUSTOMER= Intent.GetStringExtra ("customer") ?? "AUTO";
            CUSTCODE= Intent.GetStringExtra ("custcode") ?? "AUTO";
            trd = DataHelper.GetTrader (pathToDatabase, CUSTCODE);
            // Create your application here
            SetContentView (Resource.Layout.SOEntry);
            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);
            txtInvNo.Text = SALEORDERNO;
            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.SOEditUPrice;
            //price.EditorAction += HandleEditorAction;

            //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);
            //			}
            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);

            // attaching data adapter to spinner
            spinner.Adapter =dataAdapter;
            if (EDITMODE == "EDIT") {
                FIRSTLOAD="1";
                LoadData (SALEORDERNO, ITEMUID);
            }
        }
Exemplo n.º 33
0
        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();
        }
Exemplo n.º 34
0
        public static bool IsUploadExpired(AccessRights rights,string pathToDatabase)
        {
            bool isExpired = false;
            if (!rights.IsUploadControl)
                return  isExpired;

            int Expiry = DataHelper.GetUploadExpiryDays(pathToDatabase);
            DateTime lastupload = DataHelper.GetLastUploadDate(pathToDatabase);
            double day = (DateTime.Now - lastupload).TotalDays;
            //isExpired = (day > Expiry);
            //change on 22/feb/2016 - by Mok
            //isExpired = (Expiry > day );
            isExpired = (day > Expiry  );

            return  isExpired;
        }