コード例 #1
0
ファイル: CawCorpDB.cs プロジェクト: inspire88/TcportGroupOA
        /// <summary>
        /// 获取所有的公司信息
        /// </summary>
        /// <returns></returns>
        public List<Detail_CAW_COMPANY> GetAllCompanyForTree()
        {
            Database db = DatabaseFactory.CreateDatabase(CawConnStr);
            string SqlStr = "SELECT A.GUID,A.NAME,A.CORPTYPE,A.PORTGUID,A.SURVEY,A.EQUIPMENT,A.ADDRESS,A.POSTALCODE,A.FAX,A.EMAIL,A.WEBSITE,A.MGRSYS,A.PRODUCTIONSTATUS,A.EVENT,B.DATASTATUS,B.DATASTATUS_NAME,B.CHECKOPION FROM CAW_COMPANY A INNER JOIN CAW_DATESTATUS B ON A.GUID=B.KEYGUID WHERE B.ISDEL <>'Y'";
            DbCommand cmd = db.GetSqlStringCommand(SqlStr);
            DataView dv = db.ExecuteDataView(cmd);
            List<Detail_CAW_COMPANY> DocList = new List<Detail_CAW_COMPANY>();

            for (int i = 0; i < dv.Count; i++)
            {
                Detail_CAW_COMPANY DCC = new Detail_CAW_COMPANY();
                DCC.GUID = dv[i]["GUID"].ToString().Trim(); ;
                DCC.NAME = dv[i]["NAME"].ToString().Trim();
                DocList.Add(DCC);
            }
            return DocList;
        }
コード例 #2
0
ファイル: CawCorpDB.cs プロジェクト: inspire88/TcportGroupOA
        /// <summary>
        /// 
        /// 编写日期:2010-3-10
        /// 编写人:GWF
        /// </summary>
        /// <param name="ID"></param>
        public List<Detail_CAW_COMPANY> GetCompany(string ID,out string Flag)
        {
            Database db = DatabaseFactory.CreateDatabase(CawConnStr);
            string SqlStr = "SELECT A.GUID,A.NAME,A.CORPTYPE,A.PORTGUID,A.SURVEY,A.EQUIPMENT,A.ADDRESS,A.POSTALCODE,A.FAX,A.EMAIL,A.WEBSITE,A.MGRSYS,A.PRODUCTIONSTATUS,A.EVENT,B.DATASTATUS,B.DATASTATUS_NAME,B.CHECKOPION FROM CAW_COMPANY A INNER JOIN CAW_DATESTATUS B ON A.GUID=B.KEYGUID WHERE A.GUID='" + ID + "'";
            DbCommand cmd = db.GetSqlStringCommand(SqlStr);
            DataView dv = db.ExecuteDataView(cmd);
            List<Detail_CAW_COMPANY> DocList = new List<Detail_CAW_COMPANY>();
            Flag = dv.Count > 0 ? "1" : "0";
            for (int i = 0; i < dv.Count; i++)
            {
                Detail_CAW_COMPANY DCC = new Detail_CAW_COMPANY();
                DCC.GUID = ID;
                DCC.NAME = dv[i]["NAME"].ToString().Trim();
                DCC.CORPTYPE = dv[i]["CORPTYPE"].ToString().Trim();
                DCC.PORTGUID = dv[i]["PORTGUID"].ToString().Trim();
                DCC.SURVEY = dv[i]["SURVEY"].ToString().Trim();
                DCC.EQUIPMENT = dv[i]["EQUIPMENT"].ToString().Trim();
                DCC.ADDRESS = dv[i]["ADDRESS"].ToString().Trim();
                DCC.POSTALCODE = dv[i]["POSTALCODE"].ToString().Trim();
                DCC.EMAIL = dv[i]["EMAIL"].ToString().Trim();
                DCC.FAX = dv[i]["FAX"].ToString().Trim();
                DCC.WEBSITE = dv[i]["WEBSITE"].ToString().Trim();
                DCC.MGRSYS = dv[i]["MGRSYS"].ToString().Trim();
                DCC.PRODUCTIONSTATUS = dv[i]["PRODUCTIONSTATUS"].ToString().Trim();
                DCC.EVENT = dv[i]["EVENT"].ToString().Trim();
                DCC.DATASTATUS = dv[i]["DATASTATUS"].ToString().Trim();
                DCC.DATASTATUS_NAME = dv[i]["DATASTATUS_NAME"].ToString().Trim();
                DCC.CHECKOPION = dv[i]["CHECKOPION"].ToString().Trim();

                DocList.Add(DCC);
            }
            return DocList;
        }