Beispiel #1
0
        public Core()
        {
            try
            {
                resource = new InfoPos.Resource();
                moRemote = new ISM.CUser.Remote();

                _xmlcachename = string.Format(@"{0}\Data\Settings.xml", lib.WorkingFolder);
                _xmlcache     = ISM.Lib.Cache.XMLCacheOpen(_xmlcachename);

                mFontName = "Arial";
                mFontSize = 8;
                moRemote.ApplicationName  = "InfoPos";
                moRemote.ApplicationTitle = "InfoPos system";
                mApplicationPath          = Application.StartupPath;
                mTerminalSkin             = "0";
                mWindowType = "0";

                mTempPath         = CacheGetStr("frmOption_TempPath", "");
                mReportPathIn     = CacheGetStr("frmOption_ReportPathIn", "");
                mReportPathOut    = CacheGetStr("frmOption_ReportPathOut", "");
                mDynamicPathIn    = CacheGetStr("frmOption_DynamicPathIn", "");
                mDynamicPathOut   = CacheGetStr("frmOption_DynamicPathOut", "");
                mSlipPathIn       = CacheGetStr("frmOption_SlipsPathIn", "");
                mSlipPathOut      = CacheGetStr("frmOption_SlipsPathOut", "");
                mCustReportPathIn = CacheGetStr("frmOption_CustReportPathIn", "");

                mTerminalSkin = CacheGetStr("frmOption_TerminalSkin", "0");
                mWindowType   = CacheGetStr("frmOption_WindowType", "0");

                moRemote.Received += new ISM.CUser.Remote.DelegateReceived(moRemote_Received);
            }
            catch {}
        }
Beispiel #2
0
        static private Result Refresh(ISM.CUser.Remote remote, int privno, ref DictItem item)
        {
            object[] param = new object[] { item.Id };
            Result   r     = null;

            try
            {
                r = remote.Connection.Call(remote.User.UserNo, FileId, FuncNo, privno, param);
                if (r.ResultNo == 0)
                {
                    DataTable dt1 = r.Data.Tables[0];
                    if (dt1.Rows.Count > 0)
                    {
                        item.Name            = ISM.Lib.Static.ToStr(dt1.Rows[0]["Name"]);
                        item.Description     = ISM.Lib.Static.ToStr(dt1.Rows[0]["Description"]);
                        item.RefreshInterval = ISM.Lib.Static.ToInt(dt1.Rows[0]["RefreshInterval"]);
                        item.Loaded          = DateTime.Now;
                        item.Table           = r.Data.Tables[1];
                    }
                    r.Data  = null;
                    r.Param = null;
                }
                else
                {
                    return(r);
                }
            }
            catch (Exception ex)
            {
                r = new Result(9, ex.ToString());
            }

            return(r);
        }
Beispiel #3
0
        public FormAttachViewFileAdd(ISM.CUser.Remote remote, int typecode, string typeid, int privupdate)
        {
            InitializeComponent();

            _remote   = remote;
            _typecode = typecode;
            _typeid   = typeid;

            _privupdate = privupdate;
        }
Beispiel #4
0
        public void Init(string buttonkey, TouchLinkItem item, Form parent, object param, ref bool cancel)
        {
            try
            {
                _core = (InfoPos.Core.Core)param;
                if (_core != null)
                {
                    _remote   = _core.RemoteObject;
                    _resource = _core.Resource;
                }



                this.MdiParent = parent;
                this.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #5
0
        private void btnConnect_Click(object sender, EventArgs e)
        {
            try
            {
                #region Prepare values

                ISM.CUser.Remote remote = Program.Core.RemoteObject;

                Program.Core.CacheSet("Connection_UserNo", numUser.EditValue);

                remote.ServerIP          = Program.Core.CacheGetStr("Connection_Ip");
                remote.ServerPort        = Program.Core.CacheGetInt("Connection_Port");
                remote.User.UserNo       = Program.Core.CacheGetInt("Connection_UserNo");
                remote.User.PosNo        = Program.Core.CacheGetStr("Connection_PosNo");
                remote.User.UserPassword = ISM.Lib.Static.Encrypt(txtPwd.Text);
                remote.User.ComputerName = SystemInformation.ComputerName;
                remote.User.UserLanguage = "MN";

                if (IsTouch.Checked)
                {
                    Program.Core.IsTouch = true;
                    Program.Core.CacheSet("IsTouch", 1);
                }
                else
                {
                    Program.Core.IsTouch = false;
                    Program.Core.CacheSet("IsTouch", 0);
                }
                remote.WaitTimeout   = 10;
                remote.IdleTimeout   = 20;
                remote.CheckInterval = 8;

                Program.Core.CacheSave();


                #endregion

                #region Connect to server

                this.Cursor = System.Windows.Forms.Cursors.WaitCursor;

                Result res = remote.Reconnect(1);

                this.Cursor = System.Windows.Forms.Cursors.Default;

                switch (res.ResultNo)
                {
                case 0:     //  амжилттай холбогдсон
                    if (!(bool)res.Param[6])
                    {
                        //ISM.CUser.frmChangePass frm = new frmChangePass(moRemote.Connection, moRemote.User);
                        //frm.ShowDialog();
                    }

                    this.DialogResult = DialogResult.OK;
                    break;

                default:
                    remote.Disconnect();
                    MessageBox.Show(res.ResultDesc, "Алдаа гарлаа", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }
                #endregion
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #6
0
 public frmLock(ISM.CUser.Remote remote, string AppTitle)
 {
     InitializeComponent();
     _AppTitle = AppTitle;
     _remote   = remote;
 }
Beispiel #7
0
 static public Result Get(ISM.CUser.Remote remote, string[] id, ref ArrayList tables)
 {
     return(Get(remote.Connection, remote.User.UserNo, id, PrivNo, ref tables));
 }
Beispiel #8
0
 static public Result Get(ISM.CUser.Remote remote, string id, ref DataTable table)
 {
     return(Get(remote.Connection, remote.User.UserNo, id, PrivNo, ref table));
 }