public JsonResult UpdateTempData(ItemChargeUnitInsertViewModel model) { MSGReturnModel <string> result = new MSGReturnModel <string>(); result.RETURN_FLAG = false; result.DESCRIPTION = Ref.MessageType.login_Time_Out.GetDescription(); if (Cache.IsSet(CacheList.ItemChargeUnitSearchDetailViewData)) { var tempData = (List <ItemChargeUnitSearchDetailViewModel>)Cache.Get(CacheList.ItemChargeUnitSearchDetailViewData); var updateTempData = tempData.FirstOrDefault(x => x.vCHARGE_UNIT_ID == model.vCHARGE_UNIT_ID); if (updateTempData != null) { var _EMPS = new Service.Actual.Common().GetEmps(); var _TREA_ITEM_NAME = new Service.Actual.Common().GetSysCode("TREA_ITEM_NAME"); updateTempData.vEXEC_ACTION = updateTempData.vEXEC_ACTION == "A" ? "A" : "U"; updateTempData.vEXEC_ACTION_VALUE = updateTempData.vEXEC_ACTION_VALUE == "A" ? "新增" : "修改"; updateTempData.vIS_MAIL_DEPT_MGR = model.vIS_MAIL_DEPT_MGR; updateTempData.vIS_MAIL_SECT_MGR = model.vIS_MAIL_SECT_MGR; updateTempData.vIS_DISABLED = model.vIs_Disabled; Cache.Invalidate(CacheList.ItemChargeUnitSearchDetailViewData); Cache.Set(CacheList.ItemChargeUnitSearchDetailViewData, tempData); result.RETURN_FLAG = true; result.DESCRIPTION = Ref.MessageType.update_Success.GetDescription(); } else { result.RETURN_FLAG = false; result.DESCRIPTION = Ref.MessageType.update_Fail.GetDescription(); } } return(Json(result)); }
/// <summary> /// 畫面初始 /// </summary> /// <returns></returns> public ActionResult Index() { ViewBag.opScope = GetopScope("~/ItemMaintain/"); var empty = new SelectOption() { Text = " ", Value = " " }; ViewBag.dITEM_OP_TYPE = new SelectList(new Service.Actual.Common().GetSysCode("ITEM_OP_TYPE", true), "Value", "Text"); ViewBag.dISDO_PERDAY = new SelectList(new Service.Actual.Common().GetSysCode("YN_FLAG", true), "Value", "Text"); ViewBag.dIS_DISABLED = new SelectList(new Service.Actual.Common().GetSysCode("IS_DISABLED", true), "Value", "Text"); var _TREA_ITEM_TYPE = new Service.Actual.Common().GetSysCode("TREA_ITEM_TYPE"); _TREA_ITEM_TYPE.Insert(0, empty); var _TREA_ITEM_NAME = new Service.Actual.Common().GetSysCode("TREA_ITEM_NAME"); _TREA_ITEM_NAME.Insert(0, empty); ViewBag.dITEM_OP_TYPE_MOD = new SelectList(new Service.Actual.Common().GetSysCode("ITEM_OP_TYPE"), "Value", "Text"); ViewBag.dYN_FLAG_MOD = new SelectList(new Service.Actual.Common().GetSysCode("YN_FLAG"), "Value", "Text"); ViewBag.dTREA_ITEM_TYPE_MOD = new SelectList(_TREA_ITEM_TYPE, "Value", "Text"); ViewBag.dTREA_ITEM_NAME_MOD = new SelectList(_TREA_ITEM_NAME, "Value", "Text"); ViewBag.dIS_DISABLED_MOD = new SelectList(new Service.Actual.Common().GetSysCode("IS_DISABLED"), "Value", "Text"); return(View()); }
public JsonResult InsertTempData(ItemChargeUnitInsertViewModel model) { MSGReturnModel <string> result = new MSGReturnModel <string>(); //List<ItemChargeUnitSearchDetailViewModel> tempData = new List<ItemChargeUnitSearchDetailViewModel>(); result.RETURN_FLAG = false; result.DESCRIPTION = Ref.MessageType.login_Time_Out.GetDescription(); var HasSameName = ItemChargeUnit.CheckName(model); //var HasSameData = tempData.FirstOrDefault(x => x.vTREA_ITEM_NAME == model.vTREA_ITEM_NAME && x.vCHARGE_UID == model.vCHARGE_UID); if (HasSameName) { result.DESCRIPTION = string.Format("此經辦已經是資料庫名稱 {0} 的經辦", model.vTREA_ITEM_NAME_VALUE); result.RETURN_FLAG = false; return(Json(result)); } if (Cache.IsSet(CacheList.ItemChargeUnitSearchDetailViewData)) { var tempData = (List <ItemChargeUnitSearchDetailViewModel>)Cache.Get(CacheList.ItemChargeUnitSearchDetailViewData); var _TREA_ITEM_NAME = new Service.Actual.Common().GetSysCode("TREA_ITEM_NAME"); var _DATA_STATUS = new Service.Actual.Common().GetSysCode("DATA_STATUS"); var _EMPS = new Service.Actual.Common().GetEmps(); var _DEPTS = new Service.Actual.Common().GetDepts(); var cUserId = AccountController.CurrentUserId; var _ItemChargeUnitSearchDetailVM = new ItemChargeUnitSearchDetailViewModel() { vCHARGE_UNIT_ID = model.vCHARGE_UNIT_ID, vTREA_ITEM_NAME = model.vTREA_ITEM_NAME, vTREA_ITEM_NAME_VALUE = model.vTREA_ITEM_NAME_VALUE, vCHARGE_DEPT = model.vCHARGE_DEPT, vCHARGE_DEPT_VALUE = !model.vCHARGE_DEPT.IsNullOrWhiteSpace() ? _EMPS.FirstOrDefault(y => y.DPT_CD != null && y.DPT_CD.Trim() == model.vCHARGE_DEPT)?.DPT_NAME?.Trim() : null, vCHARGE_SECT = !model.vCHARGE_SECT.IsNullOrWhiteSpace() ? model.vCHARGE_SECT : "", vCHARGE_SECT_VALUE = !model.vCHARGE_SECT.IsNullOrWhiteSpace() ? _EMPS.FirstOrDefault(y => y.DPT_CD != null && y.DPT_CD.Trim() == model.vCHARGE_SECT)?.DPT_NAME?.Trim() : null, vIS_MAIL_DEPT_MGR = model.vIS_MAIL_DEPT_MGR, vIS_MAIL_SECT_MGR = model.vIS_MAIL_SECT_MGR, vCHARGE_UID = model.vCHARGE_UID, vCHARGE_NAME = !model.vCHARGE_UID.IsNullOrWhiteSpace() ? _EMPS.FirstOrDefault(y => y.USR_ID == model.vCHARGE_UID)?.EMP_NAME?.Trim() : null, vDATA_STATUS = "1", vDATA_STATUS_VALUE = _DATA_STATUS.FirstOrDefault(x => x.Value == "1")?.Text?.Trim(), vEXEC_ACTION = "A", vEXEC_ACTION_VALUE = "新增", vIS_DISABLED = model.vIs_Disabled }; tempData.Add(_ItemChargeUnitSearchDetailVM); Cache.Invalidate(CacheList.ItemChargeUnitSearchDetailViewData); Cache.Set(CacheList.ItemChargeUnitSearchDetailViewData, tempData); result.RETURN_FLAG = true; result.DESCRIPTION = Ref.MessageType.insert_Success.GetDescription(); } return(Json(result)); }
/// <summary> /// 抓取權責部門,科別名稱 /// </summary> /// <param name="type"></param> /// <param name="DEPT_ITEM">部門名稱</param> /// <returns></returns> public JsonResult GetCharge(Ref.TreaItemType type, string DEPT_ITEM) { var result = new List <SelectOption>(); var All = new SelectOption() { Text = "All", Value = "All" }; // 190603 Edited by Biacno 非保管科只能顯示本科資料 //var _CustodyFlag = Convert.ToBoolean(Session["CustodyFlag"]); var _CustodyFlag = AccountController.CustodianFlag; string Det_cd = new Service.Actual.Common().GetEmps()?.FirstOrDefault(x => x.USR_ID != null && x.USR_ID == AccountController.CurrentUserId)?.DPT_CD?.Trim(); var _Depts = new Service.Actual.Common().GetDepts()?.FirstOrDefault(x => x.DPT_CD.Trim() == Det_cd); string branch = ""; string dept = ""; if (_Depts != null && _Depts.Dpt_type == "04") { branch = Det_cd; dept = _Depts?.UP_DPT_CD?.Trim(); } else if (_Depts != null) { branch = ""; dept = _Depts?.DPT_CD?.Trim(); } else { branch = ""; dept = ""; } //_Depts.UP_DPT_CD = "X0000"; //Det_cd = "XQ000"; /////////////////////////////// if (DEPT_ITEM.IsNullOrWhiteSpace()) { result = TreasuryReport.getDEPT(type, _CustodyFlag, dept); } else { result = TreasuryReport.getSECT(DEPT_ITEM, type, _CustodyFlag, dept); } if (_CustodyFlag) { result.Insert(0, All); } return(Json(result)); }
/// <summary> /// 資料查詢異動作業 畫面初始 /// </summary> /// <returns></returns> public ActionResult Index() { var All = new SelectOption() { Text = "All", Value = "All" }; //var _CustodyFlag = Convert.ToBoolean(Session["CustodyFlag"]); var _CustodyFlag = AccountController.CustodianFlag; string Det_cd = new Service.Actual.Common().GetEmps()?.FirstOrDefault(x => x.USR_ID != null && x.USR_ID == AccountController.CurrentUserId)?.DPT_CD?.Trim(); var _Depts = new Service.Actual.Common().GetDepts()?.FirstOrDefault(x => x.DPT_CD?.Trim() == Det_cd); string branch = ""; string dept = ""; //_Depts.UP_DPT_CD = "XK000"; //_Depts.Dpt_type = "03"; //_Depts.DPT_CD = "VK100"; //Det_cd = "VK100"; //_CustodyFlag = false; if (_Depts != null && _Depts.Dpt_type == "04") { branch = Det_cd; dept = _Depts?.UP_DPT_CD?.Trim(); } else if (_Depts != null) { branch = ""; dept = _Depts?.DPT_CD?.Trim(); } else { branch = ""; dept = ""; } ViewBag.CustodyFlag = _CustodyFlag; ViewBag.opScope = GetopScope("~/TreasuryReport/"); var viewModel = TreasuryReport.GetItemId(_CustodyFlag, dept, branch); return(View(viewModel)); }
public JsonResult UpdateTempData(TreasuryMailTimeViewModel model) { MSGReturnModel <bool> result = new MSGReturnModel <bool>(); result.RETURN_FLAG = false; result.DESCRIPTION = Ref.MessageType.login_Time_Out.GetDescription(); if (Cache.IsSet(CacheList.TreasuryMailTimeData)) { var tempData = (List <TreasuryMailTimeViewModel>)Cache.Get(CacheList.TreasuryMailTimeData); var updateTempData = tempData.FirstOrDefault(x => x.vMAIL_TIME_ID == model.vMAIL_TIME_ID); if (updateTempData != null) { updateTempData.updateFlag = true; updateTempData.vAction = "修改"; updateTempData.vDATA_STATUS = "3"; updateTempData.vDATA_STATUS_NAME = "修改中"; updateTempData.vEXEC_TIME_B = model.vEXEC_TIME_B; //系統時間(起) updateTempData.vEXEC_TIME_E = model.vEXEC_TIME_E; //系統時間(迄) updateTempData.vSEND_TIME = model.vSEND_TIME; //發送時間 updateTempData.vINTERVAL_MIN = model.vINTERVAL_MIN; //間隔時間 updateTempData.vTREA_OPEN_TIME = model.vTREA_OPEN_TIME; //開庫時間 updateTempData.vFUNC_ID = model.vFUNC_ID; //程式編號(註解) updateTempData.vMAIL_CONTENT_ID = model.vMAIL_CONTENT_ID; //內文編號 updateTempData.vMEMO = model.vMEMO; //備註 updateTempData.vIS_DISABLED = model.vIS_DISABLED; //停用註記 var _DISABLED = new Service.Actual.Common().GetSysCode("IS_DISABLED", false); updateTempData.vIS_DISABLED_NAME = _DISABLED.FirstOrDefault(x => x.Value == model.vIS_DISABLED)?.Text; Cache.Invalidate(CacheList.TreasuryMailTimeData); Cache.Set(CacheList.TreasuryMailTimeData, tempData); result.RETURN_FLAG = true; result.DESCRIPTION = Ref.MessageType.update_Success.GetDescription(); result.Datas = true; } else { result.RETURN_FLAG = false; result.DESCRIPTION = Ref.MessageType.update_Fail.GetDescription(); } } return(Json(result)); }
public JsonResult UpdateTempData(ItemMaintainInsertViewModel model) { MSGReturnModel <string> result = new MSGReturnModel <string>(); result.RETURN_FLAG = false; result.DESCRIPTION = Ref.MessageType.login_Time_Out.GetDescription(); if (Cache.IsSet(CacheList.ItemMaintainSearchDetailViewData)) { var tempData = (List <ItemMaintainSearchDetailViewModel>)Cache.Get(CacheList.ItemMaintainSearchDetailViewData); var updateTempData = tempData.FirstOrDefault(x => x.vITEM_ID == model.vTrea_Item_Id); if (updateTempData != null) { var _TREA_ITEM_TYPE = new Service.Actual.Common().GetSysCode("TREA_ITEM_TYPE"); var _TREA_ITEM_NAME = new Service.Actual.Common().GetSysCode("TREA_ITEM_NAME"); updateTempData.vEXEC_ACTION = updateTempData.vEXEC_ACTION == "A" ? "A" : "U"; updateTempData.vEXEC_ACTION_VALUE = updateTempData.vEXEC_ACTION_VALUE == "A" ? "新增" : "修改"; updateTempData.vIS_TREA_ITEM = model.vIs_Item; updateTempData.vTREA_ITEM_TYPE = model.vType; updateTempData.vTREA_ITEM_TYPE_VALUE = !model.vType.IsNullOrWhiteSpace() ? _TREA_ITEM_TYPE.FirstOrDefault(x => x.Value == model.vType)?.Text?.Trim() : null; updateTempData.vTREA_ITEM_NAME = model.vName; updateTempData.vTREA_ITEM_NAME_VALUE = !model.vName.IsNullOrWhiteSpace() ? _TREA_ITEM_TYPE.FirstOrDefault(x => x.Value == model.vName)?.Text?.Trim() : null; updateTempData.vISDO_PERDAY = model.vIsDo_Perday; updateTempData.vIS_DISABLED = model.vIs_Disabled; updateTempData.vMEMO = model.vMemo; Cache.Invalidate(CacheList.ItemMaintainSearchDetailViewData); Cache.Set(CacheList.ItemMaintainSearchDetailViewData, tempData); result.RETURN_FLAG = true; result.DESCRIPTION = Ref.MessageType.update_Success.GetDescription(); } else { result.RETURN_FLAG = false; result.DESCRIPTION = Ref.MessageType.update_Fail.GetDescription(); } } return(Json(result)); }
public JsonResult InsertTempData(ItemMaintainInsertViewModel model) { MSGReturnModel <string> result = new MSGReturnModel <string>(); result.RETURN_FLAG = false; result.DESCRIPTION = Ref.MessageType.login_Time_Out.GetDescription(); if (Cache.IsSet(CacheList.ItemMaintainSearchDetailViewData)) { var tempData = (List <ItemMaintainSearchDetailViewModel>)Cache.Get(CacheList.ItemMaintainSearchDetailViewData); var _DATA_STATUS = new Service.Actual.Common().GetSysCode("DATA_STATUS"); var _TREA_ITEM_TYPE = new Service.Actual.Common().GetSysCode("TREA_ITEM_TYPE"); var _TREA_ITEM_NAME = new Service.Actual.Common().GetSysCode("TREA_ITEM_NAME"); var _ItemMaintainSearchDetailVM = new ItemMaintainSearchDetailViewModel() { vITEM_ID = model.vTrea_Item_Id, vITEM_OP_TYPE = model.vOp_Type, vITEM_DESC = model.vItem_Desc, vIS_TREA_ITEM = model.vIs_Item, vTREA_ITEM_TYPE = model.vType, vTREA_ITEM_TYPE_VALUE = !model.vType.IsNullOrWhiteSpace() ? _TREA_ITEM_TYPE.FirstOrDefault(x => x.Value == model.vType)?.Text?.Trim() : null, vTREA_ITEM_NAME = model.vName, vTREA_ITEM_NAME_VALUE = !model.vName.IsNullOrWhiteSpace() ? _TREA_ITEM_NAME.FirstOrDefault(x => x.Value == model.vName)?.Text?.Trim() : null, vISDO_PERDAY = model.vIsDo_Perday, vIS_DISABLED = model.vIs_Disabled, vMEMO = model.vMemo, vDATA_STATUS = "1", vDATA_STATUS_VALUE = _DATA_STATUS.FirstOrDefault(x => x.Value == "1")?.Text?.Trim(), vEXEC_ACTION = "A", vEXEC_ACTION_VALUE = "新增" }; tempData.Add(_ItemMaintainSearchDetailVM); Cache.Invalidate(CacheList.ItemMaintainSearchDetailViewData); Cache.Set(CacheList.ItemMaintainSearchDetailViewData, tempData); result.RETURN_FLAG = true; result.DESCRIPTION = Ref.MessageType.insert_Success.GetDescription(); } return(Json(result)); }