Exemple #1
0
        public static string ToNewMapnumber25W(string oldMapnumber25W)
        {
            if (!OldMapnumberCheck.Check25W(oldMapnumber25W))
            {
                return("");
            }
            var temp    = oldMapnumber25W.Split('-');
            var new100  = temp[0] + temp[1].PadLeft(2, '0');
            var sub25W  = temp[2];
            var subTemp = sub25W.Split(new char[] { '[', ']' }, StringSplitOptions.RemoveEmptyEntries);

            if (!int.TryParse(subTemp[0], out int x))
            {
                return("");
            }
            var new25R = ToNew25WRow(x);
            var new25C = ToNew25WColumn(x);

            return(new100 + "C" + new25R.ToString().PadLeft(3, '0') + new25C.ToString().PadLeft(3, '0'));
        }
Exemple #2
0
        public static string ToOldMapnumber25W(string oldMapnumber25W)
        {
            if (string.IsNullOrEmpty(oldMapnumber25W))
            {
                return("");
            }
            if (OldMapnumberCheck.Check25W(oldMapnumber25W))
            {
                return(oldMapnumber25W);
            }

            oldMapnumber25W = ChangeOldMapnumberChar(oldMapnumber25W);
            if (!oldMapnumber25W.Contains("-"))
            {
                return("");
            }
            var split  = oldMapnumber25W.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries);
            var length = split.Length;

            if (length != 3)
            {
                return("");
            }
            var x100 = split[0] + "-" + split[1];
            var s100 = ToOldMapnumber100W(x100);

            if (string.IsNullOrEmpty(s100) || !int.TryParse(split[2], out int x25))
            {
                return("");
            }
            var s25 = x25.ToString("00");

            oldMapnumber25W = s100 + "-[" + s25 + "]";
            if (OldMapnumberCheck.Check25W(oldMapnumber25W))
            {
                return(oldMapnumber25W);
            }
            return("");
        }