Exemplo n.º 1
0
        public static string GetHinbanForKibiroi(Symbol symbol, List <LightSerialItem> lightSerialItems, string hinban)
        {
            if (!symbol.IsLight)
            {
                return(string.Empty);
            }

            var light       = new Light(symbol);
            var lightSerial = FindLightSerialWithSetteigai(hinban);

            if (lightSerial == null)
            {
                return(string.Empty);
            }

            //PLS,MLS,LLSはLightSerialItemテーブルに対応させていない
            if (hinban.Contains(Const.LightSerial.PLS) ||
                hinban.Contains(Const.LightSerial.MLS) ||
                hinban.Contains(Const.LightSerial.LLS))
            {
                return(GetHinban(symbol, hinban));
            }

            var item = lightSerialItems.Find(p => hinban == p.Serial && light.RoomName.Contains(p.Room));

            if (item == null)
            {
                return(string.Empty);
            }

            //新商品対象の場合置換
            var serial = LightSerialConverter.ConvertIrisohyamaLightSerial(Static.ConstructionCode, item.ItemName);

            if (!string.IsNullOrEmpty(serial))
            {
                return(serial);
            }

            //ブラケット新商品
            serial = LightSerialConverter.ConvertBracketSerial(Static.ConstructionCode, item.ItemName);
            if (!string.IsNullOrEmpty(serial))
            {
                return(serial);
            }

            if (NeedToAddVersionForHinban(lightSerial, symbol))
            {
                if (item.ItemName.StartsWith("L-"))
                {
                    var s      = item.ItemName.Split('-');
                    var result = s[1];

                    if (symbol.IsOutdoor)
                    {
                        result = "W" + result;
                    }

                    result = s[0] + "-" + result + "(P1)";

                    if (result == Const.LightSerial.WLNP1)
                    {
                        return(Const.LightSerial.WLLP1);
                    }

                    if (result == Const.LightSerial.WMNP1)
                    {
                        return(Const.LightSerial.WMLP1);
                    }

                    if (result == Const.LightSerial.L_WLNP1)
                    {
                        return(Const.LightSerial.L_WLLP1);
                    }

                    if (result == Const.LightSerial.L_WMNP1)
                    {
                        return(Const.LightSerial.L_WMLP1);
                    }

                    return(result);
                }
                else // K品番
                {
                    return(item.ItemName.Replace(item.Serial, item.Serial + "(P1)"));
                }
            }

            return(item.ItemName);
        }
Exemplo n.º 2
0
        public static string GetHinban(Symbol symbol, string hinban)
        {
            if (!symbol.IsLight)
            {
                return(string.Empty);
            }

            var light       = new Light(symbol);
            var lightSerial = FindLightSerial(hinban);

            if (lightSerial == null)
            {
                return(string.Empty);
            }

            //新商品対象の場合置換
            var serial = LightSerialConverter.ConvertIrisohyamaLightSerial(Static.ConstructionCode, hinban);

            if (!string.IsNullOrEmpty(serial))
            {
                return(serial);
            }

            //ブラケット新商品
            serial = LightSerialConverter.ConvertBracketSerial(Static.ConstructionCode, hinban);
            if (!string.IsNullOrEmpty(serial))
            {
                return(serial);
            }

            if (NeedToAddVersionForHinban(lightSerial, symbol))
            {
                if (hinban.StartsWith("K") || hinban == Const.LightSerial.PLS)
                {
                    return(hinban.Replace(hinban, hinban + "(P1)"));
                }
                else
                {
                    var result = hinban;

                    if (symbol.IsOutdoor)
                    {
                        result = "W" + result;
                    }

                    if (hinban == Const.LightSerial.MLS || hinban == Const.LightSerial.LLS)
                    {
                        result = result + "(K1)";
                    }
                    else
                    {
                        result = result + "(P1)";
                    }

                    if (result == Const.LightSerial.WLNP1)
                    {
                        return(Const.LightSerial.WLLP1);
                    }

                    if (result == Const.LightSerial.WMNP1)
                    {
                        return(Const.LightSerial.WMLP1);
                    }

                    if (result == Const.LightSerial.L_WLNP1)
                    {
                        return(Const.LightSerial.L_WLLP1);
                    }

                    if (result == Const.LightSerial.L_WMNP1)
                    {
                        return(Const.LightSerial.L_WMLP1);
                    }

                    return(result);
                }
            }

            return(hinban);
        }