Example #1
0
 private void UpdateItem()
 {
     SelectedItem.ProductCode = IsSample ? SampleName.Trim() : SelectedInput.Code;
     SelectedItem.UnitPrice   = SelectedItem.IsSample ? Convert.ToDouble(SamplePriceText) : SelectedInput.Price;
     SelectedItem.ShipQty     = this.InputQty;
     SelectedItem.ShipDate    = this.InputDate;
     SelectedItem.ColorCode   = SelectedColor == null ? string.Empty : SelectedColor.item.Code;
     SelectedItem.ColorName   = SelectedColor == null ? string.Empty : SelectedColor.item.Name;
     ShipmentDao.Update(SelectedItem);
     ClearInput();
 }
Example #2
0
        private void CreateItem()
        {
            ShipmentItemModel item = new ShipmentItemModel()
            {
                CustomerCode = this._customerType,
                ProductCode  = IsSample ? SampleName.Trim() : SelectedInput.Code,
                UnitPrice    = IsSample ? Convert.ToDouble(SamplePriceText) : SelectedInput.Price,
                ShipQty      = this.InputQty,
                ShipDate     = this.InputDate,
                ColorCode    = SelectedColor == null ? string.Empty : SelectedColor.item.Code,
                ColorName    = SelectedColor == null ? string.Empty : SelectedColor.item.Name,
                IsSample     = this.IsSample
            };
            long id = ShipmentDao.Create(item);

            item.SerialNumber = id;
            this._listModel.Add(item);
            ClearInput();
        }