Ejemplo n.º 1
0
        private void DeleteDetailsRow(int iRowIndex)
        {
            HouseInfo house = GetDetailsRowModel(iRowIndex);

            if (house == null)
            {
                return;
            }

            if (MessageBox.Show(string.Format("是否确认删除库区【{0}】?", house.HouseName), "确认删除", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.No)
            {
                return;
            }

            try
            {
                if (house.IsDel != 2)
                {
                    string strErr = string.Empty;
                    if (!Basic_Func.DeleteHouseByID(house, ref strErr))
                    {
                        Common.Common_Func.ErrorMessage(strErr, "删除失败");
                        return;
                    }
                }

                Common.Common_Func.ErrorMessage("删除库区成功", "删除成功");
            }
            catch (Exception ex)
            {
                Common.Common_Func.ErrorMessage(ex.Message);
            }
            finally
            {
                GetListQueryData();
            }
        }