예제 #1
0
 public void LoadFromObj(COUnitOfMeasure oOrg)
 {
     miID          = oOrg.ID;
     msUseCode     = oOrg.UseCode;
     msCode        = oOrg.Code;
     msDescription = oOrg.Description;
     miOrdinal     = oOrg.Ordinal;
 }
예제 #2
0
 public void Copy(COUnitOfMeasure oNew)
 {
     oNew.ID          = miID;
     oNew.UseCode     = msUseCode;
     oNew.Code        = msCode;
     oNew.Description = msDescription;
     oNew.Ordinal     = miOrdinal;
 }
예제 #3
0
        private void LoadVals(string strXml)
        {
            XmlSerializer s;
            StringReader  sr;

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

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

            sr.Close();
            sr = null;
            s  = null;
        }
예제 #4
0
        public void LoadVals(string strXml)
        {
            XmlSerializer   s;
            StringReader    sr;
            COUnitOfMeasure o;

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

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

            base.LoadFromObj(o);

            o = null;
            sr.Close();
            sr = null;
            s  = null;
        }
예제 #5
0
        public string GetDataString()
        {
            string          tmpStr;
            COUnitOfMeasure o;
            XmlSerializer   s;
            StringWriter    sw;

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

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

            tmpStr = sw.ToString();

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

            return(tmpStr);
        }
예제 #6
0
        public string GetByID(int iID)
        {
            SqlDataReader dr;
            RSConnection  cnn;
            SqlCommand    cmd;
            SqlParameter  prm;
            string        tmpStr = "";

            cnn             = new RSConnection("CR");
            cmd             = new SqlCommand("spUnitOfMeasure_ByID", cnn.GetConnection());
            cmd.CommandType = CommandType.StoredProcedure;

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

            dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);

            while (dr.Read())
            {
                oVar             = new COUnitOfMeasure();
                oVar.ID          = Convert.ToInt32(dr["ID"]);
                oVar.UseCode     = dr["UseCode"].ToString();
                oVar.Code        = dr["Code"].ToString();
                oVar.Description = dr["Description"].ToString();
                oVar.Ordinal     = Convert.ToInt32(dr["Ordinal"]);
                tmpStr           = GetDataString();
            }
            dr.Close();
            dr  = null;
            prm = null;
            cmd = null;
            cnn.CloseConnection();
            cnn = null;

            return(tmpStr);
        }