public DataSet GetForecastRemainingNew(int ENGPLSPM) { DataSet ds; RSLib.CDbConnection cnn; SqlDataAdapter da; SqlCommand cmd; cnn = new RSLib.CDbConnection(); if (ENGPLSPM == 3) { cmd = new SqlCommand("spRPRT_ForecastRemainingPGM", cnn.GetConnection(120)); } else { cmd = new SqlCommand("spRPRT_ForecastRemaining", cnn.GetConnection(120)); } cmd.CommandType = CommandType.StoredProcedure; cmd.CommandTimeout = 60 * 2; da = new SqlDataAdapter(); ds = new DataSet(); da.SelectCommand = cmd; da.Fill(ds); cnn.CloseConnection(); return(ds); }
public DataSet GetForecastRemaining(bool usePipe) { DataSet ds; RSLib.CDbConnection cnn; SqlDataAdapter da; SqlCommand cmd; cnn = new RSLib.CDbConnection(); if (usePipe == true) { cmd = new SqlCommand("spRPRT_ForecastRemainingForPipeline", cnn.GetConnection(120)); } else { cmd = new SqlCommand("spRPRT_ForecastRemaining", cnn.GetConnection(120)); } cmd.CommandType = CommandType.StoredProcedure; cmd.CommandTimeout = 60 * 2; da = new SqlDataAdapter(); ds = new DataSet(); da.SelectCommand = cmd; da.Fill(ds); cnn.CloseConnection(); return(ds); }
public DataSet GetCostReport(string project, int rprtCase, bool isRollup) { DataSet ds; RSLib.CDbConnection cnn; SqlDataAdapter da; SqlCommand cmd; SqlParameter prm; string currDate; currDate = DateTime.Now.ToShortDateString(); cnn = new RSLib.CDbConnection(); if (isRollup == true) { cmd = new SqlCommand("spRPRT_CostReport_NewAcct2ForRollup_Vision", cnn.GetConnection()); } else { if (UseNewCodes(project) == true) { cmd = new SqlCommand("spRPRT_CostReport_NewAcct2_Vision", cnn.GetConnection()); } else { cmd = new SqlCommand("spRPRT_CostReport_OldAcct2_Vision", cnn.GetConnection()); } } cmd.CommandType = CommandType.StoredProcedure; cmd.CommandTimeout = 60 * 2; prm = cmd.Parameters.Add("@records", SqlDbType.Int); //*******Added 7/24/2015, because, it was throwing exception in PM Report prm.Direction = ParameterDirection.Output; prm = cmd.Parameters.Add("@Project", SqlDbType.VarChar, 50); prm.Value = project; prm = cmd.Parameters.Add("@Rprtdate", SqlDbType.SmallDateTime); prm.Value = currDate; prm = cmd.Parameters.Add("@ReportCase", SqlDbType.Int); prm.Value = rprtCase; da = new SqlDataAdapter(); ds = new DataSet(); da.SelectCommand = cmd; da.Fill(ds); FtcCalculator.UpdateCalculatedField(ds); cnn.CloseConnection(); return(ds); }
public int SaveNew(string strXml) { RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; int retVal = 0; LoadVals(strXml); cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spActivityCodes_Insert", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@ID", SqlDbType.Int); prm.Direction = ParameterDirection.Output; prm = cmd.Parameters.Add("@Code", SqlDbType.VarChar, 6); prm.Value = oVar.Code; prm = cmd.Parameters.Add("@Name", SqlDbType.VarChar, 50); prm.Value = oVar.Name; cmd.ExecuteNonQuery(); retVal = Convert.ToInt32(cmd.Parameters["@ID"].Value); prm = null; cmd = null; cnn.CloseConnection(); cnn = null; return(retVal); }
public bool Delete(int lID) { bool retVal = false; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spActivityCodes_Delete", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@ID", SqlDbType.Int); prm.Value = lID; try { cmd.ExecuteNonQuery(); retVal = true; } catch { retVal = false; } prm = null; cmd = null; cnn.CloseConnection(); cnn = null; return(retVal); }
public decimal GetMaxLevelForUser(int userID) { SqlDataReader dr; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; decimal pLvl; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spUserLevel_MaxForUser", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@UserID", SqlDbType.Int); prm.Value = userID; dr = cmd.ExecuteReader(); pLvl = 999; while (dr.Read()) { pLvl = Convert.ToDecimal(dr["MaxLvl"]); } dr.Close(); cnn.CloseConnection(); return(pLvl); }
public DataSet GetBudgetAccountingEntryForReport(int budgetID, string wbs) { RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; SqlDataAdapter da; DataSet ds; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spRPRT_BudgetAccountEntrys", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@BudgetID", SqlDbType.Int); prm.Value = budgetID; prm = cmd.Parameters.Add("@WBS", SqlDbType.VarChar, 5); prm.Value = wbs; da = new SqlDataAdapter(); da.SelectCommand = cmd; ds = new DataSet(); da.Fill(ds); cnn.CloseConnection(); return(ds); }
public decimal GetContingencyForBudget(int budgetID) { SqlDataReader dr; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; decimal cont = 0; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spBudget_GetContingencyByID", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@BudgetID", SqlDbType.Int); prm.Value = budgetID; dr = cmd.ExecuteReader(); while (dr.Read()) { cont = Convert.ToDecimal(dr["Contingency"]); } dr.Close(); cnn.CloseConnection(); cmd = null; return(cont); }
//public DataSet GetBudgetSummaryForPipelineReport(int budgetID, string wbs) //{ // RSLib.CDbConnection cnn; // SqlCommand cmd; // SqlParameter prm; // SqlDataAdapter da; // DataSet ds; // cnn = new RSLib.CDbConnection(); // cmd = new SqlCommand("spRPRT_BudgetSummary_Pipeline", cnn.GetConnection()); // cmd.CommandType = CommandType.StoredProcedure; // prm = cmd.Parameters.Add("@BudgetID", SqlDbType.Int); // prm.Value = budgetID; // prm = cmd.Parameters.Add("@WBS", SqlDbType.VarChar, 5); // prm.Value = wbs; // da = new SqlDataAdapter(); // da.SelectCommand = cmd; // ds = new DataSet(); // da.Fill(ds); // cnn.CloseConnection(); // return ds; //} public int GetTotalBudgetHours(int budgetID, string wbs) { SqlDataReader dr; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; int totalHours = 0; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spBudget_GetTotalHoursByID", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@BudgetID", SqlDbType.Int); prm.Value = budgetID; prm = cmd.Parameters.Add("@WBS", SqlDbType.VarChar, 5); prm.Value = wbs; dr = cmd.ExecuteReader(); while (dr.Read()) { totalHours = Convert.ToInt32(dr["TotalHours"]); } dr.Close(); cnn.CloseConnection(); cmd = null; return(totalHours); }
public int GetReleaseCountByProject(int projID) { SqlDataReader dr; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; int relCount = 0; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spTransmittalRelease_CountByProj", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@ProjectID", SqlDbType.Int); prm.Value = projID; dr = cmd.ExecuteReader(); while (dr.Read()) { relCount = Convert.ToInt32(dr["Cnt"]); } dr.Close(); cnn.CloseConnection(); return(relCount); }
public SqlDataReader GetListProj_ByPM_SumID(int mngrID, int sumID) //*****************Added 8/4/2015 { SqlDataReader dr; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spProjectSummaryInfos_ByPMID_SumID", cnn.GetConnection()); // cmd = new SqlCommand("spProjectSummaryInfos_ByPMID_SumID_new", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@PMID", SqlDbType.Int); prm.Value = mngrID; prm = cmd.Parameters.Add("@ProjSumID", SqlDbType.Int); prm.Value = sumID; dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); cmd = null; return(dr); }
public string GetNumberByID(int lID) { SqlDataReader dr; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; string tmpStr = ""; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spProject_GetNumberByID", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@ID", SqlDbType.Int); prm.Value = lID; dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); while (dr.Read()) { tmpStr = dr["Number"].ToString(); } dr.Close(); dr = null; prm = null; cmd = null; cnn.CloseConnection(); cnn = null; return(tmpStr); }
public string GetByNumber(string number) { SqlDataReader dr; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; string tmpStr = ""; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spProject_ByNumber", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@Number", SqlDbType.VarChar, 50); prm.Value = number; dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); while (dr.Read()) { oVar = new COProject(); oVar.ID = Convert.ToInt32(dr["ID"]); oVar.Number = dr["Number"].ToString(); oVar.Description = dr["Description"].ToString(); oVar.CustomerID = Convert.ToInt32(dr["CustomerID"]); oVar.CustomerProjNumber = dr["CustomerProjNumber"].ToString(); oVar.LocationID = Convert.ToInt32(dr["LocationID"]); oVar.ProjMngrID = Convert.ToInt32(dr["ProjMngrID"]); oVar.LeadProjMngrID = Convert.ToInt32(dr["LeadProjMngrID"]); oVar.RelationshipMngrID = Convert.ToInt32(dr["RelationshipMngrID"]); oVar.RateSchedID = Convert.ToInt32(dr["RateSchedID"]); oVar.Multiplier = Convert.ToDecimal(dr["Multiplier"]); oVar.Overlay = Convert.ToDecimal(dr["Overlay"]); oVar.Notes = dr["Notes"].ToString(); oVar.DateStart = Convert.ToDateTime(dr["DateStart"]); oVar.DateEnd = Convert.ToDateTime(dr["DateEnd"]); oVar.IsProposal = Convert.ToBoolean(dr["IsProposal"]); oVar.IsBooked = Convert.ToBoolean(dr["IsBooked"]); oVar.IsActive = Convert.ToBoolean(dr["IsActive"]); oVar.IsGovernment = Convert.ToBoolean(dr["IsGovernment"]); oVar.IsMaster = Convert.ToBoolean(dr["IsMaster"]); oVar.MasterID = Convert.ToInt32(dr["MasterID"]); oVar.ReportingStatus = Convert.ToInt32(dr["ReportingStatus"]); oVar.Budget = Convert.ToDecimal(dr["Budget"]); oVar.POAmount = dr["POAmount"].ToString(); tmpStr = GetDataString(); } dr.Close(); dr = null; prm = null; cmd = null; cnn.CloseConnection(); cnn = null; return(tmpStr); }
public void MoveAllTimeByWeek(int deptID, int projID, int wkID, int wkMove) { RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("[spScheduleHour_MoveAllByWeek]", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@DepartmentID", SqlDbType.Int); prm.Value = deptID; prm = cmd.Parameters.Add("@ProjectID", SqlDbType.Int); prm.Value = projID; prm = cmd.Parameters.Add("@WeekID", SqlDbType.Int); prm.Value = wkID; prm = cmd.Parameters.Add("@WeekCount", SqlDbType.Int); prm.Value = wkMove; cmd.ExecuteNonQuery(); prm = null; cmd = null; cnn.CloseConnection(); cnn = null; }
public void GetProjectTotalByDate(int deptID, int projID, int weekID, ref decimal PTot, ref decimal FTot, ref decimal ATot) { SqlDataReader dr; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spScheduleHour_ProjTotalByDate", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@DepartmentID", SqlDbType.Int); prm.Value = deptID; prm = cmd.Parameters.Add("@ProjectID", SqlDbType.Int); prm.Value = projID; prm = cmd.Parameters.Add("@WeekID", SqlDbType.Int); prm.Value = weekID; dr = cmd.ExecuteReader(); while (dr.Read()) { //PTot = Convert.ToDecimal(dr["PHrs"]); PTot = Convert.ToDecimal(dr["PHrs"]); //FTot = Convert.ToDecimal(dr["FHrs"]); FTot = Convert.ToDecimal(dr["FHrs"]); //ATot = Convert.ToDecimal(dr["AHrs"]); ATot = Convert.ToDecimal(dr["AHrs"]); } dr.Close(); cmd = null; cnn.CloseConnection(); }
public int GetLastRevision(int projID) { SqlDataReader dr; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; int lastRev = 0; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spBudget_GetLastRevision", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@ProjectID", SqlDbType.Int); prm.Value = projID; dr = cmd.ExecuteReader(); while (dr.Read()) { lastRev = Convert.ToInt32(dr["CurrentCount"]); } dr.Close(); cnn.CloseConnection(); cmd = null; return(lastRev); }
public DataSet GetTravelExpenseReport(int budgetID) //*************************************9/17/2015 //*******************************I will keep it { RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; SqlDataAdapter da; DataSet ds; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spRPRT_TravelExpense", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@BudgetID", SqlDbType.Int); prm.Value = budgetID; da = new SqlDataAdapter(); da.SelectCommand = cmd; ds = new DataSet(); da.Fill(ds); cnn.CloseConnection(); return(ds); }
public DataSet GetTransmittalReleaseForReport(int releaseID) { DataSet ds; SqlDataAdapter da; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spRPRT_TransmittalRelease2", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@ReleaseID", SqlDbType.Int); prm.Value = releaseID; da = new SqlDataAdapter(); ds = new DataSet(); da.SelectCommand = cmd; da.Fill(ds); cnn.CloseConnection(); return(ds); }
public decimal GetTotalBudgetExpenses(int budgetID) { SqlDataReader dr; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; decimal totalDollars = 0; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spBudget_GetTotalExpensesByID", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@BudgetID", SqlDbType.Int); prm.Value = budgetID; dr = cmd.ExecuteReader(); while (dr.Read()) { totalDollars = Convert.ToDecimal(dr["TotalDollars"]); } dr.Close(); cnn.CloseConnection(); cmd = null; return(totalDollars); }
public int CopyExistingRelease(int relID) { int retVal = 0; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spTransmittalRelease_Copy2", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@NewID", SqlDbType.Int); prm.Direction = ParameterDirection.Output; prm = cmd.Parameters.Add("@OrgID", SqlDbType.Int); prm.Value = relID; cmd.ExecuteNonQuery(); retVal = Convert.ToInt32(cmd.Parameters["@NewID"].Value); prm = null; cmd = null; cnn.CloseConnection(); cnn = null; return(retVal); }
public DataSet GetWorkSheetDetailsForReport(int budgetID, string wbs) //*****************I probably dont need it { RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; SqlDataAdapter da; DataSet ds; cnn = new RSLib.CDbConnection(); // cmd = new SqlCommand("spRPRT_WorksheetDetail", cnn.GetConnection()); cmd = new SqlCommand("spRPRT_WorksheetDetail_Test", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@BudgetID", SqlDbType.Int); prm.Value = budgetID; prm = cmd.Parameters.Add("@WBS", SqlDbType.VarChar, 5); prm.Value = wbs; da = new SqlDataAdapter(); da.SelectCommand = cmd; ds = new DataSet(); da.Fill(ds); cnn.CloseConnection(); return(ds); }
public int SavePrev(string strXml) { RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; LoadVals(strXml); cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spPCNStatus_Update", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@ID", SqlDbType.Int); prm.Value = oVar.ID; prm = cmd.Parameters.Add("@Status", SqlDbType.VarChar, 50); prm.Value = oVar.Status; prm = cmd.Parameters.Add("@Description", SqlDbType.VarChar, 100); prm.Value = oVar.Description; cmd.ExecuteNonQuery(); prm = null; cmd = null; cnn.CloseConnection(); cnn = null; return(oVar.ID); }
public DataSet GetListOfDepartmentLevels(int userID) { DataSet ds; SqlDataAdapter da; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spUserLevel_ListDepartments", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@UserID", SqlDbType.Int); prm.Value = userID; da = new SqlDataAdapter(); da.SelectCommand = cmd; ds = new DataSet(); da.Fill(ds); cnn.CloseConnection(); return(ds); }
public SqlDataReader GetListbyBillType(int billType) { SqlDataReader dr; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spProjectList_ByBillType", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@Project", SqlDbType.Int); prm.Direction = ParameterDirection.Output; prm = cmd.Parameters.Add("@BillType", SqlDbType.Int); prm.Value = billType; dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); cmd = null; return(dr); }
public int SavePrev(string strXml) { RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; LoadVals(strXml); cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spUserLevel_Update", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@ID", SqlDbType.Int); prm.Value = oVar.ID; prm = cmd.Parameters.Add("@UserID", SqlDbType.Int); prm.Value = oVar.UserID; prm = cmd.Parameters.Add("@DepartmentID", SqlDbType.Int); prm.Value = oVar.DepartmentID; prm = cmd.Parameters.Add("@SecurityLevelID", SqlDbType.Int); prm.Value = oVar.SecurityLevelID; //prm = cmd.Parameters.Add("@SecurityLevelIDJS", SqlDbType.Int); //prm.Value = oVar.SecurityLevelIDJS; //prm = cmd.Parameters.Add("@SecurityLevelIDDRW", SqlDbType.Int); //prm.Value = oVar.SecurityLevelIDDRW; cmd.ExecuteNonQuery(); prm = null; cmd = null; cnn.CloseConnection(); cnn = null; return(oVar.ID); }
public DataSet GetListByDeptForCombo(int deptID) { RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; SqlDataAdapter da; DataSet ds; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spEmployee_ListByDept", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@DepartmentID", SqlDbType.Int); prm.Value = deptID; da = new SqlDataAdapter(); da.SelectCommand = cmd; ds = new DataSet(); da.Fill(ds); cmd = null; cnn.CloseConnection(); return(ds); }
public int GetID_ByActivityCode(int Code) //********************************Added 11/23 { SqlDataReader dr; RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; int ID = 0; cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spAcctCodes_GetID_ForExcelDropDown", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@Code", SqlDbType.Int); prm.Value = Code; prm = cmd.Parameters.Add("@ID", SqlDbType.Int); prm.Direction = ParameterDirection.Output; cmd.ExecuteNonQuery(); ID = Convert.ToInt32(cmd.Parameters["@ID"].Value); return(ID); }
public int SavePrev(string strXml) { RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; int retVal = 0; LoadVals(strXml); cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spDocumentReleaseType_Update", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@ID", SqlDbType.Int); prm.Value = oVar.ID; prm = cmd.Parameters.Add("@Code", SqlDbType.VarChar, 50); prm.Value = oVar.Code; prm = cmd.Parameters.Add("@Name", SqlDbType.VarChar, 50); prm.Value = oVar.Name; prm = cmd.Parameters.Add("@Ordinal", SqlDbType.Int); prm.Value = oVar.Ordinal; cmd.ExecuteNonQuery(); retVal = Convert.ToInt32(cmd.Parameters["@ID"].Value); prm = null; cmd = null; cnn.CloseConnection(); cnn = null; return(retVal); }
public int SavePrev(string strXml) { RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; LoadVals(strXml); cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spActivityCodes_Update", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@ID", SqlDbType.Int); prm.Value = oVar.ID; prm = cmd.Parameters.Add("@Code", SqlDbType.VarChar, 6); prm.Value = oVar.Code; prm = cmd.Parameters.Add("@Name", SqlDbType.VarChar, 50); prm.Value = oVar.Name; cmd.ExecuteNonQuery(); prm = null; cmd = null; cnn.CloseConnection(); cnn = null; return(oVar.ID); }
public int SavePrev(string strXml) { RSLib.CDbConnection cnn; SqlCommand cmd; SqlParameter prm; LoadVals(strXml); cnn = new RSLib.CDbConnection(); cmd = new SqlCommand("spBudget_Update", cnn.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; prm = cmd.Parameters.Add("@ID", SqlDbType.Int); prm.Value = oVar.ID; prm = cmd.Parameters.Add("@ProjectID", SqlDbType.Int); prm.Value = oVar.ProjectID; prm = cmd.Parameters.Add("@Revision", SqlDbType.Int); prm.Value = oVar.Revision; prm = cmd.Parameters.Add("@PCNID", SqlDbType.Int); prm.Value = oVar.PCNID; prm = cmd.Parameters.Add("@IsDefault", SqlDbType.Bit); prm.Value = oVar.IsDefault; prm = cmd.Parameters.Add("@IsActive", SqlDbType.Bit); prm.Value = oVar.IsActive; prm = cmd.Parameters.Add("@IsLocked", SqlDbType.Bit); prm.Value = oVar.IsLocked; prm = cmd.Parameters.Add("@Description", SqlDbType.VarChar, 100); prm.Value = oVar.Description; prm = cmd.Parameters.Add("@PreparedBy", SqlDbType.VarChar, 50); prm.Value = oVar.PreparedBy; prm = cmd.Parameters.Add("@Contingency", SqlDbType.Money); prm.Value = oVar.Contingency; prm = cmd.Parameters.Add("@Clarification11000", SqlDbType.VarChar, 500); prm.Value = oVar.Clarification11000; prm = cmd.Parameters.Add("@Clarification12000", SqlDbType.VarChar, 500); prm.Value = oVar.Clarification12000; prm = cmd.Parameters.Add("@Clarification13000", SqlDbType.VarChar, 500); prm.Value = oVar.Clarification13000; prm = cmd.Parameters.Add("@Clarification14000", SqlDbType.VarChar, 500); prm.Value = oVar.Clarification14000; prm = cmd.Parameters.Add("@Clarification15000", SqlDbType.VarChar, 500); prm.Value = oVar.Clarification15000; prm = cmd.Parameters.Add("@Clarification16000", SqlDbType.VarChar, 500); prm.Value = oVar.Clarification16000; prm = cmd.Parameters.Add("@Clarification17000", SqlDbType.VarChar, 500); prm.Value = oVar.Clarification17000; prm = cmd.Parameters.Add("@Clarification18000", SqlDbType.VarChar, 500); prm.Value = oVar.Clarification18000; prm = cmd.Parameters.Add("@Clarification50000", SqlDbType.VarChar, 500); prm.Value = oVar.Clarification50000; cmd.ExecuteNonQuery(); prm = null; cmd = null; cnn.CloseConnection(); cnn = null; return(oVar.ID); }