Ejemplo n.º 1
0
        /// <summary>
        /// Delete menu
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void deleteMenu_Click(object sender, EventArgs e)
        {
            if ((null != resultGrid.CurrentRow) &&
                (MessageBox.Show(this, "آیا برای حذف اطمینان دارید؟", "حذف رکورد", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes))
            {
                int id;

                // Get id
                id = Convert.ToInt32(resultGrid.CurrentRow.Cells["id"].Value);

                Common.BLL.Entity.GasStation.Base__PlateType model = new Common.BLL.Entity.GasStation.Base__PlateType()
                {
                    id = id
                };

                Common.BLL.Logic.GasStation.Base__PlateType lPlateType = new Common.BLL.Logic.GasStation.Base__PlateType(Common.Enum.EDatabase.GasStation);
                CommandResult opResult = lPlateType.delete(model);

                if (opResult.status == BaseDAL.Base.EnumCommandStatus.success)
                {
                    reload();
                }
            }
            else
            {
                MessageBox.Show("رکوردی انتخاب نشده است", "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }