Esempio n. 1
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;
        //}

        private void LoadVals(string strXml)
        {
            XmlSerializer s;
            StringReader  sr;

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

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

            sr.Close();
            sr = null;
            s  = null;
        }
Esempio n. 2
0
        public void LoadVals(string strXml)
        {
            XmlSerializer   s;
            StringReader    sr;
            COBusiness_Unit o;

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

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

            base.LoadFromObj(o);

            o = null;
            sr.Close();
            sr = null;
            s  = null;
        }
Esempio n. 3
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;
        //}


        public string GetByID(int lID)
        {
            SqlDataReader dr;

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

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

                oVar.ID = Convert.ToInt32(dr["Bus_Unit_ID"]);

                oVar.Description = dr["Bus_Unit_Description"].ToString();

                tmpStr = GetDataString();
            }

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

            return(tmpStr);
        }
Esempio n. 4
0
        public string GetDataString()
        {
            string          tmpStr;
            COBusiness_Unit o;
            XmlSerializer   s;
            StringWriter    sw;

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

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

            tmpStr = sw.ToString();

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

            return(tmpStr);
        }
Esempio n. 5
0
        //public void Copy(CODepartment oNew)
        //{
        //    oNew.ID = miID;
        //    oNew.Name = msName;
        //    oNew.Description = msDescription;
        //    oNew.Number = miNumber;
        //    oNew.EmployeeID = miEmployeeID;
        //}

        public void Copy(COBusiness_Unit oNew)
        {
            oNew.miBus_Unit_ID = miBus_Unit_ID;

            oNew.msBus_Unit_Description = msBus_Unit_Description;
        }
Esempio n. 6
0
        //public void LoadFromObj(CODepartment oOrg)
        //{
        //    miID = oOrg.ID;
        //    msName = oOrg.Name;
        //    msDescription = oOrg.Description;
        //    miNumber = oOrg.Number;
        //    miEmployeeID = oOrg.EmployeeID;
        //}

        public void LoadFromObj(COBusiness_Unit oOrg)
        {
            miBus_Unit_ID = oOrg.miBus_Unit_ID;

            msBus_Unit_Description = oOrg.msBus_Unit_Description;
        }