Exemplo n.º 1
0
        public string GetHisEmpNum(string startDate, string endDate)
        {
            string sqlstr = string.Format("SELECT count(DISTINCT codesenderaddress) FROM His_InOutMine" +
                                          " WHERE dbo.His_InOutMine.OutTime > '{0}' AND dbo.His_InOutMine.InTime < '{1}'", startDate, endDate);

            return(dba.ExecuteScalarSql(sqlstr));
        }
Exemplo n.º 2
0
        public bool IsExitsEquNo(string equno)
        {
            string sqlstr = string.Format("select count(EquNO) from Equ_BaseInfo where equno='{0}'", equno);
            int    num    = int.Parse(dba.ExecuteScalarSql(sqlstr));

            if (num > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public bool ExitsFileName(string filename)
        {
            string sqlstr = string.Format("select count(FileName) from ConfigFile_ZZHA where [FileName]='{0}'", filename);
            string num    = dba.ExecuteScalarSql(sqlstr);
            int    count  = int.Parse(num);

            if (count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 4
0
        public string getEnumID(string title, int funId)
        {
            strSQL = string.Format("select EnumID from EnumTable where Title ='{0}' and FunID = {1}", title, funId);
            object obj = dba.ExecuteScalarSql(strSQL);

            return(obj != null?obj.ToString() : "");
        }
Exemplo n.º 5
0
        public DataSet Query_His_Info(int intPageIndex, int intPageSize, string strWhere)
        {
            SqlParameter[] para = { new SqlParameter("@tblName",   SqlDbType.VarChar, 255),
                                    new SqlParameter("@fldName",   SqlDbType.VarChar, 255),
                                    new SqlParameter("@PageSize",  SqlDbType.Int),
                                    new SqlParameter("@PageIndex", SqlDbType.Int),
                                    new SqlParameter("@IsReCount", SqlDbType.Int),
                                    new SqlParameter("@OrderType", SqlDbType.Int),
                                    new SqlParameter("@strWhere",  SqlDbType.VarChar, 8000) };
            para[0].Value = "View_His_Info";
            para[1].Value = "id";
            para[2].Value = intPageSize;
            para[3].Value = intPageIndex;
            para[4].Value = 1;
            para[5].Value = 0;
            para[6].Value = strWhere;
            string sql = "select count(DISTINCT CodeSenderAddress) from View_His_Info";

            sql += strWhere == "" ? "" : " where " + strWhere;
            string    s  = dba.ExecuteScalarSql(sql);
            DataTable dt = new DataTable("TabCount");

            dt.Columns.Add("EmpCount");
            DataRow dr = dt.NewRow();

            dr["EmpCount"] = s;
            dt.Rows.Add(dr);
            DataSet ds = dba.ExecuteSqlDataSet("Shine_GetRecordByPage", para);

            ds.Tables.Add(dt);
            return(ds);
        }
Exemplo n.º 6
0
        public DataSet GetInfo_HisStationHead_Equ(int pageIndex, int pageSize, string where)
        {
            SqlParameter[] para = { new SqlParameter("@tblName",   SqlDbType.VarChar, 255),
                                    new SqlParameter("@fldName",   SqlDbType.VarChar, 255),
                                    new SqlParameter("@PageSize",  SqlDbType.Int),
                                    new SqlParameter("@PageIndex", SqlDbType.Int),
                                    new SqlParameter("@IsReCount", SqlDbType.Bit),
                                    new SqlParameter("@OrderType", SqlDbType.Bit),
                                    new SqlParameter("@strWhere",  SqlDbType.VarChar, 1000) };
            para[0].Value = "A_His_StationHead_Equ";
            para[1].Value = "HisStationHeadID";
            para[2].Value = pageSize;
            para[3].Value = pageIndex;
            para[4].Value = 1;
            para[5].Value = 0;
            para[6].Value = where;

            using (ds = new DataSet())
            {
                ds = dba.ExecuteSqlDataSet("Shine_GetRecordByPage", para);

                string    sql = "select count(DISTINCT 标识卡号) from A_His_StationHead_Equ Where" + where;
                string    s   = dba.ExecuteScalarSql(sql);
                DataTable dt  = new DataTable("TabCount");
                dt.Columns.Add("Counts");
                DataRow dr = dt.NewRow();
                dr["Counts"] = s;
                dt.Rows.Add(dr);
                ds.Tables.Add(dt);
                return(ds);
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 根据探头ID取出该探头所探测的实时人员信息
        /// </summary>
        /// <param name="stationaddress">分站ID</param>
        /// <param name="stationheadaddress">探头ID</param>
        /// <returns>信息表</returns>
        public DataTable GetRealTimeInStationByStationInfo(int stationaddress, int stationheadaddress, bool Checked)
        {
            string sqlstr = string.Format("select count(1) from station_head_info where stationaddress={0} and stationheadaddress={1} and stationheadtypeid=8", stationaddress, stationheadaddress);

            if (dba.ExecuteScalarSql(sqlstr) == "1")
            {
                if (Checked)
                {
                    try
                    {
                        string selectstring = string.Format("select 标识卡,姓名,部门,时间 from A_RTStationHeadView where stationaddress={0} and stationheadaddress={1} and inoutflag=0", stationaddress, stationheadaddress);
                        return(dba.GetDataSet(selectstring).Tables[0]);
                    }
                    catch (Exception ex)
                    {
                        return(new DataTable());
                    }
                }
                else
                {
                    try
                    {
                        string selectstring = "select 标识卡,姓名,部门,时间 from A_RTStationHeadView where 1=2";
                        return(dba.GetDataSet(selectstring).Tables[0]);
                    }
                    catch (Exception ex)
                    {
                        return(new DataTable());
                    }
                }
            }
            else
            {
                try
                {
                    string selectstring = string.Format("select 标识卡,姓名,部门,时间 from A_RTStationHeadView where stationaddress={0} and stationheadaddress={1}", stationaddress, stationheadaddress);
                    return(dba.GetDataSet(selectstring).Tables[0]);
                }
                catch (Exception ex)
                {
                    return(new DataTable());
                }
            }
        }
Exemplo n.º 8
0
 public int GetFlashTime()
 {
     try
     {
         string sqlstr = "select enumvalue from EnumTable where funid=51 and enumid=1";
         return(int.Parse(dba.ExecuteScalarSql(sqlstr)));
     }
     catch (Exception ex)
     {
         return(3);
     }
 }
Exemplo n.º 9
0
        public bool IsAlarmWalk()
        {
            bool w1 = false;
            bool w2 = false;

            try
            {
                string sqlstr = "select count(*) from enumtable where funid=12 and title='超速报警' and enumvalue=1";
                if (int.Parse(dba.ExecuteScalarSql(sqlstr)) == 1)
                {
                    w1 = true;
                }
                else
                {
                    w1 = false;
                }
            }
            catch (Exception ex)
            {
                w1 = false;
            }
            try
            {
                string sqlstr = "select count(*) from enumtable where funid=12 and title='欠速报警' and enumvalue=1";
                if (int.Parse(dba.ExecuteScalarSql(sqlstr)) == 1)
                {
                    w2 = true;
                }
                else
                {
                    w2 = false;
                }
            }
            catch (Exception ex)
            {
                w2 = false;
            }
            return(w1 || w2);
        }
Exemplo n.º 10
0
 public int GetNumOfRoute()
 {
     try
     {
         int    num       = 0;
         string selectstr = "select count(id) from route";
         num = Convert.ToInt32(dba.ExecuteScalarSql(selectstr));
         return(num);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 11
0
        public bool isExitsUserName(string username)
        {
            string sqlstr = string.Format("select count(*) from admins where account='{0}'", username);
            int    num    = int.Parse(dba.ExecuteScalarSql(sqlstr));

            if (num > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 12
0
        public bool IsExistsStationHeadNO(string no)
        {
            string sqlstr = "select count(1) from Station_Head_Info where StationHeadNO=" + no;
            string num    = dba.ExecuteScalarSql(sqlstr);

            try
            {
                if (int.Parse(num) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Exemplo n.º 13
0
        public bool IsExistsTNO(string tno)
        {
            string sqlstr = "select count(1) from Territorial_Info where TerritorialNO=" + tno;
            string num    = dba.ExecuteScalarSql(sqlstr);

            try
            {
                if (int.Parse(num) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// 根据标识卡号查询标识卡ID
        /// </summary>
        /// <param name="codesenderaddress"></param>
        /// <returns></returns>
        public string GetCodesenderIDbyCodesenderAddress(string codesenderaddress)
        {
            string sqlstr = string.Format("select codesenderid from CodeSender_Info where codesenderaddress={0}", codesenderaddress);

            return(dba.ExecuteScalarSql(sqlstr));
        }
Exemplo n.º 15
0
        public string GetMeasure(string strEmpID)
        {
            strSQL = "Select 救援措施 From zjw_RT_EmpHelp_View Where EmpID=" + strEmpID;

            return(dbacc.ExecuteScalarSql(strSQL));
        }
Exemplo n.º 16
0
        public bool IsRouted(string fileID)
        {
            string sqlstr = string.Format("select count(*) from G_DRoute where FileID={0}", fileID);
            int    num;

            try
            {
                num = int.Parse(dba.ExecuteScalarSql(sqlstr));
            }
            catch (Exception ex)
            {
                return(false);
            }
            if (num > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 17
0
        //private DeserializeDockContent m_deserializeDockContent;

        //private bool m_bSaveLayout = true;

        #endregion

        #region 保存菜单


        private void SetMenuAll(ToolStripItemCollection items)
        {
            KJ128NDataBase.DBAcess dba = new KJ128NDataBase.DBAcess();

            foreach (ToolStripItem tsi in items)
            {
                if (tsi is ToolStripMenuItem)
                {

                    //ToolStrip TS =  tsi.Owner;

                    string str = string.Format("insert into menus1(PMenuID,Title,name) values({2},'{0}','{1}')", ((ToolStripMenuItem)tsi).Text.Substring(0, ((ToolStripMenuItem)tsi).Text.Length - 4), ((ToolStripMenuItem)tsi).Name
                    , ((ToolStripMenuItem)tsi).Owner.Name == "msMainMenu" ? "-1" : dba.ExecuteScalarSql("select id from menus1 where name ='" + ((ToolStripMenuItem)tsi).OwnerItem.Name + "'"));

                    dba.ExecuteSql(str);

                    System.IO.File.AppendAllText("c:/sql.txt", str + "\r\n", Encoding.Default);

                    if (((ToolStripMenuItem)tsi).DropDownItems.Count > 0)
                    {
                        SetMenuAll(((ToolStripMenuItem)tsi).DropDownItems);
                    }
                }
            }

        }
Exemplo n.º 18
0
        public string GetEmpHelpCounts()
        {
            strSQL = " Select Count(1) as Counts From RT_EmpHelp ";

            return(dba.ExecuteScalarSql(strSQL));
        }