protected void btnSave_Click(object sender, EventArgs e)
 {
     var item = _itemManager.FetchById(int.Parse(DDLItems.SelectedValue));
     var receivingDetail = new ReceivingDetail
     {
         Barcode = item.BarCode,
         BinId =int.Parse(DDLBins.SelectedValue),
         DateCreated = DateTime.Now,
         DepartmentId = Receiving.DepartmentId,
         ExpiryDate = DateTime.Parse(txtExpiryDate.Text),
         ItemId =item.Id,
         LocationId =int.Parse(DDLLocations.SelectedValue),
         Price =decimal.Parse(txtPrice.Text),
         RackId = int.Parse(DDLRacks.SelectedValue),
         ReceiveQuantity = int.Parse(txtReceivedQuantity.Text),
         ReceivingId = Receiving.Id,
         ReceivingReamrks = txtRemarks.Text,
         ReferenceNumber = Receiving.ReferenceNumber,
         Remarks = txtRemarks.Text,
         SellingPrice = decimal.Parse(txtSellingPrice.Text),
         Shelfid = int.Parse(DDLShelves.SelectedValue),
         SupplierId = Receiving.SupplierId,
         TotalAmount = (int.Parse(txtReceivedQuantity.Text)* decimal.Parse(txtPrice.Text)),
         UnitId =int.Parse(DDLUnits.SelectedValue),
         Uid = ReceivingDetailUid,
         Id = ReceivingDetailId
     };
     _rdManager.Save(receivingDetail);
 }
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     var receivingDetailToDelete = new ReceivingDetail
     {
         Id = ReceivingDetailId
     };
     _rdManager.Delete(receivingDetailToDelete);
 }