Exemplo n.º 1
0
        public bool IsDelete(string iID)
        {
            bool b = false;

            sSQL = "select count(*) from SP where S1='" + iID + "'";
            int count = clsSQLCommond.Int(sSQL);

            if (count > 0)
            {
                b = true;
            }
            return(b);
        }
Exemplo n.º 2
0
    public bool CheckDel(string iID, string iType)
    {
        sSQL = "SELECT * FROM  _TableColInfo where ColSel='LookUpData' and ColSelFlag='" + iType + "' ";
        DataTable dt = clsSQLCommond.ExecQuery(sSQL);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            sSQL = "select count(*) from " + dt.Rows[i]["TABLE_CATALOG"].ToString() + "." + dt.Rows[i]["TABLE_SCHEMA"].ToString() + "." + dt.Rows[i]["TABLE_NAME"].ToString() + " where  COLUMN_NAME='" + iID + "' ";
            int iCount = clsSQLCommond.Int(sSQL);
            if (iCount > 0)
            {
                return(false);
            }
        }
        return(true);
    }
Exemplo n.º 3
0
        public bool GetVisitorsLog(string id)
        {
            ArrayList arrlist = new ArrayList();

            sSQL = "select isnull(max(right(SS6,4)),0) as CardID from Visitors where left(SS6,8)='" + DateTime.Now.ToString("yyMMdd") + "'";
            string CardID = (clsSQLCommond.Int(sSQL) + 1).ToString();

            sSQL = "select * from Visitors where iiID=" + id;
            DataTable dt = clsSQLCommond.ExecQuery(sSQL);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (dt.Rows[i]["SS6"].ToString() == "")
                {
                    string newid = CardID;
                    if (newid.Length == 1)
                    {
                        newid = "000" + newid;
                    }
                    else if (newid.Length == 2)
                    {
                        newid = "00" + newid;
                    }
                    else if (newid.Length == 3)
                    {
                        newid = "0" + newid;
                    }
                    newid = DateTime.Now.ToString("yyMMdd") + newid;
                    arrlist.Add("update Visitors set DDate1='" + DateTime.Now.ToString() + "',II2='2',SS6='" + newid + "' where AutoID=" + dt.Rows[i]["AutoID"].ToString());
                    CardID = CardID + 1;
                }
            }

            try
            {
                clsSQLCommond.ExecSqlTran(arrlist);
            }
            catch
            {
                return(false);
            }

            return(true);
        }