public async Task SaveVoucher(ReturnVoucher newRT) { newVoucherVisibility = "Hidden"; popUpVisibility = "Visible"; int thisVoucherID = newRT.retID; for (int i = 0; i < WareHouse.Count; i++) { if (newRT.ret_warehouse == WareHouse[i].wareHouseName) { newRT.wareHouseID = WareHouse[i].wareHouseID; } } string urlt = "https://api.shikkhanobish.com/api/Silicon/setReturnlVoucher"; HttpClient clientt = new HttpClient(); string jsonDataT = JsonConvert.SerializeObject(new { retID = newRT.retID, returnDate = newRT.returnDate, contructor = newRT.contructor, ret_warehouse = newRT.ret_warehouse, wareHouseID = newRT.wareHouseID, workOrderNo = newRT.workOrderNo, cause = newRT.cause, ret_type = newRT.ret_type, condition = newRT.condition, ItemNo = newRT.ItemNo, quentity = newRT.quentity, Description = newRT.Description }); StringContent contentT = new StringContent(jsonDataT, Encoding.UTF8, "application/json"); HttpResponseMessage responset = await clientt.PostAsync(urlt, contentT).ConfigureAwait(true); string resultt = await responset.Content.ReadAsStringAsync(); var r = JsonConvert.DeserializeObject <Response>(resultt); await RestInfo().ConfigureAwait(false); getMaxVoucher(); ShowThisVoucher(thisVoucherID); netReturnVoucher = ""; makeVoucherEnabled = true; int next = maxReturnVoucher + 1; netReturnVoucher = "Return ID: " + next; amountTxbx = ""; currentBlnclbl = ""; popUpVisibility = "Hidden"; nextBtnEnabled = true; }
public void ReadyVoucherForSaving() { ReturnVoucher newRT = new ReturnVoucher(); newRT.retID = int.Parse(returnIDPrv); newRT.returnDate = DateTime.Now.ToString("dd/M/yyyy"); newRT.contructor = contructorPrv; newRT.ret_warehouse = wareHousePrv; newRT.workOrderNo = workOrderNoPrv; newRT.cause = causePrv; newRT.ret_type = returnTypePrv; newRT.condition = conditionPrv; newRT.ItemNo = itemNumber.itemNumber; newRT.quentity = int.Parse(amountTxbx); newRT.Description = itemNumber.itemName; SaveVoucher(newRT); }
public void ShowList() { ObservableCollection <ReturnVoucher> objList = new ObservableCollection <ReturnVoucher>(); filterTypeANdCondition(); int sl = 1; for (int i = 0; i < AllRetrunVoucher.Count; i++) { ReturnVoucher obj = new ReturnVoucher(); DateTime thisVoucherDate = DateTime.ParseExact(AllRetrunVoucher[i].returnDate, "dd/M/yyyy", null); if ((thisVoucherDate >= From && thisVoucherDate <= To) && wareHouseName.wareHouseName == AllRetrunVoucher[i].ret_warehouse && AllRetrunVoucher[i].condition == conditionNew && AllRetrunVoucher[i].ret_type == typenew && AllRetrunVoucher[i].isPrinted == 1) { obj.SL = sl; obj.retID = AllRetrunVoucher[i].retID; obj.returnDate = AllRetrunVoucher[i].returnDate; obj.ItemNo = AllRetrunVoucher[i].ItemNo; obj.Description = AllRetrunVoucher[i].Description; obj.quentity = AllRetrunVoucher[i].quentity; obj.contructor = AllRetrunVoucher[i].contructor; obj.ret_type = AllRetrunVoucher[i].ret_type; obj.condition = AllRetrunVoucher[i].condition; for (int j = 0; j < stockData.Count; j++) { if (AllRetrunVoucher[i].ItemNo == stockData[j].itemNO) { obj.unit = stockData[j].unit; break; } } sl++; objList.Add(obj); } } ShowingReport = objList; }