Ejemplo n.º 1
0
        public ActionResult Deletes()
        {
            var ids = Utils.GetString(DATA, "IDs").DeSerialize <long[]>();

            if (!ids.Any())
            {
                SetError("Bạn chưa chọn thông tin nào để xóa");
                return(GetResultOrReferrerDefault(defauthPath));
            }
            if (OrderRepository.UseInstance.Deletes(ids))
            {
                ProductOrderRepository.DeleteByFieldLongIDs("IDOrder", ids);
                OrderFileRepository.UseInstance.DeleteByField("IDOrder", ids);
                AccountingDeptRepository.UseInstance.DeleteByField("IDOrder", ids);
                SetSuccess(string.Format("Xóa [{0}] đơn thành công", ids.Length));
            }
            else
            {
                SetError(string.Format("Xóa [{0}] đơn không thành công", ids.Length));
            }

            return(GetResultOrReferrerDefault(defauthPath));
            // var
        }