public override int GetHashCode() { int hashCode = -1849913550; if (Type != null) { hashCode += Type.GetHashCode(); } if (PhysicalCount != null) { hashCode += PhysicalCount.GetHashCode(); } if (Adjustment != null) { hashCode += Adjustment.GetHashCode(); } if (Transfer != null) { hashCode += Transfer.GetHashCode(); } return(hashCode); }
protected void ToString(List <string> toStringOutput) { toStringOutput.Add($"Type = {(Type == null ? "null" : Type.ToString())}"); toStringOutput.Add($"PhysicalCount = {(PhysicalCount == null ? "null" : PhysicalCount.ToString())}"); toStringOutput.Add($"Adjustment = {(Adjustment == null ? "null" : Adjustment.ToString())}"); toStringOutput.Add($"Transfer = {(Transfer == null ? "null" : Transfer.ToString())}"); }
public PhysicalCountForm(PhysicalCount count) { InitializeComponent(); this.PhysicalCount = count; listView1.Resize += delegate { columnHeader2.Width = listView1.Width - 22 - (columnHeader1.Width + columnHeader3.Width + columnHeader4.Width + columnHeader5.Width); }; addToolStripMenuItem.Click += delegate { buttonAdd.PerformClick(); }; }
void ListView1DoubleClick(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { PhysicalCount c = counts[listView1.SelectedItems[0].Index]; WorkbenchSingleton.AddChild(new PhysicalCountForm(c), "Edit Physical Count"); } }
public ActionResult Create() { var physicalCount = new PhysicalCount { IsNew = true }; _physicalCountRepository.InsertAndCommit(physicalCount); return(Json(new { Id = physicalCount.Id })); }
void DeleteToolStripMenuItemClick(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { foreach (ListViewItem li in listView1.SelectedItems) { PhysicalCount c = counts[li.Index]; DeletePhysicalCount(c, null); } OnActivated(null); } }
private void Validate(PhysicalCountModel model, PhysicalCount physicalCount, string actionName) { if (!string.IsNullOrEmpty(actionName)) { if (actionName == WorkflowActionName.Approve) { if (model.PhysicalCountDate != null && model.PhysicalCountDate < DateTime.UtcNow.Date) { ModelState.AddModelError("", _localizationService.GetResource("PhysicalCount.PhysicalCountDateCannotEarlierThanToday")); } if (physicalCount.IsApproved == true) { ModelState.AddModelError("", _localizationService.GetResource("Record.AlreadyApproved")); } } } }
public virtual void Approve(PhysicalCount physicalCount) { if (physicalCount.IsApproved == false) { bool needAdjust = false; var adjust = new Adjust(); //add adjust from physical count foreach (var item in physicalCount.PhysicalCountItems) { var currentQuantity = _storeService.GetTotalQuantity(item.StoreLocator.StoreId, item.StoreLocatorId, item.ItemId); if (item.Count.HasValue && item.Count != currentQuantity) { needAdjust = true; var adjustItem = new AdjustItem { StoreLocatorId = item.StoreLocatorId, ItemId = item.ItemId, AdjustQuantity = item.Count - currentQuantity }; adjust.AdjustItems.Add(adjustItem); } } if (needAdjust == true) { adjust.Name = adjust.Description = string.Format("Auto Generated adjust for PhysicalCount {0}", physicalCount.Number); adjust.AdjustDate = DateTime.UtcNow; adjust.SiteId = physicalCount.SiteId; adjust.StoreId = physicalCount.StoreId; string number = _autoNumberService.GenerateNextAutoNumber(_dateTimeHelper.ConvertToUserTime(DateTime.UtcNow, DateTimeKind.Utc), adjust); adjust.Number = number; adjust.PhysicalCountId = physicalCount.Id; _adjustRepository.InsertAndCommit(adjust); } physicalCount.IsApproved = true; if (needAdjust == true) { physicalCount.AdjustId = adjust.Id; } _physicalCountRepository.UpdateAndCommit(physicalCount); } }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj == this) { return(true); } return(obj is InventoryChange other && ((Type == null && other.Type == null) || (Type?.Equals(other.Type) == true)) && ((PhysicalCount == null && other.PhysicalCount == null) || (PhysicalCount?.Equals(other.PhysicalCount) == true)) && ((Adjustment == null && other.Adjustment == null) || (Adjustment?.Equals(other.Adjustment) == true)) && ((Transfer == null && other.Transfer == null) || (Transfer?.Equals(other.Transfer) == true))); }
public EditPhysicalCount(PhysicalCount count) { this.count = count; }
void ButtonClearClick(object sender, EventArgs e) { this.PhysicalCount = new PhysicalCount(); }
public void Delete(PhysicalCount t) { dao.Delete(t); }
public void SaveOrUpdate(PhysicalCount t) { dao.SaveOrUpdate(t); }