示例#1
0
        /// <summary>
        /// Generate installation type stockout combobox
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="id"></param>
        /// <param name="attribute"></param>
        /// <returns></returns>
        public static MvcHtmlString InstallationTypeStockOutComboBox(this HtmlHelper helper, string id, object attribute = null)
        {
            List <tbs_MiscellaneousTypeCode> list = new List <tbs_MiscellaneousTypeCode>();

            try
            {
                IMasterHandler handler = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler;

                List <tbs_MiscellaneousTypeCode> lstRentalInstall = new List <tbs_MiscellaneousTypeCode>();
                List <tbs_MiscellaneousTypeCode> lstSaleInstall   = new List <tbs_MiscellaneousTypeCode>();
                lstRentalInstall = handler.GetTbs_MiscellaneousTypeCode(MiscType.C_RENTAL_INSTALL_TYPE);
                lstSaleInstall   = handler.GetTbs_MiscellaneousTypeCode(MiscType.C_SALE_INSTALL_TYPE);

                var arrValueCodeRetal = new string[] {
                    RentalInstallationType.C_RENTAL_INSTALL_TYPE_NEW,
                    RentalInstallationType.C_RENTAL_INSTALL_TYPE_CHANGEPLAN_NEW,
                    RentalInstallationType.C_RENTAL_INSTALL_TYPE_CHANGEPLAN_AFTER_NEW,
                    RentalInstallationType.C_RENTAL_INSTALL_TYPE_MAINTENANCE_EXCHANGE,
                    RentalInstallationType.C_RENTAL_INSTALL_TYPE_PERIODICAL_MAINTENANCE
                };

                var arrValueCodeSale = new string[] {
                    SaleInstallationType.C_SALE_INSTALL_TYPE_NEW,
                    SaleInstallationType.C_SALE_INSTALL_TYPE_ADD,
                    SaleInstallationType.C_SALE_INSTALL_TYPE_MAINTENANCE_EXCHANGE
                };

                list.AddRange(
                    (
                        from t in lstRentalInstall
                        where arrValueCodeRetal.Contains(t.ValueCode)
                        select t
                    )
                    .Union(
                        from t in lstSaleInstall
                        where arrValueCodeSale.Contains(t.ValueCode)
                        select t
                        )
                    );
            }
            catch
            {
                list = new List <tbs_MiscellaneousTypeCode>();
            }

            CommonUtil.MappingObjectLanguage <tbs_MiscellaneousTypeCode>(list);
            return(CommonUtil.CommonComboBox <tbs_MiscellaneousTypeCode>(id, list, "ValueDisplay", "ValueCode", attribute, true, CommonUtil.eFirstElementType.All));
        }
示例#2
0
        /// <summary>
        /// Get destination location
        /// </summary>
        /// <returns></returns>
        public string IVS100_GetDestinationLocation()
        {
            ObjectResultData res = new ObjectResultData();
            List <tbs_MiscellaneousTypeCode> list    = new List <tbs_MiscellaneousTypeCode>();
            List <tbs_MiscellaneousTypeCode> ResMisc = new List <tbs_MiscellaneousTypeCode>();

            try
            {
                IMasterHandler handler = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler;
                list = handler.GetTbs_MiscellaneousTypeCode(MiscType.C_INV_LOC);

                CommonUtil.MappingObjectLanguage <tbs_MiscellaneousTypeCode>(list);

                ResMisc = (from c in list
                           where (c.ValueCode == InstrumentLocation.C_INV_LOC_REPAIR_REQUEST)
                           select c).ToList <tbs_MiscellaneousTypeCode>();

                if (ResMisc != null && ResMisc.Count > 0)
                {
                    return(ResMisc[0].ValueDisplay);
                }
                else
                {
                    return(string.Empty);
                }
            }
            catch (Exception)
            {
                return(string.Empty);
            }
        }
示例#3
0
        /// <summary>
        /// Get location
        /// </summary>
        /// <returns></returns>
        public tbs_MiscellaneousTypeCode IVS210_GetLocation()
        {
            ObjectResultData res = new ObjectResultData();
            List <tbs_MiscellaneousTypeCode> list    = new List <tbs_MiscellaneousTypeCode>();
            List <tbs_MiscellaneousTypeCode> ResMisc = new List <tbs_MiscellaneousTypeCode>();

            try
            {
                IMasterHandler handler = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler;
                list = handler.GetTbs_MiscellaneousTypeCode(MiscType.C_INV_LOC);

                CommonUtil.MappingObjectLanguage <tbs_MiscellaneousTypeCode>(list);

                ResMisc = (from c in list
                           where (c.ValueCode == InstrumentLocation.C_INV_LOC_INSTOCK)
                           select c).ToList <tbs_MiscellaneousTypeCode>();

                if (ResMisc != null && ResMisc.Count > 0)
                {
                    return(ResMisc[0]);
                }
                else
                {
                    return(new tbs_MiscellaneousTypeCode());
                }
            }
            catch (Exception)
            {
                return(new tbs_MiscellaneousTypeCode());
            }
        }
示例#4
0
        public static MvcHtmlString InstallBuiildingType(this HtmlHelper helper, string id, object attribute = null)
        {
            List <tbs_MiscellaneousTypeCode> list = new List <tbs_MiscellaneousTypeCode>();
            string strDisplayName = "ValueDisplayEN";

            try
            {
                IMasterHandler handler = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler;
                list = handler.GetTbs_MiscellaneousTypeCode(MiscType.C_BUILDING_TYPE);

                if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_EN)
                {
                    strDisplayName = "ValueDisplayEN";
                }
                else if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_JP)
                {
                    strDisplayName = "ValueDisplayJP";
                }
                else
                {
                    strDisplayName = "ValueDisplayLC";
                }
            }
            catch
            {
                list = new List <tbs_MiscellaneousTypeCode>();
            }

            return(CommonUtil.CommonComboBox <tbs_MiscellaneousTypeCode>(id, list, strDisplayName, "ValueCode", attribute, true, CommonUtil.eFirstElementType.All));
        }
示例#5
0
        public static MvcHtmlString InstallTypeCboStatus(this HtmlHelper helper, string id, object attribute = null)
        {
            List <tbs_MiscellaneousTypeCode> list = new List <tbs_MiscellaneousTypeCode>();
            string strDisplayName = "ValueDisplayEN";

            try
            {
                IMasterHandler handler = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler;
                list = handler.GetTbs_MiscellaneousTypeCode("InstallationStatus");

                list = (from x in list
                        where x.ValueCode.Equals("04") || x.ValueCode.Equals("05")
                        select x).ToList();


                if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_EN)
                {
                    strDisplayName = "ValueDisplayEN";
                }
                else if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_JP)
                {
                    strDisplayName = "ValueDisplayJP";
                }
                else
                {
                    strDisplayName = "ValueDisplayLC";
                }
            }
            catch
            {
                list = new List <tbs_MiscellaneousTypeCode>();
            }

            return(CommonUtil.CommonComboBox <tbs_MiscellaneousTypeCode>(id, list, strDisplayName, "ValueCode", attribute, false));
        }
示例#6
0
        public static MvcHtmlString InstallReportTypeCbo(this HtmlHelper helper, string id, string firstElement, object attribute = null)
        {
            List <tbs_MiscellaneousTypeCode> list = new List <tbs_MiscellaneousTypeCode>();
            string strDisplayName = "ValueDisplayEN";

            try
            {
                IMasterHandler handler = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler;
                list = handler.GetTbs_MiscellaneousTypeCode("InstallationReportType");

                if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_EN)
                {
                    strDisplayName = "ValueDisplayEN";
                }
                else if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_JP)
                {
                    strDisplayName = "ValueDisplayJP";
                }
                else
                {
                    strDisplayName = "ValueDisplayLC";
                }
            }
            catch
            {
                list = new List <tbs_MiscellaneousTypeCode>();
            }
            return(CommonUtil.CommonComboBoxWithCustomFirstElement <tbs_MiscellaneousTypeCode>(id, list, strDisplayName, "ValueCode", firstElement, attribute));
        }
示例#7
0
        /// <summary>
        /// Generate IE evaluation combobox
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="id"></param>
        /// <param name="attribute"></param>
        /// <returns></returns>
        public static MvcHtmlString IEEvaluationComboBox(this HtmlHelper helper, string id, object attribute = null)
        {
            List <tbs_MiscellaneousTypeCode> list = new List <tbs_MiscellaneousTypeCode>();
            string strDisplayName = "ValueDisplayEN";

            try
            {
                IMasterHandler handler = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler;
                list = handler.GetTbs_MiscellaneousTypeCode(MiscType.C_INSTALL_IE_EVALUATION);

                if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_EN)
                {
                    strDisplayName = "ValueDisplayEN";
                }
                else if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_JP)
                {
                    strDisplayName = "ValueDisplayJP";
                }
                else
                {
                    strDisplayName = "ValueDisplayLC";
                }
            }
            catch
            {
                list = new List <tbs_MiscellaneousTypeCode>();
            }

            return(CommonUtil.CommonComboBox <tbs_MiscellaneousTypeCode>(id, list, strDisplayName, "ValueCode", attribute));
        }
示例#8
0
        /// <summary>
        /// Generate stockout type combobox
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="id"></param>
        /// <param name="attribute"></param>
        /// <returns></returns>
        public static MvcHtmlString StockOutTypeComboBox(this HtmlHelper helper, string id, object attribute = null)
        {
            List <tbs_MiscellaneousTypeCode> list = new List <tbs_MiscellaneousTypeCode>();

            //string strDisplayName = "ValueDisplayEN";
            try
            {
                IMasterHandler handler = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler;
                list = handler.GetTbs_MiscellaneousTypeCode(MiscType.C_STOCK_OUT_TYPE);
                CommonUtil.MappingObjectLanguage <tbs_MiscellaneousTypeCode>(list);
                //if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_EN)
                //{
                //    strDisplayName = "ValueDisplayEN";
                //}
                //else if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_JP)
                //{
                //    strDisplayName = "ValueDisplayJP";
                //}
                //else
                //{
                //    strDisplayName = "ValueDisplayLC";
                //}
            }
            catch
            {
                list = new List <tbs_MiscellaneousTypeCode>();
            }

            return(CommonUtil.CommonComboBox <tbs_MiscellaneousTypeCode>(id, list, "ValueCodeDisplay", "ValueCode", attribute));
        }
示例#9
0
        /// <summary>
        /// Generate installation type combobox
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="id"></param>
        /// <param name="attribute"></param>
        /// <returns></returns>
        public static MvcHtmlString InstallationTypeComboBox(this HtmlHelper helper, string id, string InstallType, object attribute = null)
        {
            List <tbs_MiscellaneousTypeCode> list = new List <tbs_MiscellaneousTypeCode>();
            string strDisplayName = "ValueDisplayEN";

            try
            {
                IMasterHandler handler = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler;
                list = handler.GetTbs_MiscellaneousTypeCode(InstallType);
            }
            catch
            {
                list = new List <tbs_MiscellaneousTypeCode>();
            }

            return(CommonUtil.CommonComboBox <tbs_MiscellaneousTypeCode>(id, list, "ValueDisplay", "ValueCode", attribute));
        }
示例#10
0
        /// <summary>
        /// Check screen authority and permission
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public ActionResult CTS030_Authority(CTS030_ScreenParameter param)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                #region Check Permission

                IApprovalPermissionHandler handler = ServiceContainer.GetService <IApprovalPermissionHandler>() as IApprovalPermissionHandler;

                //bool bIsPermitted = handler.isPermittedIPAddress();
                bool bIsPermitted = isPermittedIPAddress();
                if (!bIsPermitted || !CheckUserPermission(ScreenID.C_SCREEN_ID_SEARCH_APPROVE, FunctionID.C_FUNC_ID_OPERATE))
                {
                    res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0053);
                    return(Json(res));
                }

                #endregion
                #region Check is Suspending

                ICommonHandler chandler = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                if (chandler.IsSystemSuspending())
                {
                    res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0049);
                    return(Json(res));
                }

                #endregion
                #region Get approval status misc

                IMasterHandler mHand = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler;
                List <tbs_MiscellaneousTypeCode> appvList = mHand.GetTbs_MiscellaneousTypeCode(MiscType.C_APPROVE_STATUS);
                CommonUtil.MappingObjectLanguage <tbs_MiscellaneousTypeCode>(appvList);
                param.approvalStatus = appvList;

                #endregion
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            return(InitialScreenEnvironment <CTS030_ScreenParameter>("CTS030", param, res));
        }
示例#11
0
        /// <summary>
        /// Generate change requester code combobox
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="id"></param>
        /// <param name="attribute"></param>
        /// <returns></returns>
        public static MvcHtmlString ChangeRequesterCodeComboBox(this HtmlHelper helper, string id, object attribute = null)
        {
            List <tbs_MiscellaneousTypeCode> list = new List <tbs_MiscellaneousTypeCode>();
            string strDisplayName = "ValueDisplayEN";

            try
            {
                IMasterHandler handler = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler;
                list = handler.GetTbs_MiscellaneousTypeCode(MiscType.C_INSTALL_BEFORE_CHANGE_REQUESTER);

                foreach (var item in list)
                {
                    item.ValueDisplayEN = CommonUtil.TextCodeName(item.ValueCode, item.ValueDisplayEN);
                    item.ValueDisplayJP = CommonUtil.TextCodeName(item.ValueCode, item.ValueDisplayJP);
                    item.ValueDisplayLC = CommonUtil.TextCodeName(item.ValueCode, item.ValueDisplayLC);
                }

                if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_EN)
                {
                    strDisplayName = "ValueDisplayEN";
                }
                else if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_JP)
                {
                    strDisplayName = "ValueDisplayJP";
                }
                else
                {
                    strDisplayName = "ValueDisplayLC";
                }
            }
            catch
            {
                list = new List <tbs_MiscellaneousTypeCode>();
            }

            return(CommonUtil.CommonComboBox <tbs_MiscellaneousTypeCode>(id, list, strDisplayName, "ValueCode", attribute));
        }