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

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

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

            sr.Close();
            sr = null;
            s  = null;
        }
示例#2
0
        public void LoadVals(string strXml)
        {
            XmlSerializer   s;
            StringReader    sr;
            COEmployeeTitle o;

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

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

            base.LoadFromObj(o);

            o = null;
            sr.Close();
            sr = null;
            s  = null;
        }
示例#3
0
        public string GetDataString()
        {
            string          tmpStr;
            COEmployeeTitle o;
            XmlSerializer   s;
            StringWriter    sw;

            o  = new COEmployeeTitle();
            s  = new XmlSerializer(typeof(COEmployeeTitle));
            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("spEmployeeTitle_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 COEmployeeTitle();

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

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

            return(tmpStr);
        }
示例#5
0
 public void LoadFromObj(COEmployeeTitle oOrg)
 {
     miID   = oOrg.ID;
     msName = oOrg.Name;
 }
示例#6
0
 public void Copy(COEmployeeTitle oNew)
 {
     oNew.ID   = miID;
     oNew.Name = msName;
 }