Example #1
0
        public DataSet GetBudgetPCNInfoForReport(int pcnID)
        {
            RSLib.CDbConnection cnn;
            SqlCommand          cmd;
            SqlParameter        prm;
            SqlDataAdapter      da;
            DataSet             ds;

            cnn             = new RSLib.CDbConnection();
            cmd             = new SqlCommand("spRPRT_BudgetPCNInfo", cnn.GetConnection());
            cmd.CommandType = CommandType.StoredProcedure;

            prm       = cmd.Parameters.Add("@PCNID", SqlDbType.Int);
            prm.Value = pcnID;

            da = new SqlDataAdapter();
            da.SelectCommand = cmd;

            ds = new DataSet();
            da.Fill(ds);

            cnn.CloseConnection();

            return(ds);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
        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);
        }
Example #7
0
        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);
        }
Example #8
0
        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);
        }
Example #9
0
        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);
        }
Example #10
0
        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();
        }
Example #11
0
        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;
        }
Example #12
0
        public int GetBudgetsWithPCN(int pcnID)
        {
            SqlDataReader dr;

            RSLib.CDbConnection cnn;
            SqlCommand          cmd;
            SqlParameter        prm;
            int cnt = 0;

            cnn             = new RSLib.CDbConnection();
            cmd             = new SqlCommand("spBudgetPCN_GetCountByPCN", cnn.GetConnection());
            cmd.CommandType = CommandType.StoredProcedure;

            prm       = cmd.Parameters.Add("@PCNID", SqlDbType.Int);
            prm.Value = pcnID;

            dr = cmd.ExecuteReader();

            while (dr.Read())
            {
                cnt = Convert.ToInt32(dr["Cnt"]);
            }

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

            return(cnt);
        }
Example #13
0
        public void SetClientDate(int pcnID, DateTime clientSubmitted, DateTime clientReceived, string comments)
        {
            RSLib.CDbConnection cnn;
            SqlCommand          cmd;
            SqlParameter        prm;

            cnn             = new RSLib.CDbConnection();
            cmd             = new SqlCommand("spBudgetPCN_UpdateClientDates", cnn.GetConnection());
            cmd.CommandType = CommandType.StoredProcedure;

            prm       = cmd.Parameters.Add("@ID", SqlDbType.Int);
            prm.Value = pcnID;
            prm       = cmd.Parameters.Add("@ClientSubmitted", SqlDbType.SmallDateTime);
            prm.Value = clientSubmitted;
            prm       = cmd.Parameters.Add("@ClientReceived", SqlDbType.SmallDateTime);
            prm.Value = clientReceived;
            prm       = cmd.Parameters.Add("@Comments", SqlDbType.VarChar, 500);
            prm.Value = comments;

            cmd.ExecuteNonQuery();

            prm = null;
            cmd = null;
            cnn.CloseConnection();
            cnn = null;
        }
Example #14
0
        public decimal GetBudgetPCNDollars(int pcnID)
        {
            SqlDataReader dr;

            RSLib.CDbConnection cnn;
            SqlCommand          cmd;
            SqlParameter        prm;
            decimal             totDlrs = 0;

            cnn             = new RSLib.CDbConnection();
            cmd             = new SqlCommand("spBudgetPCN_GetTotalDollars", cnn.GetConnection());
            cmd.CommandType = CommandType.StoredProcedure;

            prm       = cmd.Parameters.Add("@PCNID", SqlDbType.Int);
            prm.Value = pcnID;

            dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);

            while (dr.Read())
            {
                totDlrs = Convert.ToDecimal(dr["TotDlrs"]);
            }
            dr.Close();
            dr  = null;
            prm = null;
            cmd = null;
            cnn.CloseConnection();
            cnn = null;

            return(totDlrs);
        }
Example #15
0
        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);
        }
Example #16
0
        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);
        }
Example #17
0
        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);
        }
Example #18
0
        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);
        }
Example #19
0
        //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);
        }
Example #20
0
        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);
        }
Example #21
0
        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);
        }
Example #22
0
        public bool CopyToNewProject(int currRelease, int newProjecID)
        {
            bool retVal = false;

            RSLib.CDbConnection cnn;
            SqlCommand          cmd;
            SqlParameter        prm;

            cnn             = new RSLib.CDbConnection();
            cmd             = new SqlCommand("spTransmittalRelease_CopyToNewProject2", cnn.GetConnection());
            cmd.CommandType = CommandType.StoredProcedure;

            prm       = cmd.Parameters.Add("@OrgRelease", SqlDbType.Int);
            prm.Value = currRelease;
            prm       = cmd.Parameters.Add("@NewProject", SqlDbType.Int);
            prm.Value = newProjecID;

            try
            {
                cmd.ExecuteNonQuery();
                retVal = true;
            }
            catch
            {
                retVal = false;
            }

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

            return(retVal);
        }
Example #23
0
        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);
        }
Example #24
0
        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);
        }
Example #25
0
        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);
        }
Example #26
0
        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);
        }
Example #27
0
        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);
        }
Example #28
0
        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);
        }
Example #29
0
        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);
        }
Example #30
0
        public int GetCountByProject(int projID)
        {
            SqlDataReader dr;

            RSLib.CDbConnection cnn;
            SqlCommand          cmd;
            SqlParameter        prm;
            int currCount = 0;

            cnn             = new RSLib.CDbConnection();
            cmd             = new SqlCommand("spBudgetPCN_GetCountByProject", cnn.GetConnection());
            cmd.CommandType = CommandType.StoredProcedure;
            prm             = cmd.Parameters.Add("@ProjectID", SqlDbType.Int);
            prm.Value       = projID;

            dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);

            while (dr.Read())
            {
                currCount = Convert.ToInt32(dr["Cnt"]);
            }

            dr.Close();
            cnn.CloseConnection();

            return(currCount);
        }