Пример #1
0
        private void SetViewDelegate(View view, object clsobj)
        {
            ItemPrices item = (ItemPrices)clsobj;

            view.FindViewById <TextView> (Resource.Id.icode).Text    = item.ICode;
            view.FindViewById <TextView> (Resource.Id.itemdesc).Text = item.IDesc;
            view.FindViewById <TextView> (Resource.Id.custcode).Text = item.CustCode;
            view.FindViewById <TextView> (Resource.Id.custname).Text = item.CustName;
            view.FindViewById <TextView> (Resource.Id.invdate).Text  = item.InvDate.ToString("dd-MM-yyyy");
            view.FindViewById <TextView> (Resource.Id.price).Text    = item.Price.ToString("n3");
        }
Пример #2
0
        private void InsertItemPriceIntoDb(List <ItemLastPrice> list)
        {
            string pathToDatabase = ((GlobalvarsApp)CallingActivity.Application).DATABASE_PATH;

            using (var db = new SQLite.SQLiteConnection(pathToDatabase)) {
                //var list2 = db.Table<Item>().ToList<Item>();
                db.DeleteAll <ItemPrices> ();
                int id = 1;
                foreach (ItemLastPrice item in list)
                {
                    ItemPrices itm = new ItemPrices();
                    itm.ID       = id;
                    itm.ICode    = item.ICode;
                    itm.IDesc    = item.IDesc;
                    itm.Price    = item.Price;
                    itm.CustCode = item.CustCode;
                    itm.CustName = item.CustName;
                    itm.InvDate  = item.InvDate;
                    if (string.IsNullOrEmpty(item.IClass))
                    {
                        itm.IClass = "";
                    }
                    else
                    {
                        itm.IClass = item.IClass;
                    }

                    db.Insert(itm);
                    id = id + 1;
                }
            }

            string dmsg = CallingActivity.Resources.GetString(Resource.String.msg_successdownitems);

            dmsg = dmsg.Replace("nn", list.Count.ToString());

            Downloadhandle.Invoke(CallingActivity, list.Count, dmsg);
        }
Пример #3
0
        private void InsertItemPriceIntoDb(List<ItemLastPrice> list)
        {
            string pathToDatabase = ((GlobalvarsApp)CallingActivity.Application).DATABASE_PATH;
            using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
                //var list2 = db.Table<Item>().ToList<Item>();
                db.DeleteAll<ItemPrices> ();
                int id = 1;
                foreach (ItemLastPrice item in list) {
                    ItemPrices itm = new ItemPrices ();
                    itm.ID = id;
                    itm.ICode = item.ICode;
                    itm.IDesc = item.IDesc;
                    itm.Price = item.Price;
                    itm.CustCode = item.CustCode;
                    itm.CustName = item.CustName;
                    itm.InvDate = item.InvDate;
                    if (string.IsNullOrEmpty (item.IClass))
                        itm.IClass = "";
                    else
                        itm.IClass = item.IClass;

                    db.Insert (itm);
                    id = id + 1;
                }
            }

            string dmsg = CallingActivity.Resources.GetString (Resource.String.msg_successdownitems);
            dmsg = dmsg.Replace ("nn", list.Count.ToString ());

            Downloadhandle.Invoke(CallingActivity,list.Count,dmsg);
        }