public async void addItem(string business, DateTime dateAndTime, string taxInvoice, string gstNum, string serverName, string productName, double productTotal, string phone, string address, string tag, byte[] image) { try { ReceiptClass item = new ReceiptClass(); item.user = kinveyClient.ClientUsers.CurrentUser; item.business = business; item.dateAndTime = dateAndTime; item.taxInvoice = taxInvoice; item.gstNum = gstNum; item.serverName = serverName; item.productName = productName; item.productTotal = productTotal; item.phone = phone; item.address = address; item.tag = tag; item.image = image; AsyncAppData <ReceiptClass> myBook = kinveyClient.AppData <ReceiptClass>(tblName, typeof(ReceiptClass)); ReceiptClass saved = await myBook.SaveAsync(item); } catch (Exception ex) { Console.WriteLine(ex); } }
public async void editItem(string editID, ReceiptClass newList) { try { AsyncAppData <ReceiptClass> myBook = kinveyClient.AppData <ReceiptClass>(tblName, typeof(ReceiptClass)); ReceiptClass editList = await myBook.GetEntityAsync(editID); editList = newList; ReceiptClass saved = await myBook.SaveAsync(editList); } catch (Exception ex) { Console.WriteLine(ex); } }
private void Btn_Edit_Click(object sender, EventArgs e) { ReceiptClass newList = new ReceiptClass(); newList.id = ID; newList.user = templist[0].user; newList.business = editxtBsinss.Text; newList.taxInvoice = editText1.Text; newList.gstNum = editxtGST.Text; newList.serverName = editxtServ.Text; newList.productName = editxtProdcNam.Text; newList.productTotal = Convert.ToDouble(editxtCost.Text); newList.phone = editxtPhNum.Text; newList.address = editxtAddrs.Text; newList.tag = editxtTag.Text; dbMan.editItem(ID, newList); StartActivity(typeof(ListActivity)); }