コード例 #1
0
        private void LoadVals(string strXml)
        {
            XmlSerializer s;
            StringReader  sr;

            s  = new XmlSerializer(typeof(COSecurityLevel));
            sr = new System.IO.StringReader(strXml);

            oVar = new COSecurityLevel();
            oVar = (COSecurityLevel)s.Deserialize(sr);

            sr.Close();
            sr = null;
            s  = null;
        }
コード例 #2
0
        public void LoadVals(string strXml)
        {
            XmlSerializer   s;
            StringReader    sr;
            COSecurityLevel o;

            s  = new XmlSerializer(typeof(COSecurityLevel));
            sr = new System.IO.StringReader(strXml);

            o = new COSecurityLevel();
            o = (COSecurityLevel)s.Deserialize(sr);

            base.LoadFromObj(o);

            o = null;
            sr.Close();
            sr = null;
            s  = null;
        }
コード例 #3
0
        public string GetDataString()
        {
            string          tmpStr;
            COSecurityLevel o;
            XmlSerializer   s;
            StringWriter    sw;

            o  = new COSecurityLevel();
            s  = new XmlSerializer(typeof(COSecurityLevel));
            sw = new StringWriter();

            base.Copy(o);
            s.Serialize(sw, o);

            tmpStr = sw.ToString();

            o  = null;
            s  = null;
            sw = null;

            return(tmpStr);
        }
コード例 #4
0
        public string GetByID(int lID)
        {
            SqlDataReader dr;

            RSLib.CDbConnection cnn;
            SqlCommand          cmd;
            SqlParameter        prm;
            string tmpStr = "";

            cnn             = new RSLib.CDbConnection();
            cmd             = new SqlCommand("spSecurityLevel_ByID", cnn.GetConnection());
            cmd.CommandType = CommandType.StoredProcedure;


            prm       = cmd.Parameters.Add("@ID", SqlDbType.Int);
            prm.Value = lID;

            dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);


            while (dr.Read())
            {
                oVar = new COSecurityLevel();

                oVar.ID        = Convert.ToInt32(dr["ID"]);
                oVar.Name      = dr["Name"].ToString();
                oVar.PassLevel = Convert.ToDecimal(dr["PassLevel"]);
                tmpStr         = GetDataString();
            }

            dr  = null;
            prm = null;
            cmd = null;
            cnn.CloseConnection();
            cnn = null;

            return(tmpStr);
        }
コード例 #5
0
 public void LoadFromObj(COSecurityLevel oOrg)
 {
     miID        = oOrg.ID;
     msName      = oOrg.Name;
     mdPassLevel = oOrg.PassLevel;
 }
コード例 #6
0
 public void Copy(COSecurityLevel oNew)
 {
     oNew.ID        = miID;
     oNew.Name      = msName;
     oNew.PassLevel = mdPassLevel;
 }