예제 #1
0
        private float InventoryItemData(int i)
        {
            CResult      oResult      = new CResult();
            CInventoryBO oInventoryBO = new CInventoryBO();

            CInventory oInventory = new CInventory();

            if (dgItemList.Rows[i].Cells["colItem"].Value != null)
            {
                oInventory.Invt_ItemOID = ((DataGridViewComboBoxCell)dgItemList.Rows[i].Cells["colItem"]).Value.ToString();
            }
            if (dgItemList.Rows[i].Cells["colSrcBranch"].Value != null)
            {
                oInventory.Invt_BranchOID = ((DataGridViewComboBoxCell)dgItemList.Rows[i].Cells["colSrcBranch"]).Value.ToString();
            }
            if (dgItemList.Rows[i].Cells["colSourceLoc"].Value != null)
            {
                oInventory.Invt_LocOID = ((DataGridViewComboBoxCell)dgItemList.Rows[i].Cells["colSourceLoc"]).Value.ToString();
            }
            if (dgItemList.Rows[i].Cells["colSrcInvType"].Value != null)
            {
                oInventory.Invt_InvType = Convert.ToInt32(Enum.Parse(typeof(EInvType), ((DataGridViewComboBoxCell)dgItemList.Rows[i].Cells["colSrcInvType"]).Value.ToString()));
            }

            oResult = oInventoryBO.ReadQtyByCond(oInventory);

            if (oResult.IsSuccess)
            {
                return(((CInventory)oResult.Data).Invt_QTY);
            }
            else
            {
                MessageBox.Show("Loading error...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(0.00f);
        }