public JsonResult DeleteOutgoing(string OutgoingJson) { OutgoingEventModel Outgoing = null; try { Outgoing = JsonConvert.DeserializeObject <OutgoingEventModel>(OutgoingJson); Outgoing.OutMan = LoginUserInfo.UserId; Outgoing.RecordMan = LoginUserInfo.UserId; Outgoing.Status = "D";//刪除 if (ModelFactory.DeleteOutgoing(Outgoing)) { return(Json("1"));//代表已經處裡完 } else { return(Json("失敗!"));//失敗 } } catch (Exception ex) { return(Json(ex.Message)); } catch { return(Json("系統發生錯誤")); } }
public JsonResult DeleteOutgoing(string OutId, string EmpNo) { OutgoingEventModel Outgoing = null; JsonresultModel ResultModel = new JsonresultModel(); try { Outgoing = new OutgoingEventModel(); Outgoing.OutId = OutId; Outgoing.OutMan = EmpNo; Outgoing.RecordMan = EmpNo; Outgoing.Status = "D"; //刪除 Outgoing.Equipment = "1"; //App OutgoingModelFactory ModelFactory = new OutgoingModelFactory(); if (ModelFactory.DeleteOutgoing(Outgoing)) { ResultModel.Result = "1"; return(Json(ResultModel, JsonRequestBehavior.AllowGet));//代表已經處裡完 } else { ResultModel.Result = "0"; ResultModel.ErrorMsg = "無法刪除外出記錄"; return(Json(ResultModel, JsonRequestBehavior.AllowGet));//失敗 } } catch (Exception ex) { ResultModel.Result = "0"; ResultModel.ErrorMsg = ex.Message; return(Json(ResultModel, JsonRequestBehavior.AllowGet)); } catch { ResultModel.Result = "0"; ResultModel.ErrorMsg = "系統發生錯誤"; return(Json(ResultModel, JsonRequestBehavior.AllowGet)); } }