コード例 #1
0
        internal Result GetAttachTable(int typecode, string typeid, enumShowType attachtype)
        {
            Result r = null;

            if (_remote != null)
            {
                #region Preparing Calling Parameters
                object[] param = new object[] { typecode, typeid, (int)attachtype };
                #endregion
                #region Call Server Function
                r = _remote.Connection.Call(
                    _remote.User.UserNo
                    , CONST_FILEID
                    , 103101
                    , _tableprivselect
                    , param
                    );
                #endregion
            }
            return(r);
        }
コード例 #2
0
        public void ShowGallary(enumShowType type)
        {
            Result r = null;

            if (type == 0)
            {
                r = GetAttachImages();
            }
            else
            {
                r = GetAttachTable(type);
            }

            if (r.ResultNo == 0)
            {
                gridControl1.DataSource = null;
                gridControl1.DataSource = r.Data.Tables[0];
                FormUtility.SetFormatGrid(ref gridView1, false);
                SetColumnCaption();

                #region Clear Gallary List

                galleryControl1.SuspendLayout();
                DevExpress.XtraBars.Ribbon.GalleryItemGroup group = galleryControl1.Gallery.Groups[0];
                group.Items.Clear();

                #endregion
                #region Insert Gallary List

                foreach (DataRow row in r.Data.Tables[0].Rows)
                {
                    string   filename   = Convert.ToString(row["filename"]);
                    DateTime attachdate = ISM.Lib.Static.ToDate(row["attachdate"]);
                    int      attachtype = ISM.Lib.Static.ToInt(row["attachtype"]);
                    int      userno     = ISM.Lib.Static.ToInt(row["userno"]);
                    ulong    attachid   = ISM.Lib.Static.ToULong(row["attachid"]);
                    long     attachsize = ISM.Lib.Static.ToLong(row["attachsize"]);
                    string   attachdesc = Convert.ToString(row["description"]);

                    Image  image = null;
                    object blob  = null;
                    if (type == 0)
                    {
                        blob = row["attachblob"];
                    }
                    if (blob != null && blob != DBNull.Value)
                    {
                        image = ISM.Lib.Static.ImageFromByte((byte[])blob);
                    }
                    else
                    {
                        image = ISM.Lib.Static.ImageResize(ISM.Lib.Static.ImageFileExt(filename), 64, 64);
                    }

                    InsertGallary(filename, attachid, attachsize, (int)type, attachdate, attachdesc, userno, image);
                }
                galleryControl1.ResumeLayout();
                galleryControl1.Refresh();

                #endregion
            }
        }
コード例 #3
0
 internal Result GetAttachTable(enumShowType attachtype)
 {
     return(GetAttachTable(_typecode, _typeid, attachtype));
 }