コード例 #1
0
        public List <string> searchbyname(string name)
        {
            idlist.Clear();
            List <string> anamelist = new List <string>();
            //CacheSysList list = User.ADBK.ListByName(adbksrc.conn,name);
            IRISList list = (IRISList)iris.ClassMethodIRISList("User.ADBK", "ListByName", name);

            //for (int i = 0; i < list.Count; i++)
            for (int i = 1; i < list.Count(); i++)
            {
                //reader.MoveNext();
                //string id = reader.Current.ToString().Split(' ')[0].ToString();
                if (list.Get(i).GetType() == typeof(string))
                {
                    id = list.Get(i).ToString().Split(' ')[0].ToString();
                }
                else
                {
                    id = System.Text.Encoding.ASCII.GetString((byte[])list.Get(i)).Split(' ')[0].ToString();
                }

                if (id == "no")
                {
                    break;
                }
                //string aname = reader.Current.ToString().Split(' ')[1].ToString();
                string aname = list.Get(i).ToString().Split(' ')[1].ToString();
                anamelist.Add(aname);
                idlist.Add(id);
            }
            return(anamelist);
        }
        public void RemoveAll(Expression <Func <T, bool> > predicate = null)
        {
            var items = new List <T>();

            if (predicate == null)
            {
                items = ToList();
            }
            else
            {
                items = Where(predicate).ToList();
            }

            var removedItems = new List <T>();

            foreach (var item in items)
            {
                var itemIndex = items.FindIndex(x => x.ObjectId == item.ObjectId);
                removedItems.Add(item);
            }

            items = items.Except(removedItems).ToList();
            var irisList = new IRISList();

            irisList.AddRange(items);
            _irisNative.Set(irisList, GlobalsNativeConstants.CollectionGlobals, CollectionName);
        }
コード例 #3
0
        public Boolean delete(string id)
        {
            string errormessage = "";

            if (MessageBox.Show("削除しますか", "削除", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                try
                {
                    //bool? status = User.ADBK.DeleteById(adbksrc.conn,id,ref errormessage);
                    IRISList result      = (IRISList)iris.ClassMethodIRISList("User.ADBK", "DeleteById", id);
                    int      statusvalue = (int)result.Get(1);
                    Boolean  status      = Convert.ToBoolean(statusvalue);
                    errormessage = result.Get(2).ToString();
                    if (status == false)
                    {
                        MessageBox.Show("削除エラー " + errormessage);
                        return(false);
                    }
                    return(true);
                }
                catch (Exception err)
                {
                    MessageBox.Show("削除エラー" + err.Message);
                    return(false);
                }
            }
            return(false);
        }
コード例 #4
0
        public void save(string id)
        {
            //CacheSysList adbk;
            IRISList adbk;
            string   newid        = "";
            string   errormessage = "";
            string   aparams;

            try
            {
                //adbk = new CacheSysList(Encoding.Unicode,true);
                adbk = new IRISList();
                //adbk.Add(id.ToString());
                //adbk.Add(Name.ToString());
                //adbk.Add(Street.ToString());
                //adbk.Add(City.ToString());
                //adbk.Add(ZipCode.ToString());
                //adbk.Add(dob.ToString());
                //adbk.Add(HomePhone.ToString());
                //adbk.Add(WorkPhone.ToString());

                aparams = id.ToString() + (char)(1) + Name.ToString() + (char)1 + Street.ToString();
                aparams = aparams + (char)1 + City.ToString() + (char)1 + ZipCode.ToString();
                aparams = aparams + (char)1 + dob.ToString() + (char)1 + HomePhone.ToString();
                aparams = aparams + (char)1 + WorkPhone.ToString() + (char)1 + newflag.ToString();
                //bool? status = User.ADBK.File(adbksrc.conn,adbk,newflag,ref errormessage,ref newid);
                IRISList result = (IRISList)iris.ClassMethodIRISList("User.ADBK", "FileWapper", aparams);
                errormessage = result.Get(1).ToString();
                newid        = result.Get(2).ToString();
                //if (status == false)
                //if (errormessage != "ok")
                if (errormessage != "成功")
                {
                    MessageBox.Show("更新エラー " + errormessage);
                    return;
                }

                if (newflag == true)
                {
                    //adbk = User.ADBK.GetInstanceById(adbksrc.conn, newid);
                    adbk = (IRISList)iris.ClassMethodIRISList("User.ADBK", "GetInstanceById", newid);


                    //if (adbk.Count == 1)
                    if (adbk.Count() == 1)
                    {
                        MessageBox.Show("インスタンスオープンエラー idが存在しません");
                        return;
                    }

                    updatedatamodel(adbk);
                }
            }
            catch (Exception err)
            {
                MessageBox.Show("保存エラー " + err.Message);
            }
        }
        private void Initialize()
        {
            var itemList = _irisNative.GetIRISList(GlobalsNativeConstants.CollectionGlobals, CollectionName);

            if (itemList == null)
            {
                itemList = new IRISList();
                _irisNative.Set(itemList, GlobalsNativeConstants.CollectionGlobals, CollectionName);
            }
        }
コード例 #6
0
        //public void updatedatamodel(CacheSysList adbk)
        public void updatedatamodel(IRISList adbk)
        {
            //int rs;
            //CacheSysListReader reader = (CacheSysListReader) adbk.GetEnumerator();

            //reader.MoveNext();
            //reader.MoveNext();
            //Name = reader.Current.ToString();
            Name = adbk.Get(2).ToString();

            //reader.MoveNext();
            //if (reader.Current != null) Street = reader.Current.ToString();
            //else Street = "";
            Street = adbk.Get(3).ToString();

            //reader.MoveNext();
            //if (reader.Current != null) City = reader.Current.ToString();
            //else City = "";
            City = System.Text.Encoding.ASCII.GetString((byte[])adbk.Get(4));

            //reader.MoveNext();

            //if (reader.Current != null) ZipCode = reader.Current.ToString();
            //else ZipCode = "";
            ZipCode = System.Text.Encoding.ASCII.GetString((byte[])adbk.Get(5));

            //reader.MoveNext();
            //if (reader.Current != null) dob = reader.Current.ToString();
            //else dob = "";
            dob = System.Text.Encoding.ASCII.GetString((byte[])adbk.Get(6));

            //reader.MoveNext();
            //if (reader.Current != null) HomePhone = reader.Current.ToString();
            //else HomePhone = "";
            HomePhone = System.Text.Encoding.ASCII.GetString((byte[])adbk.Get(7));

            //reader.MoveNext();
            //if (reader.Current != null) WorkPhone = reader.Current.ToString();
            //else WorkPhone = "";
            WorkPhone = System.Text.Encoding.ASCII.GetString((byte[])adbk.Get(8));


            //reader.MoveNext();
            //reader.MoveNext();
            //bool sts = int.TryParse(reader.Current.ToString(), out rs);
            Age = adbk.Get(10).ToString();

            //reader.MoveNext();
            //id = reader.Current.ToString();
            id      = System.Text.Encoding.ASCII.GetString((byte[])adbk.Get(11));
            newflag = false;
        }
        public void ImportJsonStringToGlobal(string jsonStr)
        {
            var o        = JsonConvert.DeserializeObject <JToken>(jsonStr);
            var pathList = ExtractJsonPath(jsonStr);

            foreach (var path in pathList)
            {
                object data    = (object)o.SelectToken(path);
                string dataStr = JsonConvert.SerializeObject(data);
                _irisNative.Set(dataStr, GlobalName, "Node", path);
            }

            IRISList irisList = new IRISList();

            irisList.AddRange(pathList);
            _irisNative.Set(irisList, GlobalName, "Nodes");

            _irisNative.Set(jsonStr, GlobalName, "ActualJson");
        }
コード例 #8
0
        public void searchbyid(string aid)
        {
            try
            {
                //CacheSysList adbk = User.ADBK.GetInstanceById(adbksrc.conn,id);
                IRISList adbk = (IRISList)iris.ClassMethodIRISList("User.ADBK", "GetInstanceById", aid);

                //CacheSysList adbk = User.ADBK.GetInstanceById(adbksrc.conn,id);

                //if (adbk.Count == 1)
                if (adbk.Count() == 1)
                {
                    MessageBox.Show("インスタンスオープンエラー idが存在しません");
                    return;
                }

                updatedatamodel(adbk);
            }
            catch (Exception err)
            {
                MessageBox.Show("インスタンスオープンエラー " + err.Message);
            }
        }
コード例 #9
0
        public long Execute(string command)
        {
            long status;

            status = (long)cd.Invoke("Execute", command);

            props = cd.GetIRISList("PropsData");

            if (props.Get(1) != null) 
            {
                if (props.Get(1).GetType().Name == "string")
                {
                    p0 = (string)props.Get(1);
                }
                else if (props.Get(1).GetType().Name == "Byte[]")
                {
                    p0 = System.Text.Encoding.ASCII.GetString((byte[])props.Get(1));
                }
                else
                {
                    p0 = props.Get(1).ToString();
                }
            }

            if (props.Get(2) != null)
            {
                if (props.Get(2).GetType().Name == "string")
                {
                    p1 = (string)props.Get(2);
                }
                else if (props.Get(2).GetType().Name == "Byte[]")
                {
                    p1 = System.Text.Encoding.ASCII.GetString((byte[])props.Get(2));
                }
                else
                {
                    p1 = props.Get(2).ToString();
                }
            }

            if (props.Get(3) != null)
            {
                if (props.Get(3).GetType().Name == "string")
                {
                    p2 = (string)props.Get(3);
                }
                else if (props.Get(3).GetType().Name == "Byte[]")
                {
                    p2 = System.Text.Encoding.ASCII.GetString((byte[])props.Get(3));
                }
                else
                {
                    p2 = props.Get(3).ToString();
                }
            }

            if (props.Get(4) != null)
            {
                if (props.Get(4).GetType().Name == "string")
                {
                    p3 = (string)props.Get(4);
                }
                else if (props.Get(4).GetType().Name == "Byte[]")
                {
                    p3 = System.Text.Encoding.ASCII.GetString((byte[])props.Get(4));
                }
                else
                {
                    p3 = props.Get(4).ToString();
                }
            }

            if (props.Get(5) != null)
            {
                if (props.Get(5).GetType().Name == "string")
                {
                    p4 = (string)props.Get(5);
                }
                else if (props.Get(5).GetType().Name == "Byte[]")
                {
                    p4 = System.Text.Encoding.ASCII.GetString((byte[])props.Get(5));
                }
                else
                {
                    p4 = props.Get(5).ToString();
                }
            }

            if (props.Get(6) != null)
            {
                if (props.Get(6).GetType().Name == "string")
                {
                    p5 = (string)props.Get(6);
                }
                else if (props.Get(6).GetType().Name == "Byte[]")
                {
                    p5 = System.Text.Encoding.ASCII.GetString((byte[])props.Get(6));
                }
                else
                {
                    p5 = props.Get(6).ToString();
                }
            }

            if (props.Get(7) != null)
            {
                if (props.Get(7).GetType().Name == "string")
                {
                    p6 = (string)props.Get(7);
                }
                else if (props.Get(7).GetType().Name == "Byte[]")
                {
                    p6 = System.Text.Encoding.ASCII.GetString((byte[])props.Get(7));
                }
                else
                {
                    p6 = props.Get(7).ToString();
                }
            }

            if (props.Get(8) != null)
            {
                if (props.Get(8).GetType().Name == "string")
                {
                    p7 = (string)props.Get(8);
                }
                else if (props.Get(8).GetType().Name == "Byte[]")
                {
                    p7 = System.Text.Encoding.ASCII.GetString((byte[])props.Get(8));
                }
                else
                {
                    p7 = props.Get(8).ToString();
                }
            }

            if (props.Get(9) != null)
            {
                if (props.Get(9).GetType().Name == "string")
                {
                    p8 = (string)props.Get(9);
                }
                else if (props.Get(9).GetType().Name == "Byte[]")
                {
                    p8 = System.Text.Encoding.ASCII.GetString((byte[])props.Get(9));
                }
                else
                {
                    p8 = props.Get(9).ToString();
                }
            }

            if (props.Get(10) != null)
            {
                if (props.Get(10).GetType().Name == "string")
                {
                    p9 = (string)props.Get(10);
                }
                else if (props.Get(10).GetType().Name == "Byte[]")
                {
                    p9 = System.Text.Encoding.ASCII.GetString((byte[])props.Get(10));
                }
                else
                {
                    p9 = props.Get(10).ToString();
                }
            }

            if (props.Get(11) != null)
            {
                if (props.Get(11).GetType().Name == "string")
                {
                    plist = (string)props.Get(11);
                }
                else if (props.Get(11).GetType().Name == "Byte[]")
                {
                    plist = System.Text.Encoding.ASCII.GetString((byte[])props.Get(11));
                }
                else
                {
                    plist = props.Get(11).ToString();
                }
            }

            if (props.Get(12) != null)
            {
                if (props.Get(12).GetType().Name == "string")
                {
                    pdelim = (string)props.Get(12);
                }
                else if (props.Get(12).GetType().Name == "Byte[]")
                {
                    pdelim = System.Text.Encoding.ASCII.GetString((byte[])props.Get(12));
                }
                else
                {
                    pdelim = props.Get(12).ToString();
                }
            }

            if (props.Get(13) != null)
            {
                if (props.Get(13).GetType().Name == "string")
                {
                    value = (string)props.Get(13);
                }
                else if (props.Get(13).GetType().Name == "Byte[]")
                {
                    value = System.Text.Encoding.ASCII.GetString((byte[])props.Get(13));
                }
                else
                {
                    value = props.Get(13).ToString();
                }
            }

            if (props.Get(14) != null)
            {
                error = (int)props.Get(14);
            }

            if (props.Get(15) != null)
            {
                if (props.Get(15).GetType().Name == "string")
                {
                    errorname = (string)props.Get(15);
                }
                else if (props.Get(15).GetType().Name == "Byte[]")
                {
                    errorname = System.Text.Encoding.ASCII.GetString((byte[])props.Get(15));
                }
                else
                {
                    errorname = props.Get(15).ToString();
                }
            }

            if (error == 1)
            {
                OnError();
            }

            Executed();

            return status;
        }