private void btnStorage_Click(object sender, EventArgs e)
        {
            if (this.dgvProduct.CurrentRow == null)
            {
                return;
            }
            DataRow dr = this.objDataTable.Rows[this.dgvProduct.CurrentRow.Index];

            Products objpro = new Products()
            {
                ProductId         = dr["ProductId"].ToString(),
                ProductName       = dr["ProductName"].ToString(),
                UnitId            = Convert.ToInt32(dr["UnitId"]),
                UnitName          = dr["UnitName"].ToString(),
                UnitPrice         = Convert.ToDouble(dr["UnitPrice"]),
                Discount          = Convert.ToInt32(dr["Discount"]),
                TotalCount        = Convert.ToInt32(dr["TotalCount"]),
                MaxCount          = Convert.ToInt32(dr["MaxCount"]),
                MinCount          = Convert.ToInt32(dr["MinCount"]),
                StatusId          = Convert.ToInt32(dr["StatusId"]),
                StatusDescription = dr["StatusDescription"].ToString(),
                CategoryId        = Convert.ToInt32(dr["CategoryId"]),
                CategoryName      = dr["CategoryName"].ToString()
            };
            FormProductStorage objFormProductStorage = new FormProductStorage(objpro);

            objFormProductStorage.ShowDialog();
            btnQuery.PerformClick();
        }
Exemple #2
0
 private void btnProductInventory_Click(object sender, EventArgs e)
 {
     if (objFormProductStorage == null)
     {
         objFormProductStorage = new Product.FormProductStorage();
         CreateForm(objFormProductStorage);
     }
     else
     {
         objFormProductStorage.Activate();                           //激活最小化的窗体
         objFormProductStorage.WindowState = FormWindowState.Normal; //让最小化的窗体正常显示
     }
     SetFormStartPosition(objFormProductStorage);
 }