Beispiel #1
0
        public async Task <ActionResult> Delete(int id)
        {
            var result = await _organization.DeActiveAsync(id);

            return
                (Json(
                     new
            {
                redirectTo = Url.Action("Index", "Organization", new { Area = "Admin" }),
                message = result == 0 ? "Record deleted Failed!!!" : "Record deleted successfully!!!",
                position = "mainContent"
            }));
        }
Beispiel #2
0
        public async Task <IHttpActionResult> Delete([FromBody] int id)
        {
            try
            {
                var branch = await _organization.DeActiveAsync(id);

                var result = new
                {
                    Error   = branch != 1,
                    Message = branch != 1 ? "Branch Deactivation failed." : "",
                    Data    = branch
                };
                return(Ok(result));
            }
            catch (Exception ex)
            {
                ex.WriteLog();
                return(BadRequest("Branch Deactivation failed."));
            }
        }