コード例 #1
0
ファイル: fHangHoa.cs プロジェクト: DocongkhaiHCMUS/QLBH
        private void BtnSua_ItemClick(object sender, ItemClickEventArgs e)
        {
            int      rowIndex          = gvMain.FocusedRowHandle;
            DataRow  fHH               = BUS_HangHoa.TimHH(gvMain.GetRowCellValue(rowIndex, "Product_ID").ToString());
            string   _Product_ID       = fHH.Field <string>("Product_ID");
            string   _Product_Name     = fHH.Field <string>("Product_Name");
            int      _Product_Type_ID  = fHH.Field <int>("Product_Type_ID");
            string   _Product_Group_ID = fHH.Field <string>("Product_Group_ID");
            string   _Provider_ID      = fHH.Field <string>("Provider_ID");
            string   _Unit             = fHH.Field <string>("Unit");
            string   _Photo            = fHH.Field <string>("_Photo");
            decimal  _Org_Price        = fHH.Field <decimal>("Org_Price");
            decimal  _Sale_Price       = fHH.Field <decimal>("Sale_Price");
            decimal  _Retail_Price     = fHH.Field <decimal>("Retail_Price");
            string   _Customer_ID      = fHH.Field <string>("Customer_ID");
            string   _Customer_Name    = fHH.Field <string>("Customer_Name");
            decimal  _MinStock         = fHH.Field <decimal>("MinStock");
            bool     _Active           = fHH.Field <bool>("Active");
            CHangHoa hh = new CHangHoa
            {
                Product_ID       = _Product_ID,
                Product_Name     = _Product_Name,
                Product_Type_ID  = _Product_Type_ID,
                Product_Group_ID = _Product_Group_ID,
                Provider_ID      = _Provider_ID,
                Unit             = _Unit,
                Photo            = _Photo == null?"":_Photo,
                Org_Price        = float.Parse(_Org_Price.ToString()),
                Sale_Price       = float.Parse(_Sale_Price.ToString()),
                Retail_Price     = float.Parse(_Retail_Price.ToString()),
                Customer_ID      = _Customer_ID,
                Customer_Name    = _Customer_Name,
                MinStock         = (int)_MinStock,
                Active           = _Active
            };
            fThemHangHoa sua = new fThemHangHoa(false, hh, LoadData);

            sua.ShowDialog();
        }