Exemplo n.º 1
0
 public OutletItemDetailAdapter(vwOutletListViewModel item, List <OutletTask> task, RCSOUTLET rcs, List <vwSalesOutletChart> chart, List <vwSalesOutlet> salesOutlet, List <LKWk> mLKWk)
 {
     this.OutletItem            = item;
     this.OutletItemTask        = task;
     this.OutletItemRCS         = rcs;
     this.OutletItemChartList   = chart;
     this.OutletItemSalesOutlet = salesOutlet;
     this.mLKWk = mLKWk;
 }
Exemplo n.º 2
0
        public void BindItem(RCSOUTLET rcs)
        {
            Remark.Text     = "Outlet Remarks (Update By TME)";
            UpdateDate.Text = "";
            Edit.Text       = "EDIT";
            TextBox.Text    = "";

            if (rcs != null)
            {
                TextBox.Text    = rcs.getFIELDVALUE();
                UpdateDate.Text = rcs.getLASTUPDATE();
            }
        }
        private void ShowRemarkTextBox(string remark)
        {
            Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(this);
            builder.SetTitle("Outlet Remarks");
            LayoutInflater inflater   = (LayoutInflater)GetSystemService(LayoutInflaterService);
            var            customView = inflater.Inflate(Resource.Layout.fragment_dashboard_rcste_remark_box, null);

            builder.SetView(customView);

            EditText editText = customView.FindViewById <EditText>(Resource.Id.fragment_dashboard_rcste_remark_text);

            editText.Text = remark;
            builder.SetPositiveButton("SAVE", (sender, e) =>
            {
                string text  = editText.Text;
                string today = DateTime.Now.ToString("yyyy-MM-dd");

                vwOutletListViewModel SelectedItem = GlobalsAndroid.SelectedOutletListItem;
                string CustomerID = SelectedItem.getCustomerID();

                if (CustomerID != "")
                {
                    GlobalsAndroid.SaveRCSOutlet("OUTLET_REMARK", CustomerID, text, today);

                    var masterDB = GlobalsAndroid.GetMasterDBInstance();
                    if (masterDB != null)
                    {
                        masterDB.DeleteRCSOutletByID(CustomerID);
                        masterDB.InsertRCSOutlet("OUTLET_REMARK", CustomerID, text, today);

                        mRCSOutlet = masterDB.GetRCSOUTLETByID(CustomerID);
                        adapter.UpdateRCSOutletRemark(mRCSOutlet);
                        adapter.NotifyItemChanged(2);
                    }
                }
            });
            builder.SetNegativeButton("CANCEL", (sender, e) =>
            {
            });
            builder.Show();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_arrow_back_white_24dp);

            this.Title = "Outlet Item";

            if (GlobalsAndroid.SelectedOutletListItem != null)
            {
                this.Title = GlobalsAndroid.SelectedOutletListItem.getCustomerName();
            }

            var masterDB = GlobalsAndroid.GetMasterDBInstance();

            if (masterDB != null)
            {
                string CustomerID = GlobalsAndroid.SelectedOutletListItem.getCustomerID();
                mRCSOutlet          = masterDB.GetRCSOUTLETByID(CustomerID);
                mOutletTask         = masterDB.GetOutletTaskByID(CustomerID);
                mVwSalesOutletChart = masterDB.GetViewSalesOutletChartByID(CustomerID);
                mVwSalesOutlet      = masterDB.GetViewSalesOutletByID(CustomerID);
                listLKWk            = masterDB.GetLKWk();
            }

            recyclerView = (RecyclerView)FindViewById(Resource.Id.recyclerview_outletlistitem);

            // Plug in the linear layout manager:
            var layoutManager = new LinearLayoutManager(this);

            recyclerView.SetLayoutManager(layoutManager);

            // Plug in my adapter:
            adapter = new OutletItemDetailAdapter(GlobalsAndroid.SelectedOutletListItem, mOutletTask, mRCSOutlet, mVwSalesOutletChart, mVwSalesOutlet, listLKWk);
            adapter.OutletItemRemarkClick += OnOutletItemRemarkClicked;
            recyclerView.SetAdapter(adapter);
        }
Exemplo n.º 5
0
 public void UpdateRCSOutletRemark(RCSOUTLET rcsOutlet)
 {
     this.OutletItemRCS = rcsOutlet;
 }