예제 #1
0
        private void AddStoreProduct()
        {
            try
            {
                DataRow productRow = ucSelectProduct.SelectedRow;
                if (productRow != null)
                {
                    DataRow dr = dataTable.NewRow();
                    dr["Id"]             = 0;
                    dr["DocumentId"]     = doc.Id;
                    dr["StoreProductId"] = 0;
                    dr["Count"]          = 1;

                    dr["ProductId"]     = productRow["Id"];
                    dr["Price"]         = 0;
                    dr["CurrentCount"]  = 0;
                    dr["ReservedCount"] = 0;
                    dr["Series"]        = "";
                    dr["ExpiredDate"]   = DBNull.Value;

                    dr["Code"] = productRow["Code"];
                    dr["Name"] = productRow["Name"];

                    StoreProductForm form = new StoreProductForm(dr, doc.completed);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        dataTable.Rows.Add(dr);
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(ex);
            }
        }
예제 #2
0
 private void Edit()
 {
     try
     {
         DataRow dataRow = SelectedRow;
         if (dataRow != null)
         {
             StoreProductForm form = new StoreProductForm(dataRow, doc.completed);
             if (form.ShowDialog() == DialogResult.OK)
             {
             }
         }
     }
     catch (Exception ex)
     {
         Log.Exception(ex);
     }
 }