void bgUnRegisteredIncident_DoWork(object sender, DoWorkEventArgs e) { try { string itemId = e.Argument.ToString(); PosIncidentReport posIncidentReport = new PosIncidentReport(); posIncidentReport.ItemId = Convert.ToInt32(itemId); posIncidentReport.CommitedQuantity = 0; posIncidentReport.CommittedGainValue = 0; posIncidentReport.CommittedLossValue = 0; posIncidentReport.CostPrice = CostPrice; posIncidentReport.Price = SellPrice; posIncidentReport.ShelfQuantity = 0; posIncidentReport.SystemQuantity = 0; posIncidentReport.IncidentType = 65; posIncidentReport.BranchId = SettingHelpers.CurrentBranchId; posIncidentReport.IsRegisterItem = true; posIncidentReport.CreatedDateTime = DateTime.UtcNow; posIncidentReport.IsProcess = true; _posRepository.InsertPosIncidentReport(posIncidentReport); } catch (Exception) { throw; } }
public void InsertPosIncidentReport(PosIncidentReport posIncidentReport) { if (CheckForExistingIncident(posIncidentReport.ItemId, posIncidentReport.IncidentType)) { _posItemIncident.Add(posIncidentReport); _posItemIncident.SaveChanges(); } }
public void InsertPosIncidentReport(PosIncidentReport posIncidentReport) { if (!CheckForExistingIncident(posIncidentReport.ItemId, posIncidentReport.IncidentType)) { string jsonString = JsonConvert.SerializeObject(posIncidentReport); var httpContent = new StringContent(jsonString, Encoding.UTF8, "application/json"); var response = httpClient.PostAsync("api/incidentreport/insertposincidentreport", httpContent); } }