/// <summary> /// Get project data for view /// </summary> /// <param name="strProjectCode"></param> /// <returns></returns> public ActionResult CTS260_GetProjectForView(string strProjectCode) { ObjectResultData res = new ObjectResultData(); if (CommonUtil.IsNullOrEmpty(strProjectCode)) { res.AddErrorMessage(MessageUtil.MODULE_CONTRACT, "CTS260", MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0007, new string[] { "lblProjectCode" }, new string[] { "ProjectCode" }); res.MessageType = MessageModel.MESSAGE_TYPE.WARNING; return(Json(res)); } IProjectHandler Projh = ServiceContainer.GetService <IProjectHandler>() as IProjectHandler; List <doTbt_Project> lstProject = Projh.GetTbt_ProjectForView(strProjectCode); if (lstProject.Count <= 0) { res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0091, new string[] { strProjectCode }, new string[] { "ProjectCode" }); return(Json(res)); } else { //CommonUtil.dsTransData.dtCommonSearch.ProjectCode = strProjectCode; CommonUtil comUtil = new CommonUtil(); //CommonUtil.dsTransData.dtCommonSearch.ProjectCode = comUtil.ConvertProjectCode(lstProject[0].ProjectCode,CommonUtil.CONVERT_TYPE.TO_SHORT); //CommonUtil.dsTransData.dtCommonSearch.ContractCode = null; CTS260_ScreenParameter param = GetScreenObject <CTS260_ScreenParameter>(); param.CommonSearch = new ScreenParameter.CommonSearchDo() { ProjectCode = comUtil.ConvertProjectCode(lstProject[0].ProjectCode, CommonUtil.CONVERT_TYPE.TO_SHORT) }; } EmployeeMappingList emlst = new EmployeeMappingList(); emlst.AddEmployee(lstProject.ToArray()); IEmployeeMasterHandler Emph = ServiceContainer.GetService <IEmployeeMasterHandler>() as IEmployeeMasterHandler; Emph.EmployeeListMapping(emlst); MiscTypeMappingList miscMapList = new MiscTypeMappingList(); miscMapList.AddMiscType(lstProject.ToArray()); ICommonHandler comh = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler; comh.MiscTypeMappingList(miscMapList); return(Json(lstProject)); }
/// <summary> /// Authority screen CTS260 /// </summary> /// <param name="param"></param> /// <returns></returns> public ActionResult CTS260_Authority(CTS260_ScreenParameter param) { ObjectResultData res = new ObjectResultData(); try { if (!CheckUserPermission(ScreenID.C_SCREEN_ID_PROJ_VIEW)) { res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0053); return(Json(res)); } //Valid Cond //if (CommonUtil.IsNullOrEmpty(param.strProjectCode)) //{ // if (!CommonUtil.IsNullOrEmpty(CommonUtil.dsTransData.dtCommonSearch.ProjectCode)) // { // param.strProjectCode = CommonUtil.dsTransData.dtCommonSearch.ProjectCode; // } //} if (param.CommonSearch != null) { if (CommonUtil.IsNullOrEmpty(param.CommonSearch.ProjectCode) == false) { param.strProjectCode = param.CommonSearch.ProjectCode; } } //ValidatorUtil.BuildErrorMessage(res, this, null); //if (res.IsError) //{ // res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION; // return Json(res); //} //if (CommonUtil.IsNullOrEmpty(param.strProjectCode)) //{ // res.AddErrorMessage(MessageUtil.MODULE_CONTRACT, MessageUtil.MessageList.MSG3216, new string[] { "lblProjectCode" }); // return Json(res); //} //IProjectHandler Projh = ServiceContainer.GetService<IProjectHandler>() as IProjectHandler; //List<doTbt_Project> lstProject = Projh.GetTbt_ProjectForView(param.strProjectCode); //if (lstProject.Count <= 0) //{ // res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0091, new string[] { param.strProjectCode }); // return Json(res); //} if (CommonUtil.IsNullOrEmpty(param.strProjectCode) == false) { IProjectHandler projH = ServiceContainer.GetService <IProjectHandler>() as IProjectHandler; List <doTbt_Project> doTbt_Project = projH.GetTbt_ProjectForView(param.strProjectCode); if (doTbt_Project.Count <= 0) { res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0091, new string[] { param.strProjectCode }); return(Json(res)); } } // param.strProjectCode = "p0000132"; } catch (Exception ex) { res.AddErrorMessage(ex); } return(InitialScreenEnvironment <CTS260_ScreenParameter>("CTS260", param, res)); }