public Guid ReadNotice(ReadNoitce newNotice) { string sql = string.Format("EXEC sp_readnotice_c {0},{1},{2},{3},{4},{5},{6},{7}" , ToQuote(newNotice.ID) , ToQuote(newNotice.Noticeid) , ToQuote(newNotice.Userid) , ToQuote(DateTime.Now) , ToQuote(CurrentUserName) , ToQuote(DateTime.Now) , ToQuote(CurrentUserName) , ToQuote(newNotice.Statues) ); try { int rowcount = SqlHelper.ExecuteNonQuery(ConnectStr, CommandType.Text, sql); if (rowcount == 1) { return(newNotice.ID); } else { throw new Exception("SQL execution failed"); } } catch (Exception ex) { throw new Exception("SQL execution failed", ex); } }
public void ReadBeautyNotice(string userid, string noticeid) { var noticeds = DataServiceContainer.Self.GetService <INotice>(); ReadNoitce model = new ReadNoitce { ID = Guid.NewGuid(), Userid = userid, Noticeid = noticeid }; noticeds.ReadNotice(model); }