Example #1
0
        public bool GetTerminal(int id)
        {
            try
            {
                using (var context = new RubberSoftEntities())
                {
                    var query = context.spt_GetTerminal().Where(o => o.TerminalId == id).ToList();
                    if (query.Count > 0)
                    {
                        foreach (spt_GetTerminal_Result dt in query)
                        {
                            ClassProperty.StrTerminalId  = dt.TerminalId;
                            ClassProperty.MachineName    = dt.TerminalName;
                            ClassProperty.EnableTerminal = dt.Active.Value;
                        }
                    }
                    else
                    {
                        ClassProperty.StrTerminalId  = 0;
                        ClassProperty.MachineName    = "";
                        ClassProperty.EnableTerminal = false;
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message);
                return(false);
            }
        }
Example #2
0
        public bool CheckTerminal(string name)
        {
            try
            {
                using (var context = new RubberSoftEntities())
                {
                    var query = context.spt_GetTerminal().Where(o => o.MachineName == name).ToList();
                    if (query.Count > 0)
                    {
                        foreach (spt_GetTerminal_Result dt in query)
                        {
                            ClassProperty.StrTerminalId = dt.TerminalId;
                        }

                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message);
                return(false);
            }
        }