Ejemplo n.º 1
0
 public void LoadFromObj(CODepartment oOrg)
 {
     miID          = oOrg.ID;
     msName        = oOrg.Name;
     msDescription = oOrg.Description;
     miNumber      = oOrg.Number;
     miEmployeeID  = oOrg.EmployeeID;
 }
Ejemplo n.º 2
0
 public void Copy(CODepartment oNew)
 {
     oNew.ID          = miID;
     oNew.Name        = msName;
     oNew.Description = msDescription;
     oNew.Number      = miNumber;
     oNew.EmployeeID  = miEmployeeID;
 }
Ejemplo n.º 3
0
        private void LoadVals(string strXml)
        {
            XmlSerializer s;
            StringReader  sr;

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

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

            sr.Close();
            sr = null;
            s  = null;
        }
Ejemplo n.º 4
0
        public void LoadVals(string strXml)
        {
            XmlSerializer s;
            StringReader  sr;
            CODepartment  o;

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

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

            base.LoadFromObj(o);

            o = null;
            sr.Close();
            sr = null;
            s  = null;
        }
Ejemplo n.º 5
0
        public string GetByID(int lID)
        {
            SqlDataReader dr;

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

            cnn             = new RSLib.CDbConnection();
            cmd             = new SqlCommand("spDepartment_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 CODepartment();

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

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

            return(tmpStr);
        }
Ejemplo n.º 6
0
        public string GetDataString()
        {
            string        tmpStr;
            CODepartment  o;
            XmlSerializer s;
            StringWriter  sw;

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

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

            tmpStr = sw.ToString();

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

            return(tmpStr);
        }