Exemplo n.º 1
0
 /// <summary>
 /// 调用ib.av读取av服务
 /// </summary>
 /// <param name="avcmd"></param>
 /// <returns></returns>
 string av(string avcmd)
 {
     try
     {
         string[]     array = getArray(avcmd);
         ibeInterface ib    = new ibeInterface();
         string       time  = getIbeDate(array[1]) + " 00:00:00";
         avreturn = ib.av(array[0], time, array[2], (array[3] == "1"), true);
         return(pn(1));
     }
     catch
     {
         return("");
     }
 }
Exemplo n.º 2
0
        public string ss(string sscmd)
        {
            string[] cmdary = sscmd.Split('~');
            bool     bnm    = false;
            bool     bct    = false;
            bool     bss    = false;
            bool     btk    = false;
            bool     bfk    = false;

            string[]      fns = null;
            List <string> fnl = new List <string>();

            string[]      acs = null;
            List <string> acl = new List <string>();

            string[]      fds = null;
            List <string> fdl = new List <string>();

            string[]      ocs = null;
            List <string> ocl = new List <string>();

            string[]      dcs = null;
            List <string> dcl = new List <string>();

            string[]      bks = null;
            List <string> bkl = new List <string>();

            string[] nms = null;
            string   ld  = "";

            string[]      cis = null;
            List <string> cil = new List <string>();

            for (int i = 0; i < cmdary.Length; i++)
            {
                switch (cmdary[i].ToLower())
                {
                case "i":
                    break;

                case "ig":
                    break;

                default:
                    string[] bookcmd = cmdary[i].Split('\r');
                    for (int j = 0; j < bookcmd.Length; j++)
                    {
                        string c = bookcmd[j].ToUpper();
                        if (c.Length >= 2 && c.Substring(0, 2) == "NM")
                        {
                            bnm = true;
                            nms = c.Substring(3).Split('~');
                        }
                        else if (c.Length >= 2 && (c.Substring(0, 2) == "CT" || c.Substring(0, 2) == "C:"))
                        {
                            bct = true;
                        }
                        else if (c.Length >= 3 && c.Substring(0, 3) == "SSR")
                        {
                        }
                        else if (c.Length >= 3 && c.Substring(0, 3) == "SS:")
                        {
                            bss = true;
                            string[] seginfo = c.Substring(3).Split('/');
                            fnl.Add(seginfo[0]);
                            bkl.Add(seginfo[1]);
                            fdl.Add(DateTime.ParseExact
                                        (seginfo[2], "ddMMM", ibeInterface.gbDtfi).
                                    ToString("yyyy-MM-dd", ibeInterface.gbDtfi));
                            ocl.Add(seginfo[3].Substring(0, 3));
                            dcl.Add(seginfo[3].Substring(3));
                            acl.Add("LL");
                        }
                        else if (c.Length >= 4 && c.Substring(0, 4) == "TKTL")
                        {
                            btk = true;
                            string tkinfo = c.Substring(4);
                            System.Globalization.DateTimeFormatInfo myDTFI
                                   = new System.Globalization.CultureInfo("en-us", false).DateTimeFormat;
                            tkinfo = tkinfo.Replace(".", DateTime.Now.ToString("ddMMM", myDTFI));
                            tkinfo = tkinfo.Replace("-", DateTime.Now.AddDays(-1).ToString("ddMMM", myDTFI));
                            tkinfo = tkinfo.Replace("+", DateTime.Now.AddDays(1).ToString("ddMMM", myDTFI));
                            string time = tkinfo.Split('/')[0];
                            string date = tkinfo.Split('/')[1];
                            while (time.Length < 4)
                            {
                                time = "0" + time;
                            }
                            while (date.Length < 5)
                            {
                                date = "0" + date;
                            }
                            DateTime dt = DateTime.ParseExact(time + date, "HHmmddMMM", myDTFI);
                            ld = dt.ToString();
                        }
                        else if (c.Length >= 1 && (c.Substring(0, 1) == "@" || c.Substring(0, 1) == "\\"))
                        {
                            bfk = true;
                        }
                        else
                        {
                            throw new Exception("非预定指令");
                        }
                    }
                    break;
                }
            }
            if (bct && bfk && btk && bss && bnm)
            {
                ibeInterface ib  = new ibeInterface();
                string       ret = ib.ss(fnl.ToArray(), acl.ToArray(), fdl.ToArray(), ocl.ToArray(), dcl.ToArray(), bkl.ToArray(), nms, ld, null, null);
                if (ret.Length != 5)
                {
                    throw new Exception("预定发生错误");
                }
                return(ret);
            }
            throw new Exception("非预定指令");
        }