Exemplo n.º 1
0
 private void dgv_list_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (dgv_liste.CurrentRow.Cells["id_"].Value != null)
         {
             Int32 id = Convert.ToInt32(dgv_liste.CurrentRow.Cells["id_"].Value);
             if (id > 0)
             {
                 Articles f = ArticlesBLL.One(id);
                 if (e.ColumnIndex == 7)
                 {
                     if (DialogResult.Yes == Messages.Confirmation(Mots.Supprimer.ToLower()))
                     {
                         LoadPhoto(null);
                         if (ArticlesBLL.Delete(f))
                         {
                             DeleteRow(f);
                             Reset();
                             Messages.Succes();
                         }
                     }
                 }
                 else
                 {
                     Populate(f);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Messages.Exception(ex);
     }
 }
Exemplo n.º 2
0
    protected void ibtnDel_OnCommand(object sender, CommandEventArgs e)
    {
        int id     = Convert.ToInt32(e.CommandName);
        int typeid = Convert.ToInt32(e.CommandArgument);

        try
        {
            bll.Delete(id);
            string str = " parentId=" + id + " and categoryId=" + typeid;
            Msg.Show("删除成功!");
            InitData(1, "", -1); //重新绑定
        }
        catch (Exception ex)
        {
            log.Error(ex.Message);
        }
    }
Exemplo n.º 3
0
 private void btn_delete_Click(object sender, EventArgs e)
 {
     if (current != null ? current.Id > 0 : false)
     {
         if (DialogResult.Yes == Messages.Confirmation(Mots.Supprimer.ToLower()))
         {
             if (ArticlesBLL.Delete(current))
             {
                 DeleteRow(current);
                 Reset();
                 Messages.Succes();
             }
         }
     }
 }