public string GetByID(int lID) { SqlDataReader dr; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; string tmpStr = ""; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spBudgetLine_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 COBudgetLine(); oVar.ID = Convert.ToInt32(dr["ID"]); oVar.BudgetID = Convert.ToInt32(dr["BudgetID"]); oVar.DeptGroup = Convert.ToInt32(dr["DeptGroup"]); oVar.EntryLevel = Convert.ToInt32(dr["EntryLevel"]); oVar.Task = Convert.ToInt32(dr["Task"]); oVar.Category = Convert.ToInt32(dr["Category"]); oVar.Activity = Convert.ToInt32(dr["Activity"]); oVar.WBS = dr["WBS"].ToString(); oVar.Description = dr["Description"].ToString(); oVar.Quantity = Convert.ToInt32(dr["Quantity"]); oVar.HoursEach = Convert.ToInt32(dr["HoursEach"]); oVar.TotalHours = Convert.ToInt32(dr["TotalHours"]); oVar.LoadedRate = Convert.ToDecimal(dr["LoadedRate"]); oVar.TotalDollars = Convert.ToDecimal(dr["TotalDollars"]); oVar.BareRate = Convert.ToDecimal(dr["BareRate"]); oVar.BareDollars = Convert.ToDecimal(dr["BareDollars"]); tmpStr = GetDataString(); } dr = null; prm = null; cmd = null; cnn.CloseConnection(); cnn = null; return(tmpStr); }
private void LoadVals(string strXml) { XmlSerializer s; StringReader sr; s = new XmlSerializer(typeof(COBudgetLine)); sr = new System.IO.StringReader(strXml); oVar = new COBudgetLine(); oVar = (COBudgetLine)s.Deserialize(sr); sr.Close(); sr = null; s = null; }
public void LoadFromObj(COBudgetLine oOrg) { miID = oOrg.ID; miBudgetID = oOrg.BudgetID; miDeptGroup = oOrg.DeptGroup; miEntryLevel = oOrg.EntryLevel; miTask = oOrg.Task; miCategory = oOrg.Category; miActivity = oOrg.Activity; msWBS = oOrg.WBS; msDescription = oOrg.Description; miQuantity = oOrg.Quantity; miHoursEach = oOrg.HoursEach; miTotalHours = oOrg.TotalHours; mdLoadedRate = oOrg.LoadedRate; mdTotalDollars = oOrg.TotalDollars; mdBareRate = oOrg.BareRate; mdBareDollars = oOrg.BareDollars; }
public void Copy(COBudgetLine oNew) { oNew.ID = miID; oNew.BudgetID = miBudgetID; oNew.DeptGroup = miDeptGroup; oNew.EntryLevel = miEntryLevel; oNew.Task = miTask; oNew.Category = miCategory; oNew.Activity = miActivity; oNew.WBS = msWBS; oNew.Description = msDescription; oNew.Quantity = miQuantity; oNew.HoursEach = miHoursEach; oNew.TotalHours = miTotalHours; oNew.LoadedRate = mdLoadedRate; oNew.TotalDollars = mdTotalDollars; oNew.BareRate = mdBareRate; oNew.BareDollars = mdBareDollars; }
public void LoadVals(string strXml) { XmlSerializer s; StringReader sr; COBudgetLine o; s = new XmlSerializer(typeof(COBudgetLine)); sr = new System.IO.StringReader(strXml); o = new COBudgetLine(); o = (COBudgetLine)s.Deserialize(sr); base.LoadFromObj(o); o = null; sr.Close(); sr = null; s = null; }
public string GetDataString() { string tmpStr; COBudgetLine o; XmlSerializer s; StringWriter sw; o = new COBudgetLine(); s = new XmlSerializer(typeof(COBudgetLine)); sw = new StringWriter(); base.Copy(o); s.Serialize(sw, o); tmpStr = sw.ToString(); o = null; s = null; sw = null; return(tmpStr); }