Example #1
0
        public int UpdateSectorInterest(SectorInterest newSectorInterest, out string savingReport)
        {
            try
            {
                SqlParameter[] param = new SqlParameter[5];

                param[0] = new SqlParameter("@SectorInterestID", newSectorInterest.SectorInterestID);
                param[1] = new SqlParameter("@SectorInterestName", newSectorInterest.SectorInterestName);
                param[2] = new SqlParameter("@SectorInterestDescription", newSectorInterest.SectorInterestDescription);
                param[3] = new SqlParameter("@LastModifiedBy", newSectorInterest.LastModifiedBy);
                param[4] = new SqlParameter("@LastModifiedDate", newSectorInterest.LastModifiedDate);

                savingReport = " Data Has been Saved.";

                clsSqlHelper.executeNonQuery_SP("sp_updateSectorInterest", param);
                return(int.Parse(clsSqlHelper.ExecuteScalar(" select Max(SectorInterestID) as SectorInterestID from SectorInterest ").ToString()));
            }

            catch (Exception ex)
            {
                savingReport = ex.Message;
                return(0);
            }
        }