Ejemplo n.º 1
0
        /// <summary>
        /// 出货
        /// </summary>
        /// <param name="product">出货的货物</param>
        /// <returns>是否成功</returns>
        public bool Export(ProductStorage product, string comments = "", string userName = "******")
        {
            try
            {
                ExportLog log = new ExportLog(product.m_product, comments, userName);

                bool removed = false;
                foreach (ProductStorage pro in storageList)
                {
                    if (pro == product)
                    {
                        removed = true;
                        storageList.Remove(pro);
                        break;
                    }
                }

                if (!removed)
                {
                    return(false);
                }

                exportLogList.Add(log);
                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return(false);
            }
        }
Ejemplo n.º 2
0
        //选中了一行
        private void StoreManagementTab_tableView_RowSelected(object sender, IRowShowable selected)
        {
            storeManagementTab_selectedProductStorage = (ProductStorage)selected;

            labelShowProductType.Text  = storeManagementTab_selectedProductStorage.m_product.productType;
            labelShowProductClass.Text = storeManagementTab_selectedProductStorage.m_product.productClass;
            labelShowProductMNo.Text   = storeManagementTab_selectedProductStorage.m_product.MNo;
            labelShowProductCost.Text  = storeManagementTab_selectedProductStorage.importCost.ToString();
            labelShowImportTime.Text   = storeManagementTab_selectedProductStorage.importTime.ToString();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 换货
 /// </summary>
 /// <param name="inProduct">退进来的货</param>
 /// <param name="outProduct">拿出去的货</param>
 /// <returns>是否成功</returns>
 public bool Exchange(Product inProduct, ProductStorage outProduct, string comments = "", string userName = "******")
 {
     try
     {
         Money cost = new Money(0x0);
         Import(inProduct, cost);
         Export(outProduct);
         return(true);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
         return(false);
     }
 }
Ejemplo n.º 4
0
        public bool Import(Product product, Money cost, DateTime time, string comments = "", string userName = "******")
        {
            try
            {
                ProductStorage pStorage = new ProductStorage();

                pStorage.m_product  = product;
                pStorage.importCost = cost;

                pStorage.importTime = time;

                ImportLog log = new ImportLog(pStorage, comments, userName);

                storageList.Add(pStorage);
                importLogList.Add(log);
                return(true);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return(false);
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 换货
 /// </summary>
 /// <param name="inProduct">退进来的货</param>
 /// <param name="outProduct">拿出去的货</param>
 /// <param name="cost">价格</param>
 /// <returns>是否成功</returns>
 public bool Exchange(Product inProduct, ProductStorage outProduct, Money cost)
 {
     return(false);
 }