Exemplo n.º 1
0
        /// <summary>
        /// Get office name by code
        /// </summary>
        /// <param name="ValueCode"></param>
        /// <returns></returns>
        public ActionResult ISS080_GetOfficeNameByCode(string ValueCode)
        {
            ObjectResultData res = new ObjectResultData();

            List <dtOffice> list = new List <dtOffice>();
            string          lang = CommonUtil.GetCurrentLanguage();

            try
            {
                IOfficeMasterHandler OMHandler = ServiceContainer.GetService <IOfficeMasterHandler>() as IOfficeMasterHandler;

                list = OMHandler.GetFunctionLogistic();

                foreach (var item in list)
                {
                    if (ValueCode == item.OfficeCode)
                    {
                        if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_EN)
                        {
                            item.OfficeNameEN = CommonUtil.TextCodeName(item.OfficeCode, item.OfficeNameEN);
                            res.ResultData    = item.OfficeNameEN;
                        }
                        else if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_JP)
                        {
                            item.OfficeNameJP = CommonUtil.TextCodeName(item.OfficeCode, item.OfficeNameJP);
                            res.ResultData    = item.OfficeNameJP;
                        }
                        else
                        {
                            item.OfficeNameLC = CommonUtil.TextCodeName(item.OfficeCode, item.OfficeNameLC);
                            res.ResultData    = item.OfficeNameLC;
                        }
                    }
                }

                return(Json(res));
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
                return(Json(res));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Generate install slip output target combobox
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="id"></param>
        /// <param name="attribute"></param>
        /// <returns></returns>
        public static MvcHtmlString InstallSlipOutputTargetComboBox(this HtmlHelper helper, string id, object attribute = null)
        {
            List <dtOffice> list = new List <dtOffice>();
            dtOffice        test = new dtOffice();

            string strDisplayName = "OfficeNameEN";

            try
            {
                IOfficeMasterHandler OMHandler = ServiceContainer.GetService <IOfficeMasterHandler>() as IOfficeMasterHandler;

                list = OMHandler.GetFunctionLogistic();

                foreach (var item in list)
                {
                    item.OfficeNameEN = CommonUtil.TextCodeName(item.OfficeCode, item.OfficeNameEN);
                    item.OfficeNameJP = CommonUtil.TextCodeName(item.OfficeCode, item.OfficeNameJP);
                    item.OfficeNameLC = CommonUtil.TextCodeName(item.OfficeCode, item.OfficeNameLC);
                }

                if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_EN)
                {
                    strDisplayName = "OfficeNameEN";
                }
                else if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_JP)
                {
                    strDisplayName = "OfficeNameJP";
                }
                else
                {
                    strDisplayName = "OfficeNameLC";
                }
            }
            catch
            {
                list = new List <dtOffice>();
            }

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