コード例 #1
0
        // GET: InvoiceController/Delete/5
        public ActionResult Delete(int id)
        {
            var Invoice = _repo.FindbyId(id);


            if (Invoice == null)
            {
                return(NotFound());
            }
            var isvalid = _repo.Delete(Invoice);

            if (!isvalid)
            {
                return(BadRequest());
            }
            return(RedirectToAction(nameof(Index)));
        }
コード例 #2
0
 //删除单个(查ID)
 public static int Delete(int ID, ref string ErrMsg)
 {
     I_Invoice I = (D_Invoice)SimpleFactory.CreateObject(DBType.Invoice);
     return I.Delete(ID, ref ErrMsg);
 }