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

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

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

            sr.Close();
            sr = null;
            s  = null;
        }
Example #2
0
 public void LoadFromObj(COEmployee oOrg)
 {
     miID               = oOrg.ID;
     msNumber           = oOrg.Number;
     msName             = oOrg.Name;
     msAbbrev           = oOrg.Abbrev;
     miEmpTitleID       = oOrg.EmpTitleID;
     mdMinHrs           = oOrg.MinHrs;
     mdMaxRegHrs        = oOrg.MaxRegHrs;
     mdMaxAllHrs        = oOrg.MaxAllHrs;
     mbIsActive         = oOrg.IsActive;
     mbIsProjectManager = oOrg.IsProjectManager;
     mbIsRelManager     = oOrg.IsRelManager;//****************Added 7/13/2015
     mbContractor       = oOrg.Contractor;
     msOfficeLocation   = oOrg.OfficeLocation;
     msEngineerType     = oOrg.EngineerType;
 }
Example #3
0
        public void Copy(COEmployee oNew)
        {
            oNew.ID               = miID;
            oNew.Number           = msNumber;
            oNew.Name             = msName;
            oNew.Abbrev           = msAbbrev;
            oNew.EmpTitleID       = miEmpTitleID;
            oNew.MinHrs           = mdMinHrs;
            oNew.MaxRegHrs        = mdMaxRegHrs;
            oNew.MaxAllHrs        = mdMaxAllHrs;
            oNew.IsActive         = mbIsActive;
            oNew.IsProjectManager = mbIsProjectManager;
            oNew.IsRelManager     = mbIsRelManager; //****************Added 7/13/2015

            oNew.Contractor     = mbContractor;
            oNew.OfficeLocation = msOfficeLocation;
            oNew.EngineerType   = msEngineerType;
        }
Example #4
0
        public void LoadVals(string strXml)
        {
            XmlSerializer s;
            StringReader  sr;
            COEmployee    o;

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

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

            base.LoadFromObj(o);

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

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

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

            tmpStr = sw.ToString();

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

            return(tmpStr);
        }
Example #6
0
        public string GetByID(int lID)
        {
            SqlDataReader dr;

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

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

                oVar.ID               = Convert.ToInt32(dr["ID"]);
                oVar.Number           = dr["Number"].ToString();
                oVar.Name             = dr["Name"].ToString();
                oVar.Abbrev           = dr["Abbrev"].ToString();
                oVar.EmpTitleID       = Convert.ToInt32(dr["EmpTitleID"]);
                oVar.MinHrs           = Convert.ToDecimal(dr["MinHrs"]);
                oVar.MaxRegHrs        = Convert.ToDecimal(dr["MaxRegHrs"]);
                oVar.MaxAllHrs        = Convert.ToDecimal(dr["MaxAllHrs"]);
                oVar.IsActive         = Convert.ToBoolean(dr["IsActive"]);
                oVar.IsProjectManager = Convert.ToBoolean(dr["IsProjectManager"]);


                if (dr["IsRelManager"] == DBNull.Value)
                {
                    oVar.IsRelManager = false;                                    // *********************Edited 7/27/2015***to handle Exception
                }
                else
                {
                    oVar.IsRelManager = Convert.ToBoolean(dr["IsRelManager"]);  //*************************Added 7/13/2015
                }
                oVar.Contractor     = Convert.ToBoolean(dr["Contractor"]);
                oVar.OfficeLocation = dr["OfficeLocation"].ToString();
                oVar.EngineerType   = dr["EngineerType"].ToString();



                tmpStr = GetDataString();
            }

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

            return(tmpStr);
        }